update: 2026-03-28 20:59

This commit is contained in:
2026-03-28 20:59:52 +08:00
parent e21d58e603
commit 1c81d4e6ea
611 changed files with 27847 additions and 65061 deletions

View 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" }

View File

@@ -0,0 +1 @@
package model

View File

@@ -0,0 +1,8 @@
package model
// Site60sDisabled 记录在 60s API 列表中隐藏的功能项(仅存 feature_id与前端 Api60sConfig 中 item.id 一致)
type Site60sDisabled struct {
FeatureID string `gorm:"primaryKey;type:varchar(96);not null" json:"feature_id"`
}
func (Site60sDisabled) TableName() string { return "site_60s_disabled" }

View File

@@ -0,0 +1,9 @@
package model
// Site60sUpstream 单例行id=160s API 上游节点,仅管理员可改
type Site60sUpstream struct {
ID uint `gorm:"primaryKey" json:"id"`
SourceID string `gorm:"type:varchar(32);not null;default:self" json:"source_id"` // self | official
}
func (Site60sUpstream) TableName() string { return "site_60s_upstream" }

View File

@@ -0,0 +1,8 @@
package model
// SiteAIModelDisabled 记录在 AI 应用列表中隐藏的功能项(仅存 app_id与前端 StaticPageConfig 中 AI_MODEL_APPS 的索引或唯一标识对应)
type SiteAIModelDisabled struct {
AppID string `gorm:"primaryKey;type:varchar(96);not null" json:"app_id"`
}
func (SiteAIModelDisabled) TableName() string { return "site_ai_model_disabled" }

View File

@@ -0,0 +1,15 @@
package model
import "time"
// SiteAIRuntime 单例行id=1管理员配置的 AI 上游地址与密钥,优先于 ai_config.json
type SiteAIRuntime struct {
ID uint `gorm:"primaryKey" json:"id"`
APIBase string `gorm:"type:varchar(512)" json:"api_base"`
APIKey string `gorm:"type:varchar(2048)" json:"-"`
DefaultModel string `gorm:"type:varchar(120)" json:"default_model"`
DefaultProv string `gorm:"type:varchar(64)" json:"default_provider"`
UpdatedAt time.Time `json:"updated_at"`
}
func (SiteAIRuntime) TableName() string { return "site_ai_runtime" }