激活码相关接口

This commit is contained in:
张松
2025-02-11 11:18:33 +08:00
parent 48a9376657
commit 1603139acb
11 changed files with 137 additions and 5 deletions

View File

@@ -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)

View File

@@ -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, "记录已存在"),