Browse Source

初始化

master
zhaoyiran 8 months ago
parent
commit
a8abf58432
  1. 2
      src/main/java/com/win/bank/Application.java
  2. 8
      src/main/java/com/win/bank/common/CommonResult.java
  3. 2
      src/main/java/com/win/bank/config/RestTemplateConfig.java
  4. 2
      src/main/java/com/win/bank/exception/ErrorCode.java
  5. 2
      src/main/java/com/win/bank/exception/GlobalErrorCodeConstants.java
  6. 2
      src/main/java/com/win/bank/exception/ServerException.java
  7. 2
      src/main/java/com/win/bank/exception/ServiceException.java
  8. 10
      src/main/java/com/win/bank/handler/GlobalExceptionHandler.java

2
src/main/java/com/win/qad/Application.java → src/main/java/com/win/bank/Application.java

@ -1,4 +1,4 @@
package com.win.qad;
package com.win.bank;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

8
src/main/java/com/win/qad/common/CommonResult.java → src/main/java/com/win/bank/common/CommonResult.java

@ -1,9 +1,9 @@
package com.win.qad.common;
package com.win.bank.common;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.win.qad.exception.ErrorCode;
import com.win.qad.exception.GlobalErrorCodeConstants;
import com.win.qad.exception.ServiceException;
import com.win.bank.exception.ErrorCode;
import com.win.bank.exception.GlobalErrorCodeConstants;
import com.win.bank.exception.ServiceException;
import lombok.Data;
import org.springframework.util.Assert;

2
src/main/java/com/win/qad/config/RestTemplateConfig.java → src/main/java/com/win/bank/config/RestTemplateConfig.java

@ -1,4 +1,4 @@
package com.win.qad.config;
package com.win.bank.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

2
src/main/java/com/win/qad/exception/ErrorCode.java → src/main/java/com/win/bank/exception/ErrorCode.java

@ -1,4 +1,4 @@
package com.win.qad.exception;
package com.win.bank.exception;
import lombok.Data;

2
src/main/java/com/win/qad/exception/GlobalErrorCodeConstants.java → src/main/java/com/win/bank/exception/GlobalErrorCodeConstants.java

@ -1,4 +1,4 @@
package com.win.qad.exception;
package com.win.bank.exception;
/**
* 全局错误码枚举

2
src/main/java/com/win/qad/exception/ServerException.java → src/main/java/com/win/bank/exception/ServerException.java

@ -1,4 +1,4 @@
package com.win.qad.exception;
package com.win.bank.exception;
import lombok.Data;
import lombok.EqualsAndHashCode;

2
src/main/java/com/win/qad/exception/ServiceException.java → src/main/java/com/win/bank/exception/ServiceException.java

@ -1,4 +1,4 @@
package com.win.qad.exception;
package com.win.bank.exception;
import lombok.Data;
import lombok.EqualsAndHashCode;

10
src/main/java/com/win/qad/handler/GlobalExceptionHandler.java → src/main/java/com/win/bank/handler/GlobalExceptionHandler.java

@ -1,15 +1,15 @@
package com.win.qad.handler;
package com.win.bank.handler;
import com.win.qad.common.CommonResult;
import com.win.qad.exception.ServiceException;
import com.win.bank.common.CommonResult;
import com.win.bank.exception.ServiceException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import javax.servlet.http.HttpServletRequest;
import static com.win.qad.exception.GlobalErrorCodeConstants.INTERFACE_ERROR;
import static com.win.qad.exception.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
import static com.win.bank.exception.GlobalErrorCodeConstants.INTERFACE_ERROR;
import static com.win.bank.exception.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
/**
* 全局异常处理器 Exception 翻译成 CommonResult + 对应的异常编号
Loading…
Cancel
Save