package com.xinxincaravan.caravan.vehicle.config;

import com.github.wxiaoqi.security.common.exception.BaseException;
import com.xinxincaravan.caravan.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());
    }

}
