Files
InfoGenie/infogenie-backend-go/internal/model/ai_config.go
2026-03-28 20:59:52 +08:00

19 lines
802 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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" }