激活码相关接口
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.czg.exception;
|
||||
|
||||
import cn.dev33.satoken.exception.NotLoginException;
|
||||
import cn.dev33.satoken.exception.NotPermissionException;
|
||||
import cn.hutool.core.exceptions.ValidateException;
|
||||
import com.czg.resp.CzgRespCode;
|
||||
@@ -31,6 +32,14 @@ public class CzgControllerAdvice {
|
||||
return CzgResult.failure(CzgRespCode.SYSTEM_ERROR);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@ExceptionHandler(value = NotLoginException.class)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public CzgResult<Object> notLoginErrorHandler(NotLoginException ex) {
|
||||
setErrorLog(ex);
|
||||
return CzgResult.failure(CzgRespCode.NOT_LOGIN);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@ExceptionHandler(value = NotPermissionException.class)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
|
||||
@@ -9,6 +9,7 @@ import lombok.Getter;
|
||||
public enum CzgRespCode {
|
||||
SUCCESS(200, "操作成功"),
|
||||
FAILURE(500, "操作失败"),
|
||||
NOT_LOGIN(501, "登录失效"),
|
||||
SYSTEM_ERROR(555, "系统内部错误"),
|
||||
RECORD_NOT_EXIST(601, "记录不存在"),
|
||||
RECORD_EXISTED(602, "记录已存在"),
|
||||
|
||||
Reference in New Issue
Block a user