【调整】重命名 role req 和res,增加vo

This commit is contained in:
cherishsince 2024-05-07 11:49:49 +08:00
parent 53f4ad43d8
commit f438e68dc9
8 changed files with 15 additions and 15 deletions

View File

@ -29,7 +29,7 @@ public class AiChatRoleController {
@Operation(summary = "chat角色 - 角色列表")
@GetMapping("/list")
public PageResult<AiChatRoleListRes> list(@Validated @ModelAttribute AiChatRoleListReq req) {
public PageResult<AiChatRoleListRespVO> list(@Validated @ModelAttribute AiChatRoleListReqVO req) {
return chatRoleService.list(req);
}

View File

@ -13,7 +13,7 @@ import lombok.experimental.Accessors;
*/
@Data
@Accessors(chain = true)
public class AiChatRoleListReq extends PageParam {
public class AiChatRoleListReqVO extends PageParam {
@Schema(description = "查询")
private String search;

View File

@ -12,7 +12,7 @@ import lombok.experimental.Accessors;
*/
@Data
@Accessors(chain = true)
public class AiChatRoleListRes {
public class AiChatRoleListRespVO {
@Schema(description = "id")
private Long id;

View File

@ -12,7 +12,7 @@ import lombok.experimental.Accessors;
*/
@Data
@Accessors(chain = true)
public class AiChatRoleRes {
public class AiChatRoleRespVO {
@Schema(description = "id")
private Long id;

View File

@ -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.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.AiChatRoleListRes;
import cn.iocoder.yudao.module.ai.controller.admin.model.vo.role.AiChatRoleListRespVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@ -28,7 +28,7 @@ public interface AiChatRoleConvert {
* @param roleList
* @return
*/
List<AiChatRoleListRes> convertChatRoleListRes(List<AiChatRoleDO> roleList);
List<AiChatRoleListRespVO> convertChatRoleListRes(List<AiChatRoleDO> roleList);
/**
* 转换 - AiChatRoleDO
@ -52,5 +52,5 @@ public interface AiChatRoleConvert {
* @param aiChatRoleDO
* @return
*/
AiChatRoleRes convertAiChatRoleRes(AiChatRoleDO aiChatRoleDO);
AiChatRoleRespVO convertAiChatRoleRes(AiChatRoleDO aiChatRoleDO);
}

View File

@ -18,7 +18,7 @@ public interface AiChatRoleService {
* @param req
* @return
*/
PageResult<AiChatRoleListRes> list(AiChatRoleListReq req);
PageResult<AiChatRoleListRespVO> list(AiChatRoleListReqVO req);
/**
* chat角色 - 添加
@ -56,7 +56,7 @@ public interface AiChatRoleService {
* @param roleId
* @return
*/
AiChatRoleRes getChatRole(Long roleId);
AiChatRoleRespVO getChatRole(Long roleId);
/**
* 校验 - 角色是否存在

View File

@ -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.AiChatConversationUpdateReqVO;
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.dal.dataobject.chat.AiChatConversationDO;
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModalDO;
@ -47,7 +47,7 @@ public class AiChatConversationServiceImpl implements AiChatConversationService
// 默认使用 sort 排序第一个模型
AiChatModalDO aiChatModalDO = aiChatModalMapper.selectFirstModal();
// 查询角色
AiChatRoleRes chatRoleRes = null;
AiChatRoleRespVO chatRoleRes = null;
if (req.getRoleId() != null) {
chatRoleRes = aiChatRoleService.getChatRole(req.getRoleId());
}

View File

@ -35,7 +35,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService {
private final AiChatModalService aiChatModalService;
@Override
public PageResult<AiChatRoleListRes> list(AiChatRoleListReq req) {
public PageResult<AiChatRoleListRespVO> list(AiChatRoleListReqVO req) {
// 查询条件
LambdaQueryWrapperX<AiChatRoleDO> queryWrapperX = new LambdaQueryWrapperX<>();
// search 查询
@ -49,7 +49,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService {
Long total = aiChatRoleDOPageResult.getTotal();
List<AiChatRoleDO> roleList = aiChatRoleDOPageResult.getList();
// 换货res
List<AiChatRoleListRes> chatRoleListResList = AiChatRoleConvert.INSTANCE.convertChatRoleListRes(roleList);
List<AiChatRoleListRespVO> chatRoleListResList = AiChatRoleConvert.INSTANCE.convertChatRoleListRes(roleList);
return new PageResult<>(chatRoleListResList, total);
}
@ -103,7 +103,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService {
}
@Override
public AiChatRoleRes getChatRole(Long roleId) {
public AiChatRoleRespVO getChatRole(Long roleId) {
// 检查角色是否存在
AiChatRoleDO aiChatRoleDO = validateExists(roleId);
return AiChatRoleConvert.INSTANCE.convertAiChatRoleRes(aiChatRoleDO);