class LoggingAspect {
    @Autowired(required = false)
    private OperationRecordMapper recordMapper;

    // 任意公共方法的执行
    @Pointcut("execution(public * * (..))")
    private void anyPublicOperation() {
    }

    // CommandService接口定义的任意方法的执行
    @Pointcut("execution(* com.weibo.service.CommandService+.*(..))")
    private void execCommandOperation() {
    }

    @AfterReturning(value = "anyPublicOperation() && execCommandOperation()", returning = "result")
    public void logAfter(JoinPoint joinPoint, boolean result) {<FILL_FUNCTION_BODY>}

    private String getUsername() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

        if (authentication instanceof AnonymousAuthenticationToken) {
            throw new CustomException.UnauthorizedException();
        }
        UserDetails userDetails = (UserDetails) authentication.getPrincipal();
        return TokenUtils.getUserNameFromToken(userDetails.getUsername());
    }
}

        Object[] args = joinPoint.getArgs();

        OperationRecord record = new OperationRecord();
        record.setOperator(getUsername());
        record.setType(joinPoint.getSignature().getName());
        record.setGroupName(args[0].toString());
        record.setCommand(JSON.toJSONString(args[1]));
        int status = result ? 1 : 0;
        record.setStatus((byte) status);

        if (recordMapper == null) {
            LoggerUtil.accessLog(JSON.toJSONString(record));
        } else {
            recordMapper.insertSelective(record);
        }
    
<no_super_class>