【调整】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禁用
*/
private Integer disable;
/**
* 排序
*/
private Integer sort;
/**
* modal 配置(json)
*/
private String config;
}

View File

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

View File

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

View File

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

View File

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