🎨 重构用户端前端为vue开发,完善基础类和角色相关接口
This commit is contained in:
36
server/model/app/ai_provider.go
Normal file
36
server/model/app/ai_provider.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/st/server/global"
|
||||
"gorm.io/datatypes"
|
||||
)
|
||||
|
||||
// AIProvider AI 服务提供商配置
|
||||
type AIProvider struct {
|
||||
global.GVA_MODEL
|
||||
UserID *uint `json:"userId" gorm:"index;comment:用户ID(NULL表示系统配置)"`
|
||||
User *AppUser `json:"user" gorm:"foreignKey:UserID"`
|
||||
ProviderName string `json:"providerName" gorm:"type:varchar(100);not null;index;comment:提供商名称"`
|
||||
APIConfig datatypes.JSON `json:"apiConfig" gorm:"type:jsonb;not null;comment:API配置(加密存储)"`
|
||||
IsEnabled bool `json:"isEnabled" gorm:"default:true;comment:是否启用"`
|
||||
IsDefault bool `json:"isDefault" gorm:"default:false;comment:是否为默认提供商"`
|
||||
}
|
||||
|
||||
func (AIProvider) TableName() string {
|
||||
return "ai_providers"
|
||||
}
|
||||
|
||||
// AIModel AI 模型配置
|
||||
type AIModel struct {
|
||||
global.GVA_MODEL
|
||||
ProviderID uint `json:"providerId" gorm:"not null;index;comment:提供商ID"`
|
||||
Provider *AIProvider `json:"provider" gorm:"foreignKey:ProviderID"`
|
||||
ModelName string `json:"modelName" gorm:"type:varchar(200);not null;comment:模型名称"`
|
||||
DisplayName string `json:"displayName" gorm:"type:varchar(200);comment:模型显示名称"`
|
||||
Config datatypes.JSON `json:"config" gorm:"type:jsonb;comment:模型参数配置"`
|
||||
IsEnabled bool `json:"isEnabled" gorm:"default:true;comment:是否启用"`
|
||||
}
|
||||
|
||||
func (AIModel) TableName() string {
|
||||
return "ai_models"
|
||||
}
|
||||
Reference in New Issue
Block a user