/// <summary> /// 获取用户的贷款记录 /// </summary> /// <param name="userId"></param> /// <returns></returns> public ActionResult <string> GetUserDebitRecords(int userId) { HttpResultModel ret = new HttpResultModel(); ret.result = Result.SUCCESS; try { ///逻辑 DataProviderResultModel result = DebitProvider.GetUserDebitRecords(userId); if (result.result == Result.SUCCESS) { ret.data = result.data; } else { ret.result = result.result; ret.message = result.message; } } catch (Exception ex) { ret.result = Result.ERROR; ret.errorCode = MainErrorModels.LOGIC_ERROR; ret.message = "The program logic error from the DebitController::GetUserDebitRecords function."; Log.WriteErrorLog("DebitController::GetUserDebitRecords", "UserId:{0},异常:{1}", userId, ex.Message); } return(JsonConvert.SerializeObject(ret)); }
/// <summary> /// 获取用户的贷款记录 /// </summary> /// <param name="userId"></param> /// <returns></returns> public ActionResult <string> GetUserDebitRecords() { HttpResultModel ret = new HttpResultModel(); ret.result = Result.SUCCESS; string content = HelperProvider.GetRequestContent(HttpContext); if (String.IsNullOrEmpty(content)) { ret.result = Result.ERROR; ret.errorCode = MainErrorModels.PARAMETER_ERROR; ret.message = "The request body is empty."; Log.WriteErrorLog("v2:DebitController::SubmitDebitRequest", "请求参数为空。{0}", HelperProvider.GetHeader(HttpContext)); return(JsonConvert.SerializeObject(ret)); } try { var requestBody = JsonConvert.DeserializeObject <DebitRecordsRequestBody>(content); ///逻辑 DataProviderResultModel result = DebitProvider.GetUserDebitRecords(requestBody); if (result.result == Result.SUCCESS) { ret.data = result.data; } else { ret.result = result.result; ret.message = result.message; } } catch (Exception ex) { ret.result = Result.ERROR; ret.errorCode = MainErrorModels.LOGIC_ERROR; ret.message = "The program logic error from the DebitController::GetUserDebitRecords function."; Log.WriteErrorLog("v2::DebitController::GetUserDebitRecords", "UserId:{0},异常:{1}", content, ex.Message); } return(JsonConvert.SerializeObject(ret)); }