예제 #1
0
        public static bool InsertSuccess(AtlasscheduleModel model)
        {
            string redisKey = RedisKeyHelper.GetRedisKeyName(RedisKeyConfig.AtlasSchedule, model.PlayerId.ToString());

            redisCacheHelper.StringSet(redisKey, model, CommonConfig.DefRedisExpiry);
            return(BaseBLL.InsertSuccess(model));
        }
예제 #2
0
        public static PlayerbasisModel GetSingleOrDefault(int playerId, out bool fromCache)
        {
            fromCache = false;
            string redisKey   = RedisKeyHelper.GetRedisKeyName(RedisKeyConfig.Playerbasis, playerId.ToString());
            var    cacheModel = redisCacheHelper.StringGet <PlayerbasisModel>(redisKey);

            if (cacheModel != null)
            {
                fromCache = true;
                return(cacheModel);
            }
            else
            {
                var model = new PlayerbasisModel();
                model = GetSingleOrDefault(model, new KeyValue <int> {
                    Key = nameof(model.PlayerId), Value = playerId
                });
                redisCacheHelper.StringSet(redisKey, model, CommonConfig.DefRedisExpiry);
                return(model);
            }
        }
예제 #3
0
        public static List <GoodsModel> GetListAll(int playerId, int belongsTo, out bool fromCache)
        {
            fromCache = false;
            string redisKey = RedisKeyHelper.GetRedisKeyName(RedisKeyConfig.Goods, playerId.ToString(), belongsTo.ToString());
            var    list     = redisCacheHelper.StringGet <List <GoodsModel> >(redisKey);

            if (list != null)
            {
                fromCache = true;
                return(list);
            }
            else
            {
                list = GoodsDAL.GetListAll(playerId, belongsTo);
                redisCacheHelper.StringSet(redisKey, list, CommonConfig.DefRedisExpiry);
                return(list);
            }
        }
예제 #4
0
 public bool Set <T>(string key, T value)
 {
     return(_helper.StringSet(key, value));
 }