提交 a02839a1 authored 作者: 吕本才's avatar 吕本才

feat(activity): 修改图片保存bug

上级 52efed34
package com.wangxiaolu.promotion.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author : liqiulin
* @date : 2024-08-05 15
* @describe :
*/
@AllArgsConstructor
@Getter
public enum FlagType {
/**
* 有效
*/
YES(1),
NO(0),
;
private Integer type;
}
......@@ -9,7 +9,9 @@ import com.wangxiaolu.promotion.result.basedata.RCode;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.exceptions.TooManyResultsException;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
......@@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
* @describe : 统一异常处理
*/
//@ControllerAdvice
@RestControllerAdvice
@Slf4j
public class ControllerExceptionAdvice {
......@@ -29,6 +32,12 @@ public class ControllerExceptionAdvice {
return new R(e.getCode(), e.getMsg());
}
@ExceptionHandler({IllegalArgumentException.class})
public R paramExceptionHandler(IllegalArgumentException e) {
log.error("参数异常2: {}", e);
return new R(HttpStatus.BAD_REQUEST.value(), e.getMessage());
}
@ExceptionHandler({FlowException.class})
public R flowExceptionHandler(FlowException e) {
log.error("流量异常: {}", e);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论