Merge remote-tracking branch 'origin/master-jdk21-ai' into master-jdk21-ai

This commit is contained in:
YunaiV 2024-05-15 19:44:45 +08:00
commit c5aab1aebd
2 changed files with 3 additions and 2 deletions

View File

@ -50,8 +50,9 @@ public interface AiChatRoleMapper extends BaseMapperX<AiChatRoleDO> {
default List<AiChatRoleDO> selectListGroupByCategory(Integer status) {
return selectList(new LambdaQueryWrapperX<AiChatRoleDO>()
.select(AiChatRoleDO::getCategory)
.eq(AiChatRoleDO::getStatus, status)
.apply("GROUP BY category"));
.groupBy(AiChatRoleDO::getCategory));
}
}

View File

@ -132,7 +132,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService {
@Override
public List<String> getChatRoleCategoryList() {
List<AiChatRoleDO> list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus());
return convertList(list, AiChatRoleDO::getName);
return convertList(list, AiChatRoleDO::getCategory);
}
}