package com.example.system.advice;

import com.example.system.model.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@Slf4j
@ResponseBody
@ControllerAdvice
public class ExceptionAdvice {
    @ExceptionHandler
    public Object Exception(Exception e) {
        log.error("服务端发生异常 e: {}", e);
        return Result.fail("服务端发生异常");
    }
}
