初始化提交

This commit is contained in:
谭凯凯
2025-02-10 16:19:18 +08:00
committed by Tankaikai
parent 5f0b4365af
commit 2e4f75e450
5 changed files with 16 additions and 20 deletions

View File

@@ -2,7 +2,6 @@ package com.czg.exception;
import cn.dev33.satoken.exception.NotPermissionException;
import cn.hutool.core.exceptions.ValidateException;
import cn.dev33.satoken.exception.NotPermissionException;
import com.czg.resp.CzgRespCode;
import com.czg.resp.CzgResult;
import lombok.extern.slf4j.Slf4j;
@@ -53,8 +52,8 @@ public class CzgControllerAdvice {
/**
* 处理自定义异常
*/
@ExceptionHandler(value = {CzgException.class, IllegalArgumentException.class})
public CzgResult handleCzgException(CzgException ex) {
@ExceptionHandler(CzgException.class)
public CzgResult<Object> handleCzgException(CzgException ex) {
return CzgResult.failure(ex.getCode(), ex.getMsg());
}
@@ -62,7 +61,7 @@ public class CzgControllerAdvice {
* 处理Hutool的断言抛出异常
*/
@ExceptionHandler(IllegalArgumentException.class)
public CzgResult handleAssertException(IllegalArgumentException ex) {
public CzgResult<Object> handleAssertException(IllegalArgumentException ex) {
return CzgResult.failure(CzgRespCode.PARAM_ERROR.getCode(), ex.getMessage());
}
@@ -70,7 +69,7 @@ public class CzgControllerAdvice {
* 处理Hutool的校验工具类抛出异常
*/
@ExceptionHandler(ValidateException.class)
public CzgResult handleHutoolValidateException(ValidateException ex) {
public CzgResult<Object> handleHutoolValidateException(ValidateException ex) {
return CzgResult.failure(CzgRespCode.PARAM_ERROR.getCode(), ex.getMessage());
}