123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package sys
- import (
- logger "eta/eta_mini_ht_api/common/component/log"
- "eta/eta_mini_ht_api/domian/config"
- )
- const (
- ConfigTypeInt = "int"
- ConfigTypeStr = "string"
- ConfigTypeByte = "byte"
- )
- func GetStrConfig(configId int) (value string, err error) {
- var configVal interface{}
- configVal, err = config.GetConfigValue(configId, ConfigTypeStr)
- if err != nil {
- logger.Error("获取配置失败:%v,配置项[%d]", err, configId)
- return
- }
- value = configVal.(string)
- return
- }
- func GetIntConfig(configId int) (value int, err error) {
- var configVal interface{}
- configVal, err = config.GetConfigValue(configId, ConfigTypeInt)
- if err != nil {
- logger.Error("获取配置失败:%v,配置项[%d]", err, configId)
- return
- }
- value = configVal.(int)
- return
- }
- func GetByteConfig(configId int) (value string, err error) {
- var configVal interface{}
- configVal, err = config.GetConfigValue(configId, ConfigTypeByte)
- if err != nil {
- logger.Error("获取配置失败:%v,配置项[%d]", err, configId)
- return
- }
- value = configVal.(string)
- return
- }
|