- 添加用户认证模块 (JWT + 密码管理) - 添加 ChatGPT 账户管理功能 - 添加卡密管理功能 (创建、批量生成、查询) - 添加邀请功能 - 配置数据库迁移和路由系统
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package models
|
|
|
|
import (
|
|
"database/sql"
|
|
)
|
|
|
|
// ValueType 配置值类型枚举
|
|
type ValueType string
|
|
|
|
const (
|
|
ValueTypeString ValueType = "string"
|
|
ValueTypeInt ValueType = "int"
|
|
ValueTypeFloat ValueType = "float"
|
|
ValueTypeBool ValueType = "bool"
|
|
ValueTypeJSON ValueType = "json"
|
|
)
|
|
|
|
// SystemSetting 系统配置表
|
|
type SystemSetting struct {
|
|
ID int `json:"id"`
|
|
Key string `json:"key"`
|
|
Value string `json:"value"`
|
|
ValueType ValueType `json:"value_type"`
|
|
Description sql.NullString `json:"description"`
|
|
UpdatedAt sql.NullTime `json:"updated_at"`
|
|
}
|
|
|
|
// TableName 返回表名
|
|
func (SystemSetting) TableName() string {
|
|
return "system_settings"
|
|
}
|
|
|
|
// 默认配置键名常量
|
|
const (
|
|
SettingTurnstileEnabled = "turnstile_enabled"
|
|
SettingTurnstileSiteKey = "turnstile_site_key"
|
|
SettingTurnstileSecretKey = "turnstile_secret_key"
|
|
SettingTokenCheckInterval = "token_check_interval"
|
|
SettingTokenFailureThreshold = "token_failure_threshold"
|
|
SettingInvitationValidityDays = "invitation_validity_days"
|
|
SettingSiteTitle = "site_title"
|
|
)
|