【修改】全局处理Result,去除已放弃的类型,去掉success统一改为OK
【修改】系统公告无法查看的的问题处理
This commit is contained in:
+4
-7
@@ -150,21 +150,18 @@ public class SysMessageTemplateController extends JeroController<SysMessageTempl
|
||||
* 发送消息
|
||||
*/
|
||||
@PostMapping(value = "/sendMsg")
|
||||
public Result<SysMessageTemplate> sendMessage(@RequestBody MsgParams msgParams) {
|
||||
Result<SysMessageTemplate> result = new Result<SysMessageTemplate>();
|
||||
public Result<Object> sendMessage(@RequestBody MsgParams msgParams) {
|
||||
Map<String, String> map = null;
|
||||
try {
|
||||
map = (Map<String, String>) JSON.parse(msgParams.getTestData());
|
||||
} catch (Exception e) {
|
||||
result.error500("解析Json出错!");
|
||||
return result;
|
||||
return Result.error500("解析Json出错!");
|
||||
}
|
||||
boolean is_sendSuccess = pushMsgUtil.sendMessage(msgParams.getMsgType(), msgParams.getTemplateCode(), map, msgParams.getReceiver());
|
||||
if (is_sendSuccess) {
|
||||
result.success("发送消息任务添加成功!");
|
||||
return Result.OK("发送消息任务添加成功!");
|
||||
} else {
|
||||
result.error500("发送消息任务添加失败!");
|
||||
return Result.error500("发送消息任务添加失败!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user