【优化】AI 角色分类,处理 role 空情况

This commit is contained in:
cherishsince 2024-05-21 22:46:59 +08:00
parent 99b6f24092
commit 12d3c0a9af

View File

@ -137,7 +137,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService {
@Override @Override
public List<String> getChatRoleCategoryList() { public List<String> getChatRoleCategoryList() {
List<AiChatRoleDO> list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus()); List<AiChatRoleDO> list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus());
return convertList(list, AiChatRoleDO::getCategory, role -> StrUtil.isNotBlank(role.getCategory())); return convertList(list, AiChatRoleDO::getCategory, role -> role != null && StrUtil.isNotBlank(role.getCategory()));
} }
} }