change - websocket api返回值修改

dev
Wen JY 1 year ago
parent 1f29cf95d2
commit 495289af1a

File diff suppressed because it is too large Load Diff

@ -27,9 +27,6 @@ spring:
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: localhost:8848
config:
# 配置中心地址
server-addr: localhost:8848

@ -3,6 +3,7 @@ package com.hw.websocket.controller;
import com.alibaba.fastjson2.JSONObject;
import com.hw.websocket.operate.WebSocket;
import com.ruoyi.common.core.utils.uuid.UUID;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -29,11 +30,15 @@ public class WebSocketApi {
@PostMapping()
@ResponseBody
public void push(String message){
public AjaxResult push(String message){
String info = null;
try{
String[] split = info.split("1");
webSocket.sendAllMessage(message);
return AjaxResult.success();
}catch (Exception ex){
logger.error("WebSocket Api接口异常:"+ex.getMessage());
return AjaxResult.error(ex.getMessage());
}
}
}

@ -5,21 +5,21 @@ server:
# Spring
spring:
application:
# ????
# 应用名称
name: hw-websocket
profiles:
# ????
# 环境配置
active: dev
cloud:
nacos:
discovery:
# ??????
# 服务注册地址
server-addr: localhost:8848
config:
# ??????
# 配置中心地址
server-addr: localhost:8848
# ??????
# 配置文件格式
file-extension: yml
# ????
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

Loading…
Cancel
Save