|
@@ -14,6 +14,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
|
@@ -132,7 +134,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService {
|
|
|
@Override
|
|
|
public List<String> getChatRoleCategoryList() {
|
|
|
List<AiChatRoleDO> list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus());
|
|
|
- return convertList(list, AiChatRoleDO::getCategory);
|
|
|
+ return convertList(list.stream().filter(Objects::nonNull).collect(Collectors.toList()), AiChatRoleDO::getCategory);
|
|
|
}
|
|
|
|
|
|
}
|