mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-31 09:30:05 +08:00
对话不存在时,thow异常
This commit is contained in:
parent
2ce5c805de
commit
97d4e56c81
@ -1,6 +1,8 @@
|
|||||||
package cn.iocoder.yudao.module.ai.service.impl;
|
package cn.iocoder.yudao.module.ai.service.impl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.module.ai.ErrorCodeConstants;
|
||||||
import cn.iocoder.yudao.module.ai.convert.ChatConversationConvert;
|
import cn.iocoder.yudao.module.ai.convert.ChatConversationConvert;
|
||||||
import cn.iocoder.yudao.module.ai.dataobject.AiChatConversationDO;
|
import cn.iocoder.yudao.module.ai.dataobject.AiChatConversationDO;
|
||||||
import cn.iocoder.yudao.module.ai.mapper.AiChatConversationMapper;
|
import cn.iocoder.yudao.module.ai.mapper.AiChatConversationMapper;
|
||||||
@ -54,6 +56,9 @@ public class ChatConversationServiceImpl implements ChatConversationService {
|
|||||||
@Override
|
@Override
|
||||||
public ChatConversationRes getConversation(Long id) {
|
public ChatConversationRes getConversation(Long id) {
|
||||||
AiChatConversationDO aiChatConversationDO = aiChatConversationMapper.selectById(id);
|
AiChatConversationDO aiChatConversationDO = aiChatConversationMapper.selectById(id);
|
||||||
|
if (aiChatConversationDO == null) {
|
||||||
|
throw ServiceExceptionUtil.exception(ErrorCodeConstants.AI_CHAT_CONTINUE_NOT_EXIST);
|
||||||
|
}
|
||||||
return ChatConversationConvert.INSTANCE.covnertChatConversationRes(aiChatConversationDO);
|
return ChatConversationConvert.INSTANCE.covnertChatConversationRes(aiChatConversationDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user