Commit c5aab1aebd059250f2a78284cb9181e2c6dee434
Merge remote-tracking branch 'origin/master-jdk21-ai' into master-jdk21-ai
Showing
2 changed files
with
3 additions
and
2 deletions
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/AiChatRoleMapper.java
| @@ -50,8 +50,9 @@ public interface AiChatRoleMapper extends BaseMapperX<AiChatRoleDO> { | @@ -50,8 +50,9 @@ public interface AiChatRoleMapper extends BaseMapperX<AiChatRoleDO> { | ||
| 50 | 50 | ||
| 51 | default List<AiChatRoleDO> selectListGroupByCategory(Integer status) { | 51 | default List<AiChatRoleDO> selectListGroupByCategory(Integer status) { |
| 52 | return selectList(new LambdaQueryWrapperX<AiChatRoleDO>() | 52 | return selectList(new LambdaQueryWrapperX<AiChatRoleDO>() |
| 53 | + .select(AiChatRoleDO::getCategory) | ||
| 53 | .eq(AiChatRoleDO::getStatus, status) | 54 | .eq(AiChatRoleDO::getStatus, status) |
| 54 | - .apply("GROUP BY category")); | 55 | + .groupBy(AiChatRoleDO::getCategory)); |
| 55 | } | 56 | } |
| 56 | 57 | ||
| 57 | } | 58 | } |
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatRoleServiceImpl.java
| @@ -132,7 +132,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService { | @@ -132,7 +132,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService { | ||
| 132 | @Override | 132 | @Override |
| 133 | public List<String> getChatRoleCategoryList() { | 133 | public List<String> getChatRoleCategoryList() { |
| 134 | List<AiChatRoleDO> list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus()); | 134 | List<AiChatRoleDO> list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus()); |
| 135 | - return convertList(list, AiChatRoleDO::getName); | 135 | + return convertList(list, AiChatRoleDO::getCategory); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | } | 138 | } |