You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
1.9 KiB

package console
// 第三方服务商字段模板(svctemplate) 的本地数据模型。
//
// 模板是「字段 schema 预设」:管理员在「第三方服务配置」新增服务时选一个服务商模板,
// 即自动带出该服务商需要的字段(可再手动增删)。参考 polychat-agent 的 (service_type, provider)
// 注册表,但改为数据驱动——模板作为可编辑的库表数据,启动时 seed 内置常见服务商,
// 新增服务商无需改代码。
//
// 注意:模板字段的 DefValue 只作「字段提示/默认占位」,不存真实密钥、不加密;
// Encrypted 仅是 schema 标记,会随字段拷贝到服务实例,真正的加密发生在服务实例(ThirdSvcConfig)层。
// ThirdSvcTemplate 服务商字段模板(表:third_svc_template)。一行 = 一个 (类别, 服务商) 预设。
type ThirdSvcTemplate struct {
Id string `gorm:"column:id;size:64;primaryKey" json:"id"` // 稳定 id,如 tts_azure
Category int32 `gorm:"column:category" json:"category"` // 单一服务类别(1STT/2TTS/3MT/4AST/5LLM/6存储)
Provider string `gorm:"column:provider;size:64" json:"provider"` // 服务商标识:azure/openai/volcengine/alibaba...
Name string `gorm:"column:name;size:64" json:"name"` // 展示名,如「微软 Azure TTS」
Description string `gorm:"column:description" json:"description"`
Fields []SvcField `gorm:"column:fields;type:jsonb;serializer:json" json:"fields"` // 字段 schema(复用 SvcField)
Builtin bool `gorm:"column:builtin" json:"builtin"` // 是否 seed 内置(前端区分/删后可被重新补回)
Sort int32 `gorm:"column:sort" json:"sort"` // 展示排序,越小越靠前
Createtime int64 `gorm:"column:createtime" json:"createtime"`
Updatetime int64 `gorm:"column:updatetime" json:"updatetime"`
}