Commit 446ea102 authored by xiaozhe.chen's avatar xiaozhe.chen

运营系统替换中台接口

parent a3010499
......@@ -74,6 +74,10 @@ public class JsonResult<T> implements Serializable {
return new JsonResult(msg, SUCCESS_CODE, data, API_INVOKE_UNEXPECTED_RESULT_CODE);
}
public static <T> JsonResult buildErrorStateResult(String msg) {
return new JsonResult(msg, ERROR_STATE_CODE, null, ERROR_BUSSINESS_CODE);
}
@Override
public String toString() {
return "JsonResult{" +
......
......@@ -46,12 +46,16 @@ public class SidecarServiceImpl implements ISidecarService {
log.error("{} 查询还款计划失败 loanId={} result={}", logPre, loanId, result);
return JsonResult.buildErrorStateResult("查询还款计划失败", null);
} else {
JsonResult<OrderRepayment> OrderRepaymentResult = JSONTools.deserialize(result, new TypeReference<MoResult<OrderRepayment>>() {
MoResult<OrderRepayment> orderRepaymentResult = JSONTools.deserialize(result, new TypeReference<MoResult<OrderRepayment>>() {
});
if (OrderRepaymentResult != null) {
return OrderRepaymentResult;
if (orderRepaymentResult != null) {
if(orderRepaymentResult.isSuccess()){
return JsonResult.buildSuccessResult("success",orderRepaymentResult.getData());
}else {
return JsonResult.buildErrorStateResult(orderRepaymentResult.getMsg());
}
} else {
return JsonResult.buildErrorStateResult("还款计划查询失败", null);
return JsonResult.buildErrorStateResult("还款计划查询失败");
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment