Browse Source

取消聊天消息的权限要求

wukai 2 years ago
parent
commit
7cefaef263

+ 1 - 3
doc-admin/src/main/java/com/doc/web/controller/system/SysUserController.java

@@ -4,7 +4,6 @@ import com.doc.biz.service.IDocSpaceService;
 import com.doc.common.annotation.Log;
 import com.doc.common.core.controller.BaseController;
 import com.doc.common.core.domain.AjaxResult;
-import com.doc.common.core.domain.TreeSelect;
 import com.doc.common.core.domain.entity.SysDept;
 import com.doc.common.core.domain.entity.SysRole;
 import com.doc.common.core.domain.entity.SysUser;
@@ -86,8 +85,7 @@ public class SysUserController extends BaseController {
         List<SysDept> deptList = deptService.selectAllDeptList();
         List<SysDept> list = deptService.buildDeptTree(deptList);
         SysDept tree = list.get(0);
-        UserTreeVO vo = getChildren(tree);
-        return vo;
+        return getChildren(tree);
 
     }
 

+ 13 - 10
doc-biz/src/main/java/com/doc/chat/controller/ChatMsgController.java

@@ -56,6 +56,9 @@ public class ChatMsgController extends BaseController {
     @PostMapping("/send")
     public AjaxResult send(@RequestBody ChatMsg msg) {
         msg.setFromId(SecurityUtils.getUserId());
+        if (msg.getFromId().equals(msg.getToId())) {
+            return error("不允许给自己发送消息");
+        }
         msg.setCreateTime(new Date());
         stringRedisTemplate.convertAndSend(CacheConstants.CHANNEL, JSON.toJSONString(msg));
         chatMsgService.insertChatMsg(msg);
@@ -90,7 +93,7 @@ public class ChatMsgController extends BaseController {
      * 查询聊天消息管理列表
      */
     @ApiOperation("查询聊天消息管理列表")
-    @PreAuthorize("@ss.hasPermi('chat:msg:list')")
+//    @PreAuthorize("@ss.hasPermi('chat:msg:list')")
     @GetMapping("/list")
     public TableDataInfo list(ChatMsg chatMsg) {
         startPage();
@@ -102,8 +105,8 @@ public class ChatMsgController extends BaseController {
      * 导出聊天消息管理列表
      */
     @ApiOperation("导出聊天消息管理列表")
-    @PreAuthorize("@ss.hasPermi('chat:msg:export')")
-    @Log(title = "聊天消息管理" , businessType = BusinessType.EXPORT)
+//    @PreAuthorize("@ss.hasPermi('chat:msg:export')")
+    @Log(title = "聊天消息管理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, ChatMsg chatMsg) {
         List<ChatMsg> list = chatMsgService.selectChatMsgList(chatMsg);
@@ -115,7 +118,7 @@ public class ChatMsgController extends BaseController {
      * 获取聊天消息管理详细信息
      */
     @ApiOperation("获取聊天消息管理详细信息")
-    @PreAuthorize("@ss.hasPermi('chat:msg:query')")
+//    @PreAuthorize("@ss.hasPermi('chat:msg:query')")
     @GetMapping(value = "/{msgId}")
     public AjaxResult getInfo(@PathVariable("msgId") Long msgId) {
         return success(chatMsgService.selectChatMsgByMsgId(msgId));
@@ -125,8 +128,8 @@ public class ChatMsgController extends BaseController {
      * 新增聊天消息管理
      */
     @ApiOperation("新增聊天消息管理")
-    @PreAuthorize("@ss.hasPermi('chat:msg:add')")
-    @Log(title = "聊天消息管理" , businessType = BusinessType.INSERT)
+//    @PreAuthorize("@ss.hasPermi('chat:msg:add')")
+    @Log(title = "聊天消息管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody ChatMsg chatMsg) {
         return toAjax(chatMsgService.insertChatMsg(chatMsg));
@@ -136,8 +139,8 @@ public class ChatMsgController extends BaseController {
      * 修改聊天消息管理
      */
     @ApiOperation("修改聊天消息管理")
-    @PreAuthorize("@ss.hasPermi('chat:msg:edit')")
-    @Log(title = "聊天消息管理" , businessType = BusinessType.UPDATE)
+//    @PreAuthorize("@ss.hasPermi('chat:msg:edit')")
+    @Log(title = "聊天消息管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody ChatMsg chatMsg) {
         return toAjax(chatMsgService.updateChatMsg(chatMsg));
@@ -147,8 +150,8 @@ public class ChatMsgController extends BaseController {
      * 删除聊天消息管理
      */
     @ApiOperation("删除聊天消息管理")
-    @PreAuthorize("@ss.hasPermi('chat:msg:remove')")
-    @Log(title = "聊天消息管理" , businessType = BusinessType.DELETE)
+//    @PreAuthorize("@ss.hasPermi('chat:msg:remove')")
+    @Log(title = "聊天消息管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{msgIds}")
     public AjaxResult remove(@PathVariable Long[] msgIds) {
         return toAjax(chatMsgService.deleteChatMsgByMsgIds(msgIds));