MALL-KEFU: 优化管理员会话处理逻辑

This commit is contained in:
puhui999 2024-07-05 17:59:47 +08:00
parent 19e7763440
commit 4a39595576
2 changed files with 6 additions and 2 deletions

View File

@ -34,8 +34,8 @@ public class KeFuConversationController {
@Resource
private MemberUserApi memberUserApi;
@PostMapping("/update-conversation-pinned")
@Operation(summary = "置顶客服会话")
@PutMapping("/update-conversation-pinned")
@Operation(summary = "置顶/取消置顶客服会话")
@PreAuthorize("@ss.hasPermission('promotion:kefu-conversation:update')")
public CommonResult<Boolean> updateConversationPinned(@Valid @RequestBody KeFuConversationUpdatePinnedReqVO updateReqVO) {
conversationService.updateConversationPinnedByAdmin(updateReqVO);

View File

@ -41,6 +41,10 @@ public class KeFuConversationServiceImpl implements KeFuConversationService {
@Override
public void updateConversationPinnedByAdmin(KeFuConversationUpdatePinnedReqVO updateReqVO) {
// 校验存在
validateKefuConversationExists(updateReqVO.getId());
// 更新管理员会话置顶状态
conversationMapper.updateById(new KeFuConversationDO().setId(updateReqVO.getId()).setAdminPinned(updateReqVO.getAdminPinned()));
}