package cache import ( "encoding/json" "hongze/hongze_robot/models" "hongze/hongze_robot/utils" ) func GetSmsConfigByCache(configKey string) (item *models.SmsConfig, err error) { cacheKey := utils.CACHE_HZ_SMS_CONFIG + configKey if utils.Re == nil && utils.Rc.IsExist(cacheKey) { if data, err1 := utils.Rc.RedisBytes(cacheKey); err1 == nil { err = json.Unmarshal(data, &item) if item != nil { return } } } return models.GetSmsConfigByConfigKey(configKey) }