feat: 初始化 ChatGPT Team 管理后端项目
- 添加用户认证模块 (JWT + 密码管理) - 添加 ChatGPT 账户管理功能 - 添加卡密管理功能 (创建、批量生成、查询) - 添加邀请功能 - 配置数据库迁移和路由系统
This commit is contained in:
42
internal/models/system_setting.go
Normal file
42
internal/models/system_setting.go
Normal file
@@ -0,0 +1,42 @@
|
||||
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"
|
||||
)
|
||||
Reference in New Issue
Block a user