dt_config.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package entity
  2. // DtConfig 系统配置表
  3. type DtConfig struct {
  4. MysqlBaseModel
  5. Group string `json:"group" gorm:"type:varchar(64);index:idx_group;comment:配置分组"`
  6. Key string `json:"key" gorm:"type:varchar(128);uniqueIndex:uk_key;comment:配置键"`
  7. Value string `json:"value" gorm:"type:text;comment:配置值"`
  8. Type string `json:"type" gorm:"type:varchar(32);default:string;comment:类型: string/number/boolean/json"`
  9. Name string `json:"name" gorm:"type:varchar(128);comment:配置名称"`
  10. Description string `json:"description" gorm:"type:varchar(255);comment:配置描述"`
  11. Sort int `json:"sort" gorm:"default:0;comment:排序"`
  12. }
  13. func (*DtConfig) TableName() string {
  14. return "dt_config"
  15. }
  16. func (*DtConfig) Comment() string {
  17. return "系统配置表"
  18. }
  19. func NewDtConfig() *DtConfig {
  20. return &DtConfig{}
  21. }
  22. // 常用配置键
  23. const (
  24. ConfigKeyCommissionRate1 = "bfb_1" // 一级返佣比例
  25. ConfigKeyInviteBonus = "xshare_bonus" // 直推奖励金额
  26. ConfigKeyEnableInviteBonus = "is_share_bonus" // 是否启用直推奖励
  27. ConfigKeyWithdrawFee = "charge" // 提现手续费
  28. ConfigKeyMinWithdraw = "min_withdraw" // 最低提现金额
  29. ConfigKeySmsUser = "smsbao_user" // 短信宝账号
  30. ConfigKeySmsPass = "smsbao_pass" // 短信宝密码
  31. ConfigKeySmsSign = "smsbao_sign" // 短信签名
  32. ConfigKeyKefuEmail = "kefu_email" // 客服邮箱
  33. ConfigKeyKefuTelegram = "kefu_telegram" // 客服Telegram
  34. ConfigKeyKefuPhone = "kefu_phone" // 客服电话
  35. ConfigKeyGoogleClientId = "google_client_id" // Google OAuth Client ID
  36. ConfigKeyZaloAppId = "zalo_app_id" // Zalo App ID
  37. ConfigKeyZaloSecret = "zalo_secret" // Zalo Secret Key
  38. ConfigKeyTelegramBotName = "telegram_bot_name" // Telegram Bot 用户名
  39. )