sys_config_enum.go 639 B

1234567891011121314151617181920212223242526272829
  1. package contants
  2. type Config struct {
  3. ConfigId int
  4. ConfigType string
  5. }
  6. const (
  7. ConfigTypeInt = "int"
  8. ConfigTypeStr = "string"
  9. ConfigTypeByte = "byte"
  10. )
  11. const (
  12. // configCode
  13. HTCPELoginUrl = "HtCpeLoginUrl"
  14. ShowMediaView = "ShowMediaView"
  15. PaymentWay = "PaymentWay"
  16. )
  17. // SysConfigMap 用于存储错误码和错误信息的映射
  18. var SysConfigMap = map[string]*Config{
  19. HTCPELoginUrl: {ConfigId: 1000, ConfigType: ConfigTypeStr},
  20. ShowMediaView: {ConfigId: 1001, ConfigType: ConfigTypeInt},
  21. PaymentWay: {ConfigId: 1003, ConfigType: ConfigTypeStr},
  22. }
  23. func GetConfig(code string) *Config {
  24. return SysConfigMap[code]
  25. }