示例#1
0
 public FunctionResult<AppToken> Create(AppToken info)
 {
     var r = new FunctionResult<AppToken>(); int id = AppTokenDal.Add(info); if (id > 0)
     {
         r.Data = info; r.Data.AppTokenId = id;
         RedisService.Set<AppToken>("default", String.Format(ConfigAuthorityCacheKey.AuthorityCacheKey, id), info);
     }
     return r;
 }
示例#2
0
 public FunctionOpenResult<bool> UpdateByID(AppToken info) {
     var r = new FunctionOpenResult<bool>();
     r.Data = AppTokenDal.Update(info) > 0;
     if (r.Data&&info.Status)
     {
         RedisService.Set<AppToken>("default", String.Format(ConfigAuthorityCacheKey.AuthorityCacheKey, info.AppId), info);
     }
     else
     {
         RedisService.Delete("default", String.Format(ConfigAuthorityCacheKey.AuthorityCacheKey, info.AppId));
     }
     return r;
 }