|
|
|
@ -2,6 +2,7 @@ package com.hw.websocket.controller;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
import com.hw.websocket.operate.WebSocket;
|
|
|
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
|
|
|
import com.ruoyi.common.core.utils.uuid.UUID;
|
|
|
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
@ -31,9 +32,12 @@ public class WebSocketApi {
|
|
|
|
|
@PostMapping()
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult push(String message){
|
|
|
|
|
String info = null;
|
|
|
|
|
try{
|
|
|
|
|
String[] split = info.split("1");
|
|
|
|
|
if(StringUtils.isEmpty(message)){
|
|
|
|
|
logger.info("WebSocket Api接收数据为空");
|
|
|
|
|
return AjaxResult.error("参数不允许为空");
|
|
|
|
|
}
|
|
|
|
|
logger.info("WebSocket Api接收数据:"+message);
|
|
|
|
|
webSocket.sendAllMessage(message);
|
|
|
|
|
return AjaxResult.success();
|
|
|
|
|
}catch (Exception ex){
|
|
|
|
|