refactor: 引用系统模型并入 Update,删除 /referenceSystemModel 端点

非超管 updateModelManage 编辑系统模型时直接插引用行(apiKey 必填、同名唯一、
不拷贝配置),前端继续走 updateModelManage 即可引用,无需换接口。

- 删 service.ReferenceSystemModel / controller.ReferenceModel / ReferenceSystemModelReq/Res
- Update:恢复引用行(refSystemModelId>0)个人字段分支(只改 apiKey/enabled/chatModel)
- 修复同名唯一性检查丢失自排除(exist.Id != req.Id),允许不改名编辑
- 非超管建引用行补 apiKey 必填校验

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-08-29 16:46:24 +08:00
co-authored by Claude
parent 58d9891205
commit b165ef4f3e
3 changed files with 66 additions and 101 deletions
-12
View File
@@ -155,15 +155,3 @@ type BuildSchemaMappingRes struct {
SchemaMapping map[string]any `json:"schemaMapping" dc:"生成的 Schema 映射 JSON"`
}
// ReferenceSystemModelReq 引用系统模型请求:用户只填 apiKey + 个人开关,配置实时跟随系统模型
type ReferenceSystemModelReq struct {
g.Meta `path:"/referenceSystemModel" method:"post" tags:"模型管理" summary:"引用系统模型" dc:"用户引用系统模型,只填 apiKey 等个人字段,配置实时跟随系统模型(不再全量拷贝)"`
SystemModelId int64 `json:"systemModelId" v:"required#系统模型ID不能为空" dc:"被引用的系统模型ID"`
ApiKey string `json:"apiKey" v:"required#apiKey不能为空" dc:"调用凭证/密钥"`
ChatModel *bool `json:"chatModel" dc:"设为我的会话模型"`
Enabled *bool `json:"enabled" dc:"启用(默认启用)"`
}
type ReferenceSystemModelRes struct {
Id int64 `json:"id,string" dc:"引用行ID"`
}