|
|
|
@ -2,13 +2,14 @@ package com.supervision.controller;
|
|
|
|
|
|
|
|
|
|
import com.supervision.websocket.cache.WebSocketUserCache;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import org.springframework.messaging.simp.SimpMessagingTemplate;
|
|
|
|
|
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;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
import org.springframework.web.socket.TextMessage;
|
|
|
|
|
import org.springframework.web.socket.WebSocketSession;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
@Api(tags = "问诊")
|
|
|
|
@ -16,11 +17,18 @@ import java.io.IOException;
|
|
|
|
|
@RequestMapping("/ask/")
|
|
|
|
|
public class AskController {
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/send")
|
|
|
|
|
public void sendMessage(String message,String id) throws IOException {
|
|
|
|
|
WebSocketSession session = WebSocketUserCache.getSession(id);
|
|
|
|
|
@GetMapping("/sendMessage")
|
|
|
|
|
public void sendMessage(String message, String sessionId) throws IOException {
|
|
|
|
|
WebSocketSession session = WebSocketUserCache.getSession(sessionId);
|
|
|
|
|
session.sendMessage(new TextMessage(message));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/receiveVoiceFile")
|
|
|
|
|
public void receiveVoiceFile(MultipartFile file){
|
|
|
|
|
long size = file.getSize();
|
|
|
|
|
System.out.println(size);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|