|
|
|
@ -410,15 +410,20 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void sendMessage(String message, Long userId, String type) {
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("message", message);
|
|
|
|
|
map.put("code", 500);
|
|
|
|
|
if (type.equals("create")) map.put("code", 200);
|
|
|
|
|
map.put("type", type);
|
|
|
|
|
|
|
|
|
|
JSONObject jsonData = new JSONObject();
|
|
|
|
|
jsonData.putOpt("data", map);
|
|
|
|
|
String messageJSON = JSONUtil.toJsonStr(jsonData);
|
|
|
|
|
map.put("code", 500);
|
|
|
|
|
String messageJSON;
|
|
|
|
|
if (type.equals("create")){
|
|
|
|
|
map.put("code", 200);
|
|
|
|
|
messageJSON = JSONUtil.toJsonStr(map);
|
|
|
|
|
} else {
|
|
|
|
|
JSONObject jsonData = new JSONObject();
|
|
|
|
|
jsonData.putOpt("data", map);
|
|
|
|
|
messageJSON = JSONUtil.toJsonStr(jsonData);
|
|
|
|
|
}
|
|
|
|
|
webSocketServer.sendMessage(messageJSON, userId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|