@Before(value = "@annotation(org.apache.bigtop.manager.server.annotations.Audit)")
    public void before(JoinPoint joinPoint) {
        MethodSignature ms = (MethodSignature) joinPoint.getSignature();
        Long userId = SessionUserHolder.getUserId();
        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        if (attributes != null && userId != null) {
            // obtain request uri
            HttpServletRequest request = attributes.getRequest();
            String uri = request.getRequestURI();
            // obtain controller name
            Class<?> controller = joinPoint.getThis().getClass();
            Tag annotation = controller.getAnnotation(Tag.class);
            String apiName = "";
            String apiDesc = "";
            if (annotation != null) {
                apiName = annotation.name();
                apiDesc = annotation.description();
            }
            // obtain method name
            String methodName = ms.getName();
            // obtain method desc
            String operationSummary = "";
            String operationDesc = "";
            Operation operation = ms.getMethod().getDeclaredAnnotation(Operation.class);
            if (operation != null) {
                operationSummary = operation.summary();
                operationDesc = operation.description();
            }

            AuditLogPO auditLogPO = new AuditLogPO();
            auditLogPO.setUserId(userId);
            auditLogPO.setUri(uri);
            auditLogPO.setTagName(apiName);
            auditLogPO.setTagDesc(apiDesc);
            auditLogPO.setOperationSummary(operationSummary);
            auditLogPO.setOperationDesc(operationDesc);
            auditLogPO.setArgs(JsonUtils.writeAsString(joinPoint.getArgs()));

            log.debug("auditLog: {}", auditLogPO);
            log.debug("request method：{}.{}", joinPoint.getSignature().getDeclaringTypeName(), methodName);

            auditLogRepository.save(auditLogPO);
        }
    }
@Test
    void before_NullRequestAttributes_DoesNotSaveAuditLog() {
        SessionUserHolder.setUserId(1L);

        auditAspect.before(joinPoint);

        verify(auditLogRepository, never()).save(any(AuditLogPO.class));
    }