public int DelAgentPropertiyCache(DelAgentPropertiyCacheRequest request) { try { _logInfo.Info(string.Format("经纪人agent:{0}清空了经纪人属性缓存", request.Agent)); var key = string.Format("agent_key_cache_{0}", request.Agent); CacheProvider.Remove(key); return(1); } catch (Exception ex) { _logError.Info(string.Format("经纪人agent:{0}清空经纪人属性缓存,发生异常", request.Agent)); return(0); } }
public ApproveAgentResponse ApproveAgent(ApproveAgentRequest request, IEnumerable <KeyValuePair <string, string> > pairs) { var response = new ApproveAgentResponse(); try { //根据经纪人获取手机号 bx_agent topAgent = GetAgent(request.Agent); bx_agent curAgent = GetAgent(request.CurAgent); //参数校验 if (topAgent == null || curAgent == null || curAgent.IsUsed != request.OriStatus) { response.Status = HttpStatusCode.Forbidden; return(response); } if (!ValidateReqest(pairs, topAgent.SecretKey, request.SecCode)) { response.Status = HttpStatusCode.Forbidden; return(response); } curAgent.IsUsed = request.CurStatus; if (_agentRepository.UpdateModel(curAgent) > 0) { // 微信审核代理人接口清理缓存 var delAgentPropertiyCacheRequest = new DelAgentPropertiyCacheRequest { Agent = request.CurAgent, }; _cacheManagerService.DelAgentPropertiyCache(delAgentPropertiyCacheRequest); response.Status = HttpStatusCode.OK; } } catch (Exception ex) { response.Status = HttpStatusCode.InternalServerError; logError.Info("发生异常:" + ex.Source + "\n" + ex.StackTrace + "\n" + ex.Message + "\n" + ex.InnerException); } return(response); }
public int DelAgentPropertiyCache([FromUri] DelAgentPropertiyCacheRequest request) { _logInfo.Info("清空经纪人属性缓存请求:" + request.ToJson()); return(_cacheManagerService.DelAgentPropertiyCache(request)); }