public ActionResult Index() { BaseRequest baseRequest; var verifyResult = Verify(out baseRequest); TxtLoger.SavaLogToTXT(string.Format("请求数据验证结果:编号:{0};信息:{1}", (int)verifyResult.Code, verifyResult.ErrorMessage), "a"); //loger.Info(string.Format("请求数据验证结果:编号:{0};信息:{1}", (int)verifyResult.Code, verifyResult.ErrorMessage)); if (verifyResult.IsPass) { var response = Excute(baseRequest); Notice(response, baseRequest.SourceID); } else { if (verifyResult.Code != EnumPlatform.EResponseCode.存在此机构) { var response = BaseResponse.CreateBaseResponse(verifyResult.Code, verifyResult.ErrorMessage, null); Notice(response, baseRequest.SourceID); TxtLoger.SavaLogToTXT("response 数据为:" + JsonUtils.Serialize(response), "a"); } else { TxtLoger.SavaLogToTXT("不存在此机构,verifyResult.Code =" + verifyResult.Code, "a"); }; } return(View()); }
/// <summary> /// 根据bizCode选择处理方法 /// </summary> /// <param name="request"></param> /// <returns></returns> private BaseResponse Excute(BaseRequest request) { switch (request.BizCode) { case "1006": return(Excute1006(request)); } return(BaseResponse.CreateBaseResponse(EnumPlatform.EResponseCode.无效交易类型, null)); }