package com.xxfc.platform.vehicle.config;

import com.github.wxiaoqi.security.common.exception.BaseException;
import com.xxfc.platform.vehicle.common.RestResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class BaseExceptionHandler {

    @ExceptionHandler(BaseException.class)
    public RestResponse baseExceptionHandler(BaseException e) {
        return RestResponse.codeAndMessage(e.getStatus(), e.getMessage());
    }

}
