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

This commit is contained in:
cherishsince 2024-05-06 16:38:33 +08:00
parent c21b5f7679
commit 3d7c994bf9
5 changed files with 20 additions and 6 deletions

View File

@ -43,8 +43,13 @@ public class AiChatModalDO extends BaseDO {
* 禁用 0正常 1禁用 * 禁用 0正常 1禁用
*/ */
private Integer disable; private Integer disable;
/**
* 排序
*/
private Integer sort;
/** /**
* modal 配置(json) * modal 配置(json)
*/ */
private String config; private String config;
} }

View File

@ -54,7 +54,7 @@ public class AiChatModalServiceImpl implements AiChatModalService {
queryWrapperX.like(AiChatModalDO::getName, req.getSearch().trim()); queryWrapperX.like(AiChatModalDO::getName, req.getSearch().trim());
} }
// 默认排序 // 默认排序
queryWrapperX.orderByDesc(AiChatModalDO::getId); queryWrapperX.orderByAsc(AiChatModalDO::getSort);
// 查询 // 查询
PageResult<AiChatModalDO> aiChatModalDOPageResult = aiChatModalMapper.selectPage(req, queryWrapperX); PageResult<AiChatModalDO> aiChatModalDOPageResult = aiChatModalMapper.selectPage(req, queryWrapperX);
// 转换 res // 转换 res

View File

@ -19,25 +19,29 @@ import java.util.Map;
@Accessors(chain = true) @Accessors(chain = true)
public class AiChatModalAddReq { public class AiChatModalAddReq {
@NotNull
@Schema(description = "模型名字") @Schema(description = "模型名字")
@Size(max = 60, message = "模型名字最大60个字符") @Size(max = 60, message = "模型名字最大60个字符")
@NotNull(message = "模型名字不能为空!")
private String name; private String name;
@NotNull
@Size(max = 32, message = "模型平台最大32个字符") @Size(max = 32, message = "模型平台最大32个字符")
@Schema(description = "模型平台 参考 AiPlatformEnum") @Schema(description = "模型平台 参考 AiPlatformEnum")
@NotNull(message = "平台不能为空!")
private String platform; private String platform;
@NotNull
@Schema(description = "模型类型(qianwen、yiyan、xinghuo、openai)") @Schema(description = "模型类型(qianwen、yiyan、xinghuo、openai)")
@Size(max = 32, message = "模型类型最大32个字符") @Size(max = 32, message = "模型类型最大32个字符")
@NotNull(message = "modal模型不能为空!")
private String modal; private String modal;
@Schema(description = "模型照片") @Schema(description = "模型照片")
@Size(max = 256, message = "模型照片地址最大256个字符") @Size(max = 256, message = "模型照片地址最大256个字符")
private String imageUrl; private String imageUrl;
@Schema(description = "排序")
@NotNull(message = "sort排序不能为空!")
private Integer sort;
@Schema(description = "模型配置JSON") @Schema(description = "模型配置JSON")
// @Size(max = 1024, message = "模型配置最大1024个字符") // @Size(max = 1024, message = "模型配置最大1024个字符")
private Map<String, Object> config; private Map<String, Object> config;

View File

@ -34,6 +34,9 @@ public class AiChatModalListRes {
@Schema(description = "禁用 0、正常 1、禁用") @Schema(description = "禁用 0、正常 1、禁用")
private Integer disable; private Integer disable;
@Schema(description = "排序 asc 排序")
private Integer sort;
@Schema(description = "modal 配置") @Schema(description = "modal 配置")
private String config; private String config;
} }

View File

@ -10,10 +10,11 @@ Content-Type: application/json
Authorization: {{token}} Authorization: {{token}}
{ {
"name": "小红书Ai写作大模型-plus", "name": "小红书Ai写作大模型4.0",
"modal": "ERNIE-3.5-8K", "modal": "ERNIE 4.0",
"platform": "yiyan", "platform": "yiyan",
"imageUrl": "", "imageUrl": "",
"sort": 100,
"config": { "config": {
"topK": 0.6, "topK": 0.6,
"topP": 0.6, "topP": 0.6,
@ -32,6 +33,7 @@ Authorization: {{token}}
"modal": "ERNIE-3.5-8K", "modal": "ERNIE-3.5-8K",
"platform": "yiyan", "platform": "yiyan",
"imageUrl": "", "imageUrl": "",
"sort": 1,
"config": { "config": {
"topK": 0.6, "topK": 0.6,
"topP": 0.6, "topP": 0.6,