Commit 3c507b26 authored by xiaozhe.chen's avatar xiaozhe.chen

添加还款记录查询接口

parent beb0581e
package cn.quantgroup.customer.exception;
public class NetCommunicationException extends RuntimeException {
public NetCommunicationException(String message) {
super(message);
}
}
package cn.quantgroup.customer.rest;
import cn.quantgroup.customer.constant.Constant;
import cn.quantgroup.customer.enums.ErrorCodeEnum;
import cn.quantgroup.customer.exception.NetCommunicationException;
import cn.quantgroup.customer.exception.BusinessException;
import cn.quantgroup.customer.rest.vo.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
......@@ -23,12 +22,12 @@ public class AdviceRest {
}
@ExceptionHandler({NetCommunicationException.class})
@ExceptionHandler({BusinessException.class})
@ResponseBody
@ResponseStatus(HttpStatus.OK)
public JsonResult handleNetCommunicationException(NetCommunicationException ex) {
public JsonResult handleBusinessException(BusinessException ex) {
log.info(ex.getMessage());
return JsonResult.buildErrorStateResult(ErrorCodeEnum.NET_ERROR.getMessage(), ErrorCodeEnum.NET_ERROR.getCode());
return JsonResult.buildErrorStateResult(ex.getType().getMessage(), ex.getType().getCode());
}
......
......@@ -3,7 +3,7 @@ package cn.quantgroup.customer.service.impl;
import cn.quantgroup.customer.common.adapter.LocalDateTypeAdapter;
import cn.quantgroup.customer.entity.User;
import cn.quantgroup.customer.enums.ErrorCodeEnum;
import cn.quantgroup.customer.exception.NetCommunicationException;
import cn.quantgroup.customer.exception.BusinessException;
import cn.quantgroup.customer.repo.UserRepo;
import cn.quantgroup.customer.rest.param.phone.ModifyPhoneAudit;
import cn.quantgroup.customer.rest.param.phone.ModifyPhoneFeedback;
......@@ -70,7 +70,7 @@ public class UserServiceImpl implements IUserService {
return response;
} catch (Exception e) {
log.error("[user][query modify phone list] 网络通讯异常,modifyPhoneQuery:{},ex:{}", modifyPhoneQuery, ExceptionUtils.getStackTrace(e));
throw new NetCommunicationException(ErrorCodeEnum.NET_ERROR.getMessage());
throw new BusinessException(ErrorCodeEnum.NET_ERROR);
}
}
......@@ -86,7 +86,7 @@ public class UserServiceImpl implements IUserService {
return result;
} catch (Exception e) {
log.error("[user][query modify audit ] 网络通讯异常,modifyPhoneAudit:{},ex:{}", modifyPhoneAudit, ExceptionUtils.getStackTrace(e));
throw new NetCommunicationException(ErrorCodeEnum.NET_ERROR.getMessage());
throw new BusinessException(ErrorCodeEnum.NET_ERROR);
}
}
......@@ -103,7 +103,7 @@ public class UserServiceImpl implements IUserService {
return result;
} catch (Exception e) {
log.error("[user][query modify feedback ] 网络通讯异常,modifyPhoneFeedback:{},ex:{}", modifyPhoneFeedback, ExceptionUtils.getStackTrace(e));
throw new NetCommunicationException(ErrorCodeEnum.NET_ERROR.getMessage());
throw new BusinessException(ErrorCodeEnum.NET_ERROR);
}
}
......@@ -122,7 +122,7 @@ public class UserServiceImpl implements IUserService {
return String.valueOf(uuid);
} catch (Exception e) {
log.error("[user][query uuid by idNo ] 网络通讯异常,idNo:{},ex:{}", idNo, ExceptionUtils.getStackTrace(e));
throw new NetCommunicationException(ErrorCodeEnum.NET_ERROR.getMessage());
throw new BusinessException(ErrorCodeEnum.NET_ERROR);
}
}
......
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