public MyListViewModel GetMyList(GetMyListRequest request, IEnumerable <KeyValuePair <string, string> > pairs) { var viewModel = new MyListViewModel(); #region 参数校验 //校验请求串 var baseRequest = new AppBaseRequest() { Agent = request.Agent, SecCode = request.SecCode, CustKey = request.CustKey, BhToken = request.BhToken, ChildAgent = request.ChildAgent }; //校验返回值 var baseResponse = _appVerifyService.Verify(baseRequest, pairs); if (baseResponse.ErrCode != 1) { viewModel.BusinessStatus = baseResponse.ErrCode; viewModel.StatusMessage = baseResponse.ErrMsg; return(viewModel); } #endregion #region 业务逻辑 viewModel = _bjdService.GetMyList(request); #endregion return(viewModel); }
public HttpResponseMessage GetMyList([FromUri] GetMyListRequest request) { _logAppInfo.Info(string.Format("请求报价续保列表接口请求串:{0}", Request.RequestUri)); var viewModel = new MyListViewModel(); if (!ModelState.IsValid) { viewModel.BusinessStatus = -10000; string msg = ModelState.Values.Where(a => a.Errors.Count == 1).Aggregate(string.Empty, (current, a) => current + (a.Errors[0].ErrorMessage + "; ")); viewModel.StatusMessage = "输入参数错误," + msg; return(viewModel.ResponseToJson()); } viewModel = _appAchieveService.GetMyList(request, Request.GetQueryNameValuePairs()); //_logAppInfo.Info(string.Format("请求报价续保列表接口返回值:{0}", viewModel.ToJson())); return(viewModel.ResponseToJson()); }