Esempio n. 1
0
// 获取商户信息缓存
func GetValueMerchantCache(merchantId int) *merchant.Merchant {
	var v merchant.Merchant
	var sto gof.Storage = GetKVS()
	var key string = GetValueMerchantCacheCK(merchantId)
	if sto.Get(key, &v) != nil {
		v2, err := dps.MerchantService.GetMerchant(merchantId)
		if v2 != nil && err == nil {
			sto.SetExpire(key, *v2, DefaultMaxSeconds)
			return v2
		}
	}
	return &v

}