Commit 4a395955769ca03baeff3820f4829a5f78864a60
1 parent
19e77634
MALL-KEFU: 优化管理员会话处理逻辑
Showing
2 changed files
with
6 additions
and
2 deletions
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/kefu/KeFuConversationController.java
| ... | ... | @@ -34,8 +34,8 @@ public class KeFuConversationController { |
| 34 | 34 | @Resource |
| 35 | 35 | private MemberUserApi memberUserApi; |
| 36 | 36 | |
| 37 | - @PostMapping("/update-conversation-pinned") | |
| 38 | - @Operation(summary = "置顶客服会话") | |
| 37 | + @PutMapping("/update-conversation-pinned") | |
| 38 | + @Operation(summary = "置顶/取消置顶客服会话") | |
| 39 | 39 | @PreAuthorize("@ss.hasPermission('promotion:kefu-conversation:update')") |
| 40 | 40 | public CommonResult<Boolean> updateConversationPinned(@Valid @RequestBody KeFuConversationUpdatePinnedReqVO updateReqVO) { |
| 41 | 41 | conversationService.updateConversationPinnedByAdmin(updateReqVO); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/kefu/KeFuConversationServiceImpl.java
| ... | ... | @@ -41,6 +41,10 @@ public class KeFuConversationServiceImpl implements KeFuConversationService { |
| 41 | 41 | |
| 42 | 42 | @Override |
| 43 | 43 | public void updateConversationPinnedByAdmin(KeFuConversationUpdatePinnedReqVO updateReqVO) { |
| 44 | + // 校验存在 | |
| 45 | + validateKefuConversationExists(updateReqVO.getId()); | |
| 46 | + | |
| 47 | + // 更新管理员会话置顶状态 | |
| 44 | 48 | conversationMapper.updateById(new KeFuConversationDO().setId(updateReqVO.getId()).setAdminPinned(updateReqVO.getAdminPinned())); |
| 45 | 49 | } |
| 46 | 50 | ... | ... |