public void Set(string token, string appid) { var config = ServerConfigManage.Instance.GetServerConfig(); string key = string.Format(RedisCacheKey.App_Token, token); RedisNetHelper.Set <string>(key, appid, DateTime.Now.AddSeconds(config.TokenSurvivalTime)); }
/// <summary> /// 用户资金账户设置 /// </summary> /// <param name="typeId"></param> /// <param name="model"></param> /// <returns></returns> public bool SetBankAccountRedis(int typeId, bank_account model) { var redisDetailNameKey = string.Empty; bool flag = false; redisDetailNameKey = string.Format(RedisCacheKey.BankTotal_UserName, model.user_name); var redisCachTime = ConfigBusiness.BankAccountTotalRedisCachTime; var overTime = DateTime.Now.AddHours(redisCachTime); try { flag = RedisNetHelper.Set <decimal>(typeId, redisDetailNameKey, model.money, overTime).Item1; } catch (Exception ex) { GW.Utils.LogHelper.Write(string.Format("{0}.{1}() error;StackTrace:{2} ", GetType().FullName, new StackFrame(0).GetMethod().Name, ex.StackTrace), ex); } return(flag); }