mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-04 12:36:37 +08:00
split core model definitions
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package model
|
||||
|
||||
// APIConfig stores third-party data-source configuration. The api_key
|
||||
// column is encrypted with AES-GCM (see internal/service/crypto.go) so an
|
||||
// SQLite leak does not expose third-party credentials.
|
||||
//
|
||||
// Provider values mirror the original Python project:
|
||||
//
|
||||
// tmdb — themoviedb.org
|
||||
// bangumi — bgm.tv
|
||||
// thetvdb — thetvdb.com
|
||||
// fanart — fanart.tv
|
||||
// douban — douban.com (cookie)
|
||||
// openai — OpenAI / DeepSeek / Qwen / Ollama (compatible)
|
||||
type APIConfig struct {
|
||||
Base
|
||||
Provider string `gorm:"uniqueIndex;size:32;not null" json:"provider"`
|
||||
APIKey string `gorm:"type:text" json:"-"` // ciphertext (never serialised)
|
||||
BaseURL string `gorm:"size:512" json:"base_url,omitempty"`
|
||||
Extra string `gorm:"type:text" json:"extra,omitempty"` // free-form JSON
|
||||
Enabled bool `gorm:"default:true" json:"enabled"`
|
||||
Description string `gorm:"size:255" json:"description,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user