24 lines
814 B
Go
24 lines
814 B
Go
package app
|
|
|
|
import (
|
|
"git.echol.cn/loser/ai_proxy/server/global"
|
|
)
|
|
|
|
// AiPresetBinding 预设绑定关系
|
|
type AiPresetBinding struct {
|
|
global.GVA_MODEL
|
|
Name string `json:"name" gorm:"type:varchar(100);not null;uniqueIndex:idx_user_binding;comment:绑定名称"`
|
|
PresetID uint `json:"preset_id" gorm:"not null;index;comment:预设ID"`
|
|
ProviderID uint `json:"provider_id" gorm:"not null;index;comment:提供商ID"`
|
|
Enabled bool `json:"enabled" gorm:"default:true;comment:是否启用"`
|
|
UserID uint `json:"user_id" gorm:"index:idx_user_binding;comment:用户ID"`
|
|
|
|
// 关联
|
|
Preset AiPreset `json:"preset" gorm:"foreignKey:PresetID"`
|
|
Provider AiProvider `json:"provider" gorm:"foreignKey:ProviderID"`
|
|
}
|
|
|
|
func (AiPresetBinding) TableName() string {
|
|
return "ai_preset_bindings"
|
|
}
|