mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 09:11:52 +08:00
【增加】清空 Chat 对话
This commit is contained in:
parent
e7a3f47d02
commit
fe63bda4c7
@ -69,6 +69,13 @@ public class AiChatConversationController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-my-all-except-pinned")
|
||||
@Operation(summary = "删除所有对话(置顶除外)")
|
||||
@Parameter(name = "id", required = true, description = "会话编号", example = "1024")
|
||||
public CommonResult<Boolean> deleteMyAllExceptPinned() {
|
||||
chatConversationService.deleteMyAllExceptPinned(getLoginUserId());
|
||||
return success(true);
|
||||
}
|
||||
// ========== 会话管理 ==========
|
||||
|
||||
}
|
||||
|
@ -62,4 +62,10 @@ public interface AiChatConversationService {
|
||||
*/
|
||||
AiChatConversationDO validateExists(Long id);
|
||||
|
||||
/**
|
||||
* 删除 - 所有对话,置顶除外
|
||||
*
|
||||
* @param loginUserId
|
||||
*/
|
||||
void deleteMyAllExceptPinned(Long loginUserId);
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationCreateMyReqVO;
|
||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationRespVO;
|
||||
import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationUpdateMyReqVO;
|
||||
import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatConversationDO;
|
||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModelDO;
|
||||
@ -21,8 +21,9 @@ import org.springframework.validation.annotation.Validated;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.*;
|
||||
import static cn.iocoder.yudao.module.ai.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.ai.ErrorCodeConstants.CHAT_CONVERSATION_MODEL_ERROR;
|
||||
import static cn.iocoder.yudao.module.ai.ErrorCodeConstants.CHAT_CONVERSATION_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* AI 聊天对话 Service 实现类
|
||||
@ -124,4 +125,13 @@ public class AiChatConversationServiceImpl implements AiChatConversationService
|
||||
return conversation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMyAllExceptPinned(Long loginUserId) {
|
||||
chatConversationMapper.delete(
|
||||
new LambdaQueryWrapperX<AiChatConversationDO>()
|
||||
.eq(AiChatConversationDO::getUserId, loginUserId)
|
||||
.eq(AiChatConversationDO::getPinned, false)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user