From b091498040b989ebc5a2afb72539ee47d2430220 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Tue, 7 May 2024 15:38:01 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96AI=20=E8=A7=92=E8=89=B2=E5=88=97=E8=A1=A8=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=BF=A1=E6=81=AF=20=E5=92=8C=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=A8=A1=E5=9E=8Bid=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/vo/role/AiChatRoleAddReqVO.java | 2 +- .../model/vo/role/AiChatRoleListRespVO.java | 41 +++++++++++++------ .../ai/dal/dataobject/model/AiChatRoleDO.java | 13 ++---- .../service/impl/AiChatRoleServiceImpl.java | 4 +- 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/role/AiChatRoleAddReqVO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/role/AiChatRoleAddReqVO.java index f03137df8..f069caf97 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/role/AiChatRoleAddReqVO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/role/AiChatRoleAddReqVO.java @@ -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 diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/role/AiChatRoleListRespVO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/role/AiChatRoleListRespVO.java index f66d5a6ea..3eee736be 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/role/AiChatRoleListRespVO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/role/AiChatRoleListRespVO.java @@ -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; } diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatRoleDO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatRoleDO.java index bb48f524d..51cf67c86 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatRoleDO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatRoleDO.java @@ -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 - 私有 */ diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/impl/AiChatRoleServiceImpl.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/impl/AiChatRoleServiceImpl.java index 5264ea2a2..cc432fe41 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/impl/AiChatRoleServiceImpl.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/impl/AiChatRoleServiceImpl.java @@ -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 list(AiChatRoleListReqVO req) {