|
|
@@ -41,7 +41,7 @@ public class DocMsgController extends BaseController {
|
|
|
/**
|
|
|
* 发送消息
|
|
|
*
|
|
|
- * @param msg
|
|
|
+ * @param msg 消息记录
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation("发送消息")
|
|
|
@@ -49,9 +49,13 @@ public class DocMsgController extends BaseController {
|
|
|
public AjaxResult send(@RequestBody DocMsg msg) {
|
|
|
msg.setFromUid(SecurityUtils.getUserId());
|
|
|
msg.setCreateTime(new Date());
|
|
|
- stringRedisTemplate.convertAndSend(CacheConstants.CHANNEL, JSON.toJSONString(msg));
|
|
|
- docMsgService.insertDocMsg(msg);
|
|
|
- return success();
|
|
|
+ try {
|
|
|
+ stringRedisTemplate.convertAndSend(CacheConstants.CHANNEL, JSON.toJSONString(msg));
|
|
|
+ docMsgService.insertDocMsg(msg);
|
|
|
+ } catch (Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
+ }
|
|
|
+ return success("消息发送成功");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -85,7 +89,7 @@ public class DocMsgController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation("导出消息管理列表")
|
|
|
//@PreAuthorize("@ss.hasPermi('biz:msg:export')")
|
|
|
- @Log(title = "消息管理" , businessType = BusinessType.EXPORT)
|
|
|
+ @Log(title = "消息管理", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
public void export(HttpServletResponse response, DocMsg docMsg) {
|
|
|
List<DocMsg> list = docMsgService.selectDocMsgList(docMsg);
|
|
|
@@ -108,7 +112,7 @@ public class DocMsgController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation("新增消息管理")
|
|
|
//@PreAuthorize("@ss.hasPermi('biz:msg:add')")
|
|
|
- @Log(title = "消息管理" , businessType = BusinessType.INSERT)
|
|
|
+ @Log(title = "消息管理", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody DocMsg docMsg) {
|
|
|
return toAjax(docMsgService.insertDocMsg(docMsg));
|
|
|
@@ -119,7 +123,7 @@ public class DocMsgController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation("修改消息管理")
|
|
|
//@PreAuthorize("@ss.hasPermi('biz:msg:edit')")
|
|
|
- @Log(title = "消息管理" , businessType = BusinessType.UPDATE)
|
|
|
+ @Log(title = "消息管理", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody DocMsg docMsg) {
|
|
|
return toAjax(docMsgService.updateDocMsg(docMsg));
|
|
|
@@ -130,7 +134,7 @@ public class DocMsgController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation("删除消息管理")
|
|
|
//@PreAuthorize("@ss.hasPermi('biz:msg:remove')")
|
|
|
- @Log(title = "消息管理" , businessType = BusinessType.DELETE)
|
|
|
+ @Log(title = "消息管理", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{msgIds}")
|
|
|
public AjaxResult remove(@PathVariable Long[] msgIds) {
|
|
|
return toAjax(docMsgService.deleteDocMsgByMsgIds(msgIds));
|