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