重构包名,解决JacksonAutoConfiguration被spring boot默认JacksonAutoConfiguration配置覆盖的问题
Sync All Branches to GitHub / sync (push) Successful in 2s

This commit is contained in:
2026-01-16 09:40:16 +08:00
parent 3cba48728d
commit e79df6fc1f
39 changed files with 84 additions and 82 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
"name": "Spring Boot-XiaoyiAuthApplication<xiaoyi-auth>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "com.jy.xiaoyishu.auth.XiaoyiAuthApplication",
"mainClass": "top.crushtj.xiaoyishu.auth.XiaoyiAuthApplication",
"projectName": "xiaoyi-auth",
"args": "",
"envFile": "${workspaceFolder}/.env"
+4 -4
View File
@@ -3,7 +3,7 @@
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>
<groupId>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyishu</artifactId>
<version>${revision}</version>
@@ -54,20 +54,20 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-common</artifactId>
<version>${revision}</version>
</dependency>
<!-- 业务接口日志组件 -->
<dependency>
<groupId>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-spring-boot-starter-biz-operationlog</artifactId>
<version>${revision}</version>
</dependency>
<!-- 业务接口日志组件 -->
<dependency>
<groupId>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-spring-boot-starter-jackson</artifactId>
<version>${revision}</version>
</dependency>
+4 -4
View File
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<!-- 指定父项目 -->
<parent>
<groupId>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyishu</artifactId>
<version>${revision}</version>
</parent>
@@ -19,18 +19,18 @@
<dependencies>
<dependency>
<groupId>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-common</artifactId>
</dependency>
<!-- 业务接口日志组件 -->
<dependency>
<groupId>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-spring-boot-starter-biz-operationlog</artifactId>
</dependency>
<!--Jackson-->
<dependency>
<groupId>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-spring-boot-starter-jackson</artifactId>
</dependency>
<dependency>
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth;
package top.crushtj.xiaoyishu.auth;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth.config;
package top.crushtj.xiaoyishu.auth.config;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
@@ -15,7 +15,7 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration
@MapperScan("com.jy.**.mappers")
@MapperScan("top.crushtj.**.mappers")
public class MybatisPlusConfig {
/**
* 分页插件
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth.config;
package top.crushtj.xiaoyishu.auth.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth.constant;
package top.crushtj.xiaoyishu.auth.constant;
/**
*
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth.controller;
package top.crushtj.xiaoyishu.auth.controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@@ -6,9 +6,9 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jy.framework.biz.operationlog.aspect.ApiOperationLog;
import com.jy.framework.common.response.Response;
import com.jy.xiaoyishu.auth.model.vo.User;
import top.crushtj.framework.biz.operationlog.aspect.ApiOperationLog;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyishu.auth.model.vo.User;
import cn.dev33.satoken.stp.StpUtil;
@@ -1,9 +1,9 @@
package com.jy.xiaoyishu.auth.controller;
package top.crushtj.xiaoyishu.auth.controller;
import com.jy.framework.biz.operationlog.aspect.ApiOperationLog;
import com.jy.framework.common.response.Response;
import com.jy.xiaoyishu.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import com.jy.xiaoyishu.auth.service.VerificationCodeService;
import top.crushtj.framework.biz.operationlog.aspect.ApiOperationLog;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyishu.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import top.crushtj.xiaoyishu.auth.service.VerificationCodeService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth.domain.entity;
package top.crushtj.xiaoyishu.auth.domain.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
@@ -1,6 +1,6 @@
package com.jy.xiaoyishu.auth.domain.mappers;
package top.crushtj.xiaoyishu.auth.domain.mappers;
import com.jy.xiaoyishu.auth.domain.entity.UserEntity;
import top.crushtj.xiaoyishu.auth.domain.entity.UserEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jy.xiaoyishu.auth.domain.mappers.UserMapper">
<mapper namespace="top.crushtj.xiaoyishu.auth.domain.mappers.UserMapper">
<resultMap type="com.jy.xiaoyishu.auth.domain.entity.UserEntity" id="UserMap">
<resultMap type="top.crushtj.xiaoyishu.auth.domain.entity.UserEntity" id="UserMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="username" column="username" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
@@ -1,10 +1,10 @@
package com.jy.xiaoyishu.auth.enums;
package top.crushtj.xiaoyishu.auth.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.lang.String;
import com.jy.framework.common.exception.BaseExceptionInterface;
import top.crushtj.framework.common.exception.BaseExceptionInterface;
/**
*
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth.exception;
package top.crushtj.xiaoyishu.auth.exception;
import java.util.Optional;
@@ -8,9 +8,9 @@ import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jy.framework.common.exception.BizException;
import com.jy.framework.common.response.Response;
import com.jy.xiaoyishu.auth.enums.ResponseCodeEnum;
import top.crushtj.framework.common.exception.BizException;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyishu.auth.enums.ResponseCodeEnum;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
@@ -63,7 +63,7 @@ public class GlobalExceptionHandler {
StringBuilder sb = new StringBuilder();
// 获取校验不通过的字段并组合错误信息格式为 email 邮箱格式不正确, 当前值: '123124qq.com';
Optional.ofNullable(bindingResult.getFieldErrors()).ifPresent(errors -> {
Optional.of(bindingResult.getFieldErrors()).ifPresent(errors -> {
errors.forEach(error -> sb.append(error.getField()).append(" ").append(error.getDefaultMessage())
.append(", 当前值: '").append(error.getRejectedValue()).append("'; ")
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth.model.vo;
package top.crushtj.xiaoyishu.auth.model.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth.model.vo.verificationcode;
package top.crushtj.xiaoyishu.auth.model.vo.verificationcode;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
@@ -1,7 +1,7 @@
package com.jy.xiaoyishu.auth.service;
package top.crushtj.xiaoyishu.auth.service;
import com.jy.framework.common.response.Response;
import com.jy.xiaoyishu.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyishu.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
/**
*
@@ -1,16 +1,16 @@
package com.jy.xiaoyishu.auth.service.impl;
package top.crushtj.xiaoyishu.auth.service.impl;
import cn.hutool.core.util.RandomUtil;
import com.jy.framework.common.exception.BizException;
import com.jy.framework.common.response.Response;
import com.jy.xiaoyishu.auth.constant.RedisKeyConstants;
import com.jy.xiaoyishu.auth.enums.ResponseCodeEnum;
import com.jy.xiaoyishu.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import top.crushtj.framework.common.exception.BizException;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyishu.auth.constant.RedisKeyConstants;
import top.crushtj.xiaoyishu.auth.enums.ResponseCodeEnum;
import top.crushtj.xiaoyishu.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import com.jy.xiaoyishu.auth.service.VerificationCodeService;
import top.crushtj.xiaoyishu.auth.service.VerificationCodeService;
import java.util.concurrent.TimeUnit;
@@ -64,11 +64,11 @@ spring:
mybatis-plus:
mapper-locations:
- classpath*:top/crushtj/**/*.xml # 匹配所有模块中的 Mapper XML 文件
type-aliases-package: com.jy.xiaoyishu.auth.domain.entity # 实体类包路径
type-aliases-package: top.crushtj.xiaoyishu.auth.domain.entity # 实体类包路径
configuration:
map-underscore-to-camel-case: true # 开启驼峰命名转换
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 日志输出(调试用)
logging:
level:
com.jy.xiaoyishu.auth.domain.mappers: debug
top.crushtj.xiaoyishu.auth.domain.mappers: debug
@@ -50,11 +50,11 @@ spring:
mybatis-plus:
mapper-locations:
- classpath*:top/crushtj/**/*.xml # 匹配所有模块中的 Mapper XML 文件
type-aliases-package: com.jy.xiaoyishu.auth.domain.entity # 实体类包路径
type-aliases-package: top.crushtj.xiaoyishu.auth.domain.entity # 实体类包路径
configuration:
map-underscore-to-camel-case: true # 开启驼峰命名转换
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 日志输出(调试用)
logging:
level:
com.jy.xiaoyishu.auth.domain.mappers: debug
top.crushtj.xiaoyishu.auth.domain.mappers: debug
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth;
package top.crushtj.xiaoyishu.auth;
import com.alibaba.druid.filter.config.ConfigTools;
import lombok.SneakyThrows;
@@ -1,4 +1,4 @@
package com.jy.xiaoyishu.auth;
package top.crushtj.xiaoyishu.auth;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@@ -1,12 +1,12 @@
package com.jy.xiaoyishu.auth;
package top.crushtj.xiaoyishu.auth;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import com.jy.xiaoyishu.auth.domain.entity.UserEntity;
import com.jy.xiaoyishu.auth.domain.mappers.UserMapper;
import top.crushtj.xiaoyishu.auth.domain.entity.UserEntity;
import top.crushtj.xiaoyishu.auth.domain.mappers.UserMapper;
import java.time.LocalDateTime;
+1 -1
View File
@@ -4,7 +4,7 @@
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>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyishu</artifactId>
<version>${revision}</version>
</parent>
+1 -1
View File
@@ -4,7 +4,7 @@
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>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-framework</artifactId>
<version>${revision}</version>
</parent>
@@ -1,4 +1,4 @@
package com.jy.framework.common.constant;
package top.crushtj.framework.common.constant;
import java.time.format.DateTimeFormatter;
@@ -1,4 +1,4 @@
package com.jy.framework.common.exception;
package top.crushtj.framework.common.exception;
import lombok.Getter;
import lombok.Setter;
@@ -1,12 +1,12 @@
package com.jy.framework.common.response;
package top.crushtj.framework.common.response;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import com.jy.framework.common.exception.BaseExceptionInterface;
import com.jy.framework.common.exception.BizException;
import top.crushtj.framework.common.exception.BaseExceptionInterface;
import top.crushtj.framework.common.exception.BizException;
/**
*
@@ -1,4 +1,4 @@
package com.jy.framework.common.utils;
package top.crushtj.framework.common.utils;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -1,4 +1,4 @@
package com.jy.framework.common.utils;
package top.crushtj.framework.common.utils;
import java.lang.management.ManagementFactory;
import java.net.InetAddress;
@@ -4,7 +4,7 @@
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>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-framework</artifactId>
<version>${revision}</version>
</parent>
@@ -17,7 +17,7 @@
<dependencies>
<dependency>
<groupId>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-common</artifactId>
</dependency>
@@ -1,4 +1,4 @@
package com.jy.framework.biz.operationlog;
package top.crushtj.framework.biz.operationlog;
import java.lang.reflect.Method;
import java.util.Arrays;
@@ -12,8 +12,8 @@ import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import lombok.extern.slf4j.Slf4j;
import com.jy.framework.biz.operationlog.aspect.ApiOperationLog;
import com.jy.framework.common.utils.JsonUtils;
import top.crushtj.framework.biz.operationlog.aspect.ApiOperationLog;
import top.crushtj.framework.common.utils.JsonUtils;
/**
*
@@ -27,7 +27,7 @@ import com.jy.framework.common.utils.JsonUtils;
@Aspect
public class ApiOperationLogAspect {
/** 以自定义 @ApiOperationLog 注解为切点,凡是添加 @ApiOperationLog 的方法,都会执行环绕中的代码 */
@Pointcut("@annotation(com.jy.framework.biz.operationlog.aspect.ApiOperationLog)")
@Pointcut("@annotation(top.crushtj.framework.biz.operationlog.aspect.ApiOperationLog)")
public void apiOperationLog() {
}
@@ -1,4 +1,4 @@
package com.jy.framework.biz.operationlog.aspect;
package top.crushtj.framework.biz.operationlog.aspect;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -1,9 +1,9 @@
package com.jy.framework.biz.operationlog.config;
package top.crushtj.framework.biz.operationlog.config;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import com.jy.framework.biz.operationlog.ApiOperationLogAspect;
import top.crushtj.framework.biz.operationlog.ApiOperationLogAspect;
/**
*
@@ -1 +1 @@
com.jy.framework.biz.operationlog.config.ApiOperationLogAutoConfiguration
top.crushtj.framework.biz.operationlog.config.ApiOperationLogAutoConfiguration
@@ -4,7 +4,7 @@
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>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-framework</artifactId>
<version>${revision}</version>
</parent>
@@ -16,7 +16,7 @@
<dependencies>
<dependency>
<groupId>com.jy</groupId>
<groupId>top.crushtj</groupId>
<artifactId>xiaoyi-common</artifactId>
</dependency>
<dependency>
@@ -1,4 +1,4 @@
package com.jy.framework.jackson;
package top.crushtj.framework.jackson;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -13,9 +13,10 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.YearMonthSerializer;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.context.annotation.Bean;
import com.jy.framework.common.constant.DateConstants;
import com.jy.framework.common.utils.JsonUtils;
import top.crushtj.framework.common.constant.DateConstants;
import top.crushtj.framework.common.utils.JsonUtils;
import java.time.LocalDate;
import java.time.LocalDateTime;
@@ -32,6 +33,7 @@ import java.util.TimeZone;
*/
@AutoConfiguration
@AutoConfigureBefore(org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration.class)
public class JacksonAutoConfiguration {
@Bean
@@ -1 +1 @@
com.jy.framework.jackson.JacksonAutoConfiguration
top.crushtj.framework.jackson.JacksonAutoConfiguration