Commit 3d7c994bf96ae01fdd8a810a835ed0b9254115f7

Authored by cherishsince
1 parent c21b5f76

【调整】ai模型,增加sort排序

yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/AiChatModalDO.java
... ... @@ -44,7 +44,12 @@ public class AiChatModalDO extends BaseDO {
44 44 */
45 45 private Integer disable;
46 46 /**
  47 + * 排序
  48 + */
  49 + private Integer sort;
  50 + /**
47 51 * modal 配置(json)
48 52 */
49 53 private String config;
  54 +
50 55 }
... ...
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/impl/AiChatModalServiceImpl.java
... ... @@ -54,7 +54,7 @@ public class AiChatModalServiceImpl implements AiChatModalService {
54 54 queryWrapperX.like(AiChatModalDO::getName, req.getSearch().trim());
55 55 }
56 56 // 默认排序
57   - queryWrapperX.orderByDesc(AiChatModalDO::getId);
  57 + queryWrapperX.orderByAsc(AiChatModalDO::getSort);
58 58 // 查询
59 59 PageResult<AiChatModalDO> aiChatModalDOPageResult = aiChatModalMapper.selectPage(req, queryWrapperX);
60 60 // 转换 res
... ...
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/vo/AiChatModalAddReq.java
... ... @@ -19,25 +19,29 @@ import java.util.Map;
19 19 @Accessors(chain = true)
20 20 public class AiChatModalAddReq {
21 21  
22   - @NotNull
23 22 @Schema(description = "模型名字")
24 23 @Size(max = 60, message = "模型名字最大60个字符")
  24 + @NotNull(message = "模型名字不能为空!")
25 25 private String name;
26 26  
27   - @NotNull
28 27 @Size(max = 32, message = "模型平台最大32个字符")
29 28 @Schema(description = "模型平台 参考 AiPlatformEnum")
  29 + @NotNull(message = "平台不能为空!")
30 30 private String platform;
31 31  
32   - @NotNull
33 32 @Schema(description = "模型类型(qianwen、yiyan、xinghuo、openai)")
34 33 @Size(max = 32, message = "模型类型最大32个字符")
  34 + @NotNull(message = "modal模型不能为空!")
35 35 private String modal;
36 36  
37 37 @Schema(description = "模型照片")
38 38 @Size(max = 256, message = "模型照片地址最大256个字符")
39 39 private String imageUrl;
40 40  
  41 + @Schema(description = "排序")
  42 + @NotNull(message = "sort排序不能为空!")
  43 + private Integer sort;
  44 +
41 45 @Schema(description = "模型配置JSON")
42 46 // @Size(max = 1024, message = "模型配置最大1024个字符")
43 47 private Map<String, Object> config;
... ...
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/vo/AiChatModalListRes.java
... ... @@ -34,6 +34,9 @@ public class AiChatModalListRes {
34 34 @Schema(description = "禁用 0、正常 1、禁用")
35 35 private Integer disable;
36 36  
  37 + @Schema(description = "排序 asc 排序")
  38 + private Integer sort;
  39 +
37 40 @Schema(description = "modal 配置")
38 41 private String config;
39 42 }
... ...
yudao-module-ai/yudao-module-ai-biz/src/main/resources/http/chat-modal.http
... ... @@ -10,10 +10,11 @@ Content-Type: application/json
10 10 Authorization: {{token}}
11 11  
12 12 {
13   - "name": "小红书Ai写作大模型-plus",
14   - "modal": "ERNIE-3.5-8K",
  13 + "name": "小红书Ai写作大模型4.0",
  14 + "modal": "ERNIE 4.0",
15 15 "platform": "yiyan",
16 16 "imageUrl": "",
  17 + "sort": 100,
17 18 "config": {
18 19 "topK": 0.6,
19 20 "topP": 0.6,
... ... @@ -32,6 +33,7 @@ Authorization: {{token}}
32 33 "modal": "ERNIE-3.5-8K",
33 34 "platform": "yiyan",
34 35 "imageUrl": "",
  36 + "sort": 1,
35 37 "config": {
36 38 "topK": 0.6,
37 39 "topP": 0.6,
... ...