fix: 重新设计依赖,添加多个模块

This commit is contained in:
2025-11-24 23:42:00 +08:00
parent 122a1738bd
commit 7a3d3a06ba
44 changed files with 377 additions and 147 deletions

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.meowrain</groupId>
<artifactId>aioj-backend-common</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>aioj-backend-common-log</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@@ -0,0 +1,23 @@
package cn.meowrain.aioj.backend.framework.log.annotation;
import java.lang.annotation.*;
/**
* 系统日志注解
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface SysLog {
/**
* 描述
* @return {@link String}
*/
String value() default "";
/**
* Spel表达式
* @return 日志描述
*/
String expression() default "";
}

View File

@@ -0,0 +1,31 @@
package cn.meowrain.aioj.backend.framework.log.aspect;
import cn.hutool.core.util.StrUtil;
import cn.meowrain.aioj.backend.framework.log.annotation.SysLog;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.expression.EvaluationContext;
@Aspect
@Slf4j
@RequiredArgsConstructor
public class SysLogAspect {
@Around("@annotation(sysLog)")
public Object around(ProceedingJoinPoint joinPoint,SysLog sysLog) throws Throwable {
String strClassName = joinPoint.getTarget().getClass().getName();
String strMethodName = joinPoint.getSignature().getName();
log.debug("[类名]:{},[方法]:{}", strClassName, strMethodName);
String value = sysLog.value();
String expression = sysLog.expression();
if(StrUtil.isNotBlank(expression)) {
// 解析SPEL
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
EvaluationContext context = SysLogUtils.getContext(point.getArgs(), signature.getMethod());
}
}
}

View File

@@ -0,0 +1,9 @@
package cn.meowrain.aioj.backend.framework.log.utils;
import cn.meowrain.aioj.backend.framework.log.event.SysLogEventSource;
public final class SysLogUtils {
public static SysLogEventSource getSysLog() {
}
}