1、修改包名,避免自动配置被SpringBoot隐性优先规则覆盖
Sync All Branches to GitHub / sync (push) Successful in 3s

2、自定义Jackson starter
This commit is contained in:
hanfuye
2026-01-12 16:28:31 +08:00
parent 5c18560351
commit 4eb71c4d4d
33 changed files with 407 additions and 326 deletions
@@ -4,25 +4,23 @@
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>top.crushtj</groupId>
<groupId>com.jy</groupId>
<artifactId>xiaoyi-framework</artifactId>
<version>${revision}</version>
</parent>
<packaging>jar</packaging>
<artifactId>xiaoyi-spring-boot-starter-biz-operationlog</artifactId>
<name>${project.artifactId}</name>
<description>平台基础设施层:操作日志记录器</description>
<dependencies>
<dependency>
<groupId>top.crushtj</groupId>
<groupId>com.jy</groupId>
<artifactId>xiaoyi-common</artifactId>
</dependency>
<!-- AOP 切面 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
</dependencies>
</project>
@@ -1,4 +1,4 @@
package top.crushtj.framework.biz.operationlog;
package com.jy.framework.biz.operationlog;
import java.lang.reflect.Method;
import java.util.Arrays;
@@ -12,19 +12,28 @@ import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import lombok.extern.slf4j.Slf4j;
import top.crushtj.framework.biz.operationlog.aspect.ApiOperationLog;
import top.crushtj.framework.common.utils.JsonUtils;
import com.jy.framework.biz.operationlog.aspect.ApiOperationLog;
import com.jy.framework.common.utils.JsonUtils;
/**
*
* @author ayi
* @title ApiOperationLog
* @description 自定义注解用于标记需要记录操作日志的方法
* @date 2025/11/21
*/
@Slf4j
@Aspect
public class ApiOperationLogAspect {
/** 以自定义 @ApiOperationLog 注解为切点,凡是添加 @ApiOperationLog 的方法,都会执行环绕中的代码 */
@Pointcut("@annotation(top.crushtj.framework.biz.operationlog.aspect.ApiOperationLog)")
public void apiOperationLog() {}
@Pointcut("@annotation(com.jy.framework.biz.operationlog.aspect.ApiOperationLog)")
public void apiOperationLog() {
}
/**
* 环绕
*
*
* @param joinPoint 连接点
* @return 方法执行结果
* @throws Throwable 方法执行过程中抛出的异常
@@ -65,7 +74,7 @@ public class ApiOperationLogAspect {
/**
* 获取注解的描述信息
*
*
* @param joinPoint 连接点
* @return 注解的描述信息
*/
@@ -85,7 +94,7 @@ public class ApiOperationLogAspect {
/**
* JSON 字符串
*
*
* @return 入参的 JSON 字符串
*/
private Function<Object, String> toJsonStr() {
@@ -1,4 +1,4 @@
package top.crushtj.framework.biz.operationlog.aspect;
package com.jy.framework.biz.operationlog.aspect;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -8,10 +8,10 @@ import java.lang.annotation.Target;
/**
*
* @Title: ApiOperationLog
* @Description: 自定义注解用于标记需要记录操作日志的方法
* @Author: ayi
* @Date: 2025/11/21
* @author ayi
* @title ApiOperationLog
* @description 自定义注解用于标记需要记录操作日志的方法
* @date 2025/11/21
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
@@ -20,7 +20,7 @@ public @interface ApiOperationLog {
/**
* API 功能描述
*
* @return
* @return 功能描述
*/
String description() default "";
}
@@ -1,9 +1,17 @@
package top.crushtj.framework.biz.operationlog.config;
package com.jy.framework.biz.operationlog.config;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import top.crushtj.framework.biz.operationlog.ApiOperationLogAspect;
import com.jy.framework.biz.operationlog.ApiOperationLogAspect;
/**
*
* @author ayi
* @title ApiOperationLog
* @description 自定义注解用于标记需要记录操作日志的方法
* @date 2025/11/21
*/
@AutoConfiguration
public class ApiOperationLogAutoConfiguration {
@@ -1 +1 @@
top.crushtj.framework.biz.operationlog.config.ApiOperationLogAutoConfiguration
com.jy.framework.biz.operationlog.config.ApiOperationLogAutoConfiguration