diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/impl/ChatRoleServiceImpl.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/impl/ChatRoleServiceImpl.java index 2fdb16681..4f96840b5 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/impl/ChatRoleServiceImpl.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/impl/ChatRoleServiceImpl.java @@ -95,7 +95,10 @@ public class ChatRoleServiceImpl implements ChatRoleService { @Override public void delete(Long chatRoleId) { - + // 检查角色是否存在 + validateChatRoleExists(chatRoleId); + // 删除 + aiChatRoleMapper.deleteById(chatRoleId); } private AiChatRoleDO validateChatRoleExists(Long id) { @@ -105,5 +108,4 @@ public class ChatRoleServiceImpl implements ChatRoleService { } return aiChatRoleDO; } - }