新增设备异常

This commit is contained in:
wenc000 2019-08-27 11:20:57 +08:00
parent 68ce3e9b15
commit 4592be4760
4 changed files with 42 additions and 2 deletions

View File

@ -48,7 +48,9 @@ public class ResponseAdvice {
result.setCode(ErrorResultCodeEnum.PARAMS_ERROR.getValue());
} else if (e instanceof FileException) {
result.setCode(ErrorResultCodeEnum.FILE_ERROR.getValue());
} else if(e instanceof AccessTokenException) {
} else if (e instanceof AppDeviceException) {
result.setCode(ErrorResultCodeEnum.DEVICE_ERROR.getValue());
} else if (e instanceof AccessTokenException) {
response.setStatus(HttpStatus.UNAUTHORIZED.value());
}
// 自定义提示信息

View File

@ -54,6 +54,8 @@ public class TransactionConfig {
source.addTransactionalMethod("exec*", required);
source.addTransactionalMethod("set*", required);
source.addTransactionalMethod("login", required);
source.addTransactionalMethod("get*", readOnly);
source.addTransactionalMethod("query*", readOnly);
source.addTransactionalMethod("find*", readOnly);

View File

@ -25,7 +25,8 @@ public enum ErrorResultCodeEnum {
TOKEN_ERROR(40302),
USERNAME_PASSWORD_ERROR(40303),
USER_EXIST(40304),
PERMISSION_ERROR(40401);
PERMISSION_ERROR(40401),
DEVICE_ERROR(40501);
private int value;

View File

@ -0,0 +1,35 @@
package com.cm.common.exception;
import com.cm.common.exception.base.SystemException;
/**
* When you feel like quitting. Think about why you started
* 当你想要放弃的时候想想当初你为何开始
*
* @ClassName: AppDeviceException
* @Description: APP设备异常
* @Author: WangGeng
* @Date: 2019/8/27 11:14 上午
* @Version: 1.0
**/
public class AppDeviceException extends SystemException {
public AppDeviceException() {
}
public AppDeviceException(String message) {
super(message);
}
public AppDeviceException(String message, boolean withMsg) {
super(message, withMsg);
}
public AppDeviceException(String message, Throwable cause) {
super(message, cause);
}
public AppDeviceException(Throwable cause) {
super(cause);
}
}