package cn.quantgroup.xyqb.aspect.forbidden;

import cn.quantgroup.xyqb.exception.AccessForbiddenException;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
@Slf4j
public class AccessForbiddenAspect {
    @Pointcut("@annotation(cn.quantgroup.xyqb.aspect.forbidden.AccessForbiddenValidator)")
    public void pointCutAt() {
    }

    @Before("pointCutAt()")
    private void before() throws Throwable {
        throw new AccessForbiddenException("禁止访问，接口已下线");
    }
}
