sys_config_enum.go 718 B

12345678910111213141516171819202122232425262728293031
  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. authToken = "int"
  15. byte = "byte"
  16. ShowMediaView = "ShowMediaView"
  17. )
  18. // SysConfigMap 用于存储错误码和错误信息的映射
  19. var SysConfigMap = map[string]*Config{
  20. HTCPELoginUrl: {ConfigId: 1000, ConfigType: ConfigTypeStr},
  21. authToken: {ConfigId: 1001, ConfigType: ConfigTypeInt},
  22. byte: {ConfigId: 1002, ConfigType: ConfigTypeByte},
  23. ShowMediaView: {ConfigId: 1003, ConfigType: ConfigTypeInt},
  24. }
  25. func GetConfig(code string) *Config {
  26. return SysConfigMap[code]
  27. }