From 71b286f67ddeaeb42962dc86092dd0a8de70f1f3 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Thu, 19 Sep 2019 23:17:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EAPP=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cm/common/advice/ResponseAdvice.java | 2 ++ .../cm/common/enums/ErrorResultCodeEnum.java | 3 +- .../common/exception/AppVersionException.java | 36 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 cloud-common/src/main/java/com/cm/common/exception/AppVersionException.java diff --git a/cloud-common/src/main/java/com/cm/common/advice/ResponseAdvice.java b/cloud-common/src/main/java/com/cm/common/advice/ResponseAdvice.java index 5d88b75..b0cda70 100644 --- a/cloud-common/src/main/java/com/cm/common/advice/ResponseAdvice.java +++ b/cloud-common/src/main/java/com/cm/common/advice/ResponseAdvice.java @@ -50,6 +50,8 @@ public class ResponseAdvice { result.setCode(ErrorResultCodeEnum.FILE_ERROR.getValue()); } else if (e instanceof AppDeviceException) { result.setCode(ErrorResultCodeEnum.DEVICE_ERROR.getValue()); + } else if (e instanceof AppVersionException) { + result.setCode(ErrorResultCodeEnum.DEVICE_VERSION_ERROR.getValue()); } else if (e instanceof AccessTokenException) { response.setStatus(HttpStatus.UNAUTHORIZED.value()); } diff --git a/cloud-common/src/main/java/com/cm/common/enums/ErrorResultCodeEnum.java b/cloud-common/src/main/java/com/cm/common/enums/ErrorResultCodeEnum.java index d5305d0..1c063ee 100644 --- a/cloud-common/src/main/java/com/cm/common/enums/ErrorResultCodeEnum.java +++ b/cloud-common/src/main/java/com/cm/common/enums/ErrorResultCodeEnum.java @@ -26,7 +26,8 @@ public enum ErrorResultCodeEnum { USERNAME_PASSWORD_ERROR(40303), USER_EXIST(40304), PERMISSION_ERROR(40401), - DEVICE_ERROR(40501); + DEVICE_ERROR(40501), + DEVICE_VERSION_ERROR(40502); private int value; diff --git a/cloud-common/src/main/java/com/cm/common/exception/AppVersionException.java b/cloud-common/src/main/java/com/cm/common/exception/AppVersionException.java new file mode 100644 index 0000000..62dc540 --- /dev/null +++ b/cloud-common/src/main/java/com/cm/common/exception/AppVersionException.java @@ -0,0 +1,36 @@ +package com.cm.common.exception; + +import com.cm.common.exception.base.SystemException; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: AppVersionException + * @Description: app版本异常 + * @Author: WangGeng + * @Date: 2019/9/19 5:47 下午 + * @Version: 1.0 + **/ +public class AppVersionException extends SystemException { + + public AppVersionException() { + super(); + } + + public AppVersionException(String message) { + super(message); + } + + public AppVersionException(String message, boolean withMsg) { + super(message, withMsg); + } + + public AppVersionException(String message, Throwable cause) { + super(message, cause); + } + + public AppVersionException(Throwable cause) { + super(cause); + } +}