19 lines
802 B
Go
19 lines
802 B
Go
package model
|
||
|
||
import "time"
|
||
|
||
// AI配置表,用于存储各种AI提供商的配置
|
||
type AIConfig struct {
|
||
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
|
||
Provider string `gorm:"type:varchar(50);not null;uniqueIndex" json:"provider"` // deepseek, kimi, etc.
|
||
APIKey string `gorm:"type:varchar(255);not null" json:"api_key"`
|
||
APIBase string `gorm:"type:varchar(255);not null" json:"api_base"`
|
||
DefaultModel string `gorm:"type:varchar(100)" json:"default_model"`
|
||
Models string `gorm:"type:text" json:"models"` // JSON格式的模型列表
|
||
IsEnabled bool `gorm:"default:true" json:"is_enabled"`
|
||
CreatedAt time.Time `json:"created_at"`
|
||
UpdatedAt time.Time `json:"updated_at"`
|
||
}
|
||
|
||
func (AIConfig) TableName() string { return "ai_configs" }
|