mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 02:08:43 +08:00 
			
		
		
		
	【调整】重命名 role req 和res,增加vo
This commit is contained in:
		| @@ -29,7 +29,7 @@ public class AiChatRoleController { | |||||||
|  |  | ||||||
|     @Operation(summary = "chat角色 - 角色列表") |     @Operation(summary = "chat角色 - 角色列表") | ||||||
|     @GetMapping("/list") |     @GetMapping("/list") | ||||||
|     public PageResult<AiChatRoleListRes> list(@Validated @ModelAttribute AiChatRoleListReq req) { |     public PageResult<AiChatRoleListRespVO> list(@Validated @ModelAttribute AiChatRoleListReqVO req) { | ||||||
|         return chatRoleService.list(req); |         return chatRoleService.list(req); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ import lombok.experimental.Accessors; | |||||||
|  */ |  */ | ||||||
| @Data | @Data | ||||||
| @Accessors(chain = true) | @Accessors(chain = true) | ||||||
| public class AiChatRoleListReq extends PageParam { | public class AiChatRoleListReqVO extends PageParam { | ||||||
| 
 | 
 | ||||||
|     @Schema(description = "查询") |     @Schema(description = "查询") | ||||||
|     private String search; |     private String search; | ||||||
| @@ -12,7 +12,7 @@ import lombok.experimental.Accessors; | |||||||
|  */ |  */ | ||||||
| @Data | @Data | ||||||
| @Accessors(chain = true) | @Accessors(chain = true) | ||||||
| public class AiChatRoleListRes { | public class AiChatRoleListRespVO { | ||||||
| 
 | 
 | ||||||
|     @Schema(description = "id") |     @Schema(description = "id") | ||||||
|     private Long id; |     private Long id; | ||||||
| @@ -12,7 +12,7 @@ import lombok.experimental.Accessors; | |||||||
|  */ |  */ | ||||||
| @Data | @Data | ||||||
| @Accessors(chain = true) | @Accessors(chain = true) | ||||||
| public class AiChatRoleRes { | public class AiChatRoleRespVO { | ||||||
| 
 | 
 | ||||||
|     @Schema(description = "id") |     @Schema(description = "id") | ||||||
|     private Long id; |     private Long id; | ||||||
| @@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.ai.convert; | |||||||
|  |  | ||||||
| import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO; | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO; | ||||||
| import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleAddReqVO; | import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleAddReqVO; | ||||||
| import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleRes; | import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleRespVO; | ||||||
| import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleUpdateReqVO; | import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleUpdateReqVO; | ||||||
| import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleListRes; | import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleListRespVO; | ||||||
| import org.mapstruct.Mapper; | import org.mapstruct.Mapper; | ||||||
| import org.mapstruct.factory.Mappers; | import org.mapstruct.factory.Mappers; | ||||||
|  |  | ||||||
| @@ -28,7 +28,7 @@ public interface AiChatRoleConvert { | |||||||
|      * @param roleList |      * @param roleList | ||||||
|      * @return |      * @return | ||||||
|      */ |      */ | ||||||
|     List<AiChatRoleListRes> convertChatRoleListRes(List<AiChatRoleDO> roleList); |     List<AiChatRoleListRespVO> convertChatRoleListRes(List<AiChatRoleDO> roleList); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 转换 - AiChatRoleDO |      * 转换 - AiChatRoleDO | ||||||
| @@ -52,5 +52,5 @@ public interface AiChatRoleConvert { | |||||||
|      * @param aiChatRoleDO |      * @param aiChatRoleDO | ||||||
|      * @return |      * @return | ||||||
|      */ |      */ | ||||||
|     AiChatRoleRes convertAiChatRoleRes(AiChatRoleDO aiChatRoleDO); |     AiChatRoleRespVO convertAiChatRoleRes(AiChatRoleDO aiChatRoleDO); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ public interface AiChatRoleService { | |||||||
|      * @param req |      * @param req | ||||||
|      * @return |      * @return | ||||||
|      */ |      */ | ||||||
|     PageResult<AiChatRoleListRes> list(AiChatRoleListReq req); |     PageResult<AiChatRoleListRespVO> list(AiChatRoleListReqVO req); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * chat角色 - 添加 |      * chat角色 - 添加 | ||||||
| @@ -56,7 +56,7 @@ public interface AiChatRoleService { | |||||||
|      * @param roleId |      * @param roleId | ||||||
|      * @return |      * @return | ||||||
|      */ |      */ | ||||||
|     AiChatRoleRes getChatRole(Long roleId); |     AiChatRoleRespVO getChatRole(Long roleId); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 校验 - 角色是否存在 |      * 校验 - 角色是否存在 | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatCo | |||||||
| import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationRespVO; | import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationRespVO; | ||||||
| import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationUpdateReqVO; | import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatConversationUpdateReqVO; | ||||||
| import cn.iocoder.yudao.module.ai.controller.admin.model.vo.model.AiChatModalRespVO; | import cn.iocoder.yudao.module.ai.controller.admin.model.vo.model.AiChatModalRespVO; | ||||||
| import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleRes; | import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleRespVO; | ||||||
| import cn.iocoder.yudao.module.ai.convert.AiChatConversationConvert; | import cn.iocoder.yudao.module.ai.convert.AiChatConversationConvert; | ||||||
| import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatConversationDO; | import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatConversationDO; | ||||||
| import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModalDO; | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModalDO; | ||||||
| @@ -47,7 +47,7 @@ public class AiChatConversationServiceImpl implements AiChatConversationService | |||||||
|         // 默认使用 sort 排序第一个模型 |         // 默认使用 sort 排序第一个模型 | ||||||
|         AiChatModalDO aiChatModalDO = aiChatModalMapper.selectFirstModal(); |         AiChatModalDO aiChatModalDO = aiChatModalMapper.selectFirstModal(); | ||||||
|         // 查询角色 |         // 查询角色 | ||||||
|         AiChatRoleRes chatRoleRes = null; |         AiChatRoleRespVO chatRoleRes = null; | ||||||
|         if (req.getRoleId() != null) { |         if (req.getRoleId() != null) { | ||||||
|             chatRoleRes = aiChatRoleService.getChatRole(req.getRoleId()); |             chatRoleRes = aiChatRoleService.getChatRole(req.getRoleId()); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -35,7 +35,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService { | |||||||
|     private final AiChatModalService aiChatModalService; |     private final AiChatModalService aiChatModalService; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public PageResult<AiChatRoleListRes> list(AiChatRoleListReq req) { |     public PageResult<AiChatRoleListRespVO> list(AiChatRoleListReqVO req) { | ||||||
|         // 查询条件 |         // 查询条件 | ||||||
|         LambdaQueryWrapperX<AiChatRoleDO> queryWrapperX = new LambdaQueryWrapperX<>(); |         LambdaQueryWrapperX<AiChatRoleDO> queryWrapperX = new LambdaQueryWrapperX<>(); | ||||||
|         // search 查询 |         // search 查询 | ||||||
| @@ -49,7 +49,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService { | |||||||
|         Long total = aiChatRoleDOPageResult.getTotal(); |         Long total = aiChatRoleDOPageResult.getTotal(); | ||||||
|         List<AiChatRoleDO> roleList = aiChatRoleDOPageResult.getList(); |         List<AiChatRoleDO> roleList = aiChatRoleDOPageResult.getList(); | ||||||
|         // 换货res |         // 换货res | ||||||
|         List<AiChatRoleListRes> chatRoleListResList = AiChatRoleConvert.INSTANCE.convertChatRoleListRes(roleList); |         List<AiChatRoleListRespVO> chatRoleListResList = AiChatRoleConvert.INSTANCE.convertChatRoleListRes(roleList); | ||||||
|         return new PageResult<>(chatRoleListResList, total); |         return new PageResult<>(chatRoleListResList, total); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -103,7 +103,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public AiChatRoleRes getChatRole(Long roleId) { |     public AiChatRoleRespVO getChatRole(Long roleId) { | ||||||
|         // 检查角色是否存在 |         // 检查角色是否存在 | ||||||
|         AiChatRoleDO aiChatRoleDO = validateExists(roleId); |         AiChatRoleDO aiChatRoleDO = validateExists(roleId); | ||||||
|         return AiChatRoleConvert.INSTANCE.convertAiChatRoleRes(aiChatRoleDO); |         return AiChatRoleConvert.INSTANCE.convertAiChatRoleRes(aiChatRoleDO); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 cherishsince
					cherishsince