|
@@ -1,12 +1,19 @@
|
|
|
package thyyxxk.webserver.controller.zhuyuanyizheng.emr;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import thyyxxk.webserver.config.auth.PassToken;
|
|
|
+import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.login.UserInfo;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrSocketMessage;
|
|
|
+import thyyxxk.webserver.service.externalhttp.WebSocketService;
|
|
|
+import thyyxxk.webserver.service.redislike.RedisLikeService;
|
|
|
import thyyxxk.webserver.service.zhuyuanyisheng.emr.EmrWebSocketServer;
|
|
|
import thyyxxk.webserver.service.zhuyuanyisheng.emr.EmrWebSocketServiceV2;
|
|
|
+import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
+import thyyxxk.webserver.utils.StringUtil;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -17,11 +24,15 @@ public class EmrWebSocketController {
|
|
|
|
|
|
private final EmrWebSocketServer server;
|
|
|
private final EmrWebSocketServiceV2 emrWebSocketServerV2;
|
|
|
+ private final WebSocketService webSocketService;
|
|
|
+ private final RedisLikeService redisLikeService;
|
|
|
|
|
|
@Autowired
|
|
|
- public EmrWebSocketController(EmrWebSocketServer server, EmrWebSocketServiceV2 emrWebSocketServerV2) {
|
|
|
+ public EmrWebSocketController(EmrWebSocketServer server, EmrWebSocketServiceV2 emrWebSocketServerV2, WebSocketService webSocketService, RedisLikeService redisLikeService) {
|
|
|
this.server = server;
|
|
|
this.emrWebSocketServerV2 = emrWebSocketServerV2;
|
|
|
+ this.webSocketService = webSocketService;
|
|
|
+ this.redisLikeService = redisLikeService;
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getRoomPeople")
|
|
@@ -52,9 +63,26 @@ public class EmrWebSocketController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/forcedKickingOutOfPersonnelByDocumentId")
|
|
|
- public void forcedKickingOutOfPersonnelByDocumentId(@RequestParam("documentId") String documentId) {
|
|
|
- emrWebSocketServerV2.forcedKickingOutOfPersonnelByDocumentId(documentId);
|
|
|
+ public ResultVo<String> forcedKickingOutOfPersonnelByDocumentId(@RequestParam("documentId") String documentId) {
|
|
|
+ return emrWebSocketServerV2.forcedKickingOutOfPersonnelByDocumentId(documentId);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/sendEmrSocketMessage")
|
|
|
+ @PassToken
|
|
|
+ public ResultVo<String> sendEmrSocketMessage(@RequestBody JSONObject js) {
|
|
|
+ webSocketService.sendEmrSocketMessage(js);
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getCurrentDocumentUserCode")
|
|
|
+ @PassToken
|
|
|
+ public ResultVo<UserInfo> getCurrentDocumentUserCode(@RequestParam("documentId") String documentId) {
|
|
|
+ ResultVo<String> res = webSocketService.getCurrentDocumentUserCode(documentId);
|
|
|
+ String userCode = res.getData();
|
|
|
+ if (StringUtil.isBlank(userCode)) {
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS, null, null);
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success(redisLikeService.getUserInfoByCode(userCode));
|
|
|
+ }
|
|
|
|
|
|
}
|