Commit 2942ec4e authored by luojun's avatar luojun

冲突解决

parent f8bda957
Pipeline #6413 canceled with stages
...@@ -103,20 +103,20 @@ public class VoiceWebSocketServer { ...@@ -103,20 +103,20 @@ public class VoiceWebSocketServer {
@OnMessage(maxMessageSize = 10*1024*1024) @OnMessage(maxMessageSize = 10*1024*1024)
public void onTextMessage(Session session,String message) throws IOException { public void onTextMessage(Session session,String message) throws IOException {
// session.setMaxBinaryMessageBufferSize(50 * 1024 * 1024); // session.setMaxBinaryMessageBufferSize(50 * 1024 * 1024);
log.info("message:{}",message); log.info("message:{}", message);
@SuppressWarnings({"unchecked"}) @SuppressWarnings({"unchecked"})
Map<String,Object> map = JSON.parseObject(message,Map.class); Map<String, Object> map = JSON.parseObject(message, Map.class);
WebSocketModel webSocketModel = JSON.parseObject(message,WebSocketModel.class); WebSocketModel webSocketModel = JSON.parseObject(message, WebSocketModel.class);
//1.如果问题不存在则创建问题 //1.如果问题不存在则创建问题
ChatgptRoleSession byId = chatgptRoleSessionService.getById(webSocketModel.getSessionId()); ChatgptRoleSession byId = chatgptRoleSessionService.getById(webSocketModel.getSessionId());
if (byId == null&&webSocketModel.getAction().equals("text")){ if (byId == null && webSocketModel.getAction().equals("text")) {
ChatgptRoleSession chatgptRoleSession = new ChatgptRoleSession(); ChatgptRoleSession chatgptRoleSession = new ChatgptRoleSession();
chatgptRoleSession.setId(Integer.valueOf(webSocketModel.getSessionId())); chatgptRoleSession.setId(Integer.valueOf(webSocketModel.getSessionId()));
chatgptRoleSession.setName(webSocketModel.getData()); chatgptRoleSession.setName(webSocketModel.getData());
chatgptRoleSession.setRoleDescId(10001); chatgptRoleSession.setRoleDescId(10001);
chatgptRoleSession.setUserId(ScreenEnum.getByUserName(webSocketModel.getName())); chatgptRoleSession.setUserId(ScreenEnum.getByUserName(webSocketModel.getName()));
chatgptRoleSessionService.save(chatgptRoleSession); chatgptRoleSessionService.save(chatgptRoleSession);
}else if (byId!=null && webSocketModel.getAction().equals("text")){ } else if (byId != null && webSocketModel.getAction().equals("text")) {
ChatgptRoleRecords chatgptRoleRecords = new ChatgptRoleRecords(); ChatgptRoleRecords chatgptRoleRecords = new ChatgptRoleRecords();
chatgptRoleRecords.setMessage(webSocketModel.getData()); chatgptRoleRecords.setMessage(webSocketModel.getData());
chatgptRoleRecords.setReceiverId(10001); chatgptRoleRecords.setReceiverId(10001);
...@@ -126,15 +126,15 @@ public class VoiceWebSocketServer { ...@@ -126,15 +126,15 @@ public class VoiceWebSocketServer {
} }
String msg = ""; String msg = "";
// 文字聊天 // 文字聊天
if("sendText".equals(map.get("action"))){ if ("sendText".equals(map.get("action"))) {
msg = (String)map.get("data"); msg = (String) map.get("data");
if("sendText".equals(webSocketModel.getAction())){ if ("sendText".equals(webSocketModel.getAction())) {
msg = webSocketModel.getData(); msg = webSocketModel.getData();
} }
if(msg != null && !msg.isEmpty()){ if (msg != null && !msg.isEmpty()) {
maxkbOpenApiService.talk(msg,session); maxkbOpenApiService.talk(msg, session);
}
} }
} }
// @OnMessage // @OnMessage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment