You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virtual-patient/virtual-patient-web/src/main/java/com/supervision/controller/AskController.java

35 lines
1.1 KiB
Java

package com.supervision.controller;
import com.supervision.websocket.cache.WebSocketUserCache;
import io.swagger.annotations.Api;
2 years ago
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
2 years ago
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import java.io.IOException;
@Api(tags = "问诊")
@RestController
@RequestMapping("/ask/")
public class AskController {
2 years ago
@GetMapping("/sendMessage")
public void sendMessage(String message, String sessionId) throws IOException {
WebSocketSession session = WebSocketUserCache.getSession(sessionId);
session.sendMessage(new TextMessage(message));
}
2 years ago
@PostMapping("/receiveVoiceFile")
public void receiveVoiceFile(MultipartFile file){
long size = file.getSize();
System.out.println(size);
}
}