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" )