update: 2026-03-28 20:59
This commit is contained in:
18
infogenie-backend-go/internal/model/ai_config.go
Normal file
18
infogenie-backend-go/internal/model/ai_config.go
Normal file
@@ -0,0 +1,18 @@
|
||||
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" }
|
||||
Reference in New Issue
Block a user