【优化】优化AI 角色列表返回信息 和 修改模型id类型

This commit is contained in:
cherishsince 2024-05-07 15:38:01 +08:00
parent 3e91032eaf
commit b091498040
4 changed files with 34 additions and 26 deletions

View File

@ -42,7 +42,7 @@ public class AiChatRoleAddReqVO {
private Long modelId;
@NotNull
@Schema(description = "开启状态 open、close")
@Schema(description = "开启状态 0、open 1、close")
private Boolean publicStatus;
@NotNull

View File

@ -14,24 +14,39 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
public class AiChatRoleListRespVO {
@Schema(description = "id")
@Schema(description = "编号", example = "1")
private Long id;
@Schema(description = "用户id")
private Long userId;
@Schema(description = "角色名字")
@Schema(description = "角色名称", example = "小红书写作")
private String name;
@Schema(description = "角色介绍,详细描述角色的功能或用途")
private String introduce;
@Schema(description = "角色头像", example = "http://...")
private String avatar;
@Schema(description = "分类,角色所属的类别,如娱乐、创作等")
private String classify;
@Schema(description = "角色分类", example = "writing")
private String category;
@Schema(description = "状态 open、close")
private String enable;
@Schema(description = "角色描述", example = "角色描述")
private String description;
@Schema(description = "角色的使用次数统计")
private Integer useCount;
@Schema(description = "角色欢迎语", example = "欢迎...")
private String welcomeMessage;
@Schema(description = "角色设定(消息)", example = "你是拥有丰富的小红书写作经验作者xxxx")
private String systemMessage;
@Schema(description = "用户编号", example = "1")
private Long userId;
@Schema(description = "模型编号", example = "1")
private Long modelId;
@Schema(description = "是否公开 true - 公开false - 私有", example = "true")
private Boolean publicStatus;
@Schema(description = "排序值 asc", example = "1")
private Integer sort;
@Schema(description = "状态 0、开启 1、关闭", example = "1")
private Integer status;
}

View File

@ -1,16 +1,9 @@
package cn.iocoder.yudao.module.ai.dal.dataobject.model;
import cn.iocoder.yudao.framework.ai.chat.messages.MessageType;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
* AI 聊天角色 DO
@ -67,12 +60,12 @@ public class AiChatRoleDO extends BaseDO {
/**
* 模型编号
*
* 关联 {@link AiChatModalDO#getId()} 字段
* 关联 {@link AiChatModelDO#getId()} 字段
*/
private String modelId;
private Long modelId;
/**
* 是否公开
* 是否公开 true - 公开false - 私有
*
* true - 公开false - 私有
*/

View File

@ -12,7 +12,7 @@ import cn.iocoder.yudao.module.ai.convert.AiChatRoleConvert;
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO;
import cn.iocoder.yudao.module.ai.dal.mysql.AiChatRoleMapper;
import cn.iocoder.yudao.module.ai.enums.AiChatRoleCategoryEnum;
import cn.iocoder.yudao.module.ai.service.AiChatModalService;
import cn.iocoder.yudao.module.ai.service.AiChatModelService;
import cn.iocoder.yudao.module.ai.service.AiChatRoleService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -32,7 +32,7 @@ import java.util.List;
public class AiChatRoleServiceImpl implements AiChatRoleService {
private final AiChatRoleMapper aiChatRoleMapper;
private final AiChatModalService aiChatModalService;
private final AiChatModelService aiChatModalService;
@Override
public PageResult<AiChatRoleListRespVO> list(AiChatRoleListReqVO req) {