Skip to content

Commit 34d3e3a

Browse files
author
zhuxiao
committed
升级jdk17、springboot3
1 parent 779becc commit 34d3e3a

File tree

93 files changed

+422
-370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+422
-370
lines changed

conf/devCommons/config/application.yml

+26-8
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ server:
55
servlet:
66
context-path: / #设置应用的目录. 前缀需要带/, 无需设置后缀, 示例 【 /xxx 】 or 【 / 】
77
spring:
8+
main:
9+
allow-circular-references: true
810
servlet:
911
multipart:
1012
enabled: true #是否启用http上传处理
1113
max-request-size: 10MB #最大请求文件的大小
1214
max-file-size: 10MB #设置单个文件最大长度
13-
resources:
14-
static-locations: classpath:/static #项目静态资源路径 (可直接通过http访问)
1515
freemarker:
1616
template-loader-path: classpath:/templates #freemarker模板目录
1717
template-encoding: UTF-8
@@ -45,11 +45,12 @@ spring:
4545
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
4646
cache:
4747
type: redis
48-
redis:
49-
host: 127.0.0.1
50-
port: 6379
51-
timeout: 1000
52-
password:
48+
data:
49+
redis:
50+
host: 127.0.0.1
51+
port: 6379
52+
timeout: 1000
53+
password:
5354

5455
# #activeMQ配置 ( 注意: activeMQ配置项需在spring的下级 )
5556
activemq:
@@ -86,15 +87,32 @@ spring:
8687
#日志配置参数。
8788
# 当存在logback-spring.xml文件时: 该配置将引进到logback配置, springboot配置不生效。
8889
# 不存在logback-spring.xml 文件时, 使用springboot的配置, 同样可用。
90+
web:
91+
resources:
92+
static-locations: classpath:/static
8993
logging:
9094
level:
9195
root: info #主日志级别
9296
com.jeequan.jeepay: debug #该项目日志级别,当需要打印sql时请开启为debug
93-
path: ./logs #日志存放地址
97+
file:
98+
path: ./logs
9499

100+
springdoc:
101+
swagger-ui:
102+
path: /swagger-ui.html
103+
tags-sorter: alpha
104+
operations-sorter: alpha
105+
api-docs:
106+
path: /v3/api-docs
107+
group-configs:
108+
- group: 'default'
109+
paths-to-match: '/**'
110+
packages-to-scan: com.jeequan.jeepay.mgr.ctrl.isv
95111
# knife4j APIDOC文档
96112
knife4j:
97113
enable: true
114+
setting:
115+
language: zh_cn
98116

99117
#系统业务参数
100118
isys:

jeepay-components/jeepay-components-mq/pom.xml

-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
<artifactId>jeepay-core</artifactId>
2626
</dependency>
2727

28-
<dependency>
29-
<groupId>javax.annotation</groupId>
30-
<artifactId>javax.annotation-api</artifactId>
31-
<scope>provided</scope> <!-- 仅编译依赖该jar, 运行时存在 -->
32-
</dependency>
33-
3428
<!-- ↓↓↓↓↓↓ MQ依赖包 ↓↓↓↓↓↓ -->
3529
<!-- 使用的厂商 scope=compile, 否则需要scope=provided(仅编译,不依赖) -->
3630

jeepay-components/jeepay-components-mq/src/main/java/com/jeequan/jeepay/components/mq/vender/activemq/ActiveMQConfig.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import org.springframework.jms.config.JmsListenerContainerFactory;
2727
import org.springframework.stereotype.Component;
2828

29-
import javax.jms.ConnectionFactory;
30-
import javax.jms.Destination;
29+
import jakarta.jms.ConnectionFactory;
30+
import jakarta.jms.Destination;
3131
import java.util.Map;
3232
import java.util.concurrent.ConcurrentHashMap;
3333

jeepay-components/jeepay-components-mq/src/main/java/com/jeequan/jeepay/components/mq/vender/activemq/ActiveMQSender.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.springframework.jms.core.JmsTemplate;
2525
import org.springframework.stereotype.Component;
2626

27-
import javax.jms.TextMessage;
27+
import jakarta.jms.TextMessage;
2828

2929
/**
3030
* activeMQ 消息发送器的实现

jeepay-components/jeepay-components-mq/src/main/java/com/jeequan/jeepay/components/mq/vender/rabbitmq/RabbitMQConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
import com.jeequan.jeepay.components.mq.constant.MQVenderCS;
2222
import com.jeequan.jeepay.components.mq.model.AbstractMQ;
2323
import com.jeequan.jeepay.core.utils.SpringBeansUtil;
24+
import jakarta.annotation.PostConstruct;
2425
import org.springframework.amqp.core.*;
2526
import org.springframework.beans.factory.annotation.Autowired;
2627
import org.springframework.beans.factory.annotation.Qualifier;
2728
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
2829
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
2930
import org.springframework.stereotype.Component;
3031

31-
import javax.annotation.PostConstruct;
3232
import java.util.Set;
3333

3434
/**

jeepay-components/jeepay-components-oss/pom.xml

+4-6
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,16 @@
5050
<scope>provided</scope> <!-- 仅编译依赖该jar, 运行时存在 -->
5151
</dependency>
5252

53-
<dependency>
54-
<groupId>javax.annotation</groupId>
55-
<artifactId>javax.annotation-api</artifactId>
56-
<scope>provided</scope> <!-- 仅编译依赖该jar, 运行时存在 -->
57-
</dependency>
58-
5953
<!-- 阿里云oss组件 -->
6054
<dependency>
6155
<groupId>com.aliyun.oss</groupId>
6256
<artifactId>aliyun-sdk-oss</artifactId>
6357
<scope>provided</scope> <!-- 当对象存储使用aliyunOSS时,需要改为:compile, 否则使用provided仅用于编译代码 -->
6458
</dependency>
59+
<dependency>
60+
<groupId>jakarta.annotation</groupId>
61+
<artifactId>jakarta.annotation-api</artifactId>
62+
</dependency>
6563

6664
</dependencies>
6765

jeepay-components/jeepay-components-oss/src/main/java/com/jeequan/jeepay/components/oss/service/AliyunOssService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
import com.aliyun.oss.model.GetObjectRequest;
2121
import com.jeequan.jeepay.components.oss.config.AliyunOssYmlConfig;
2222
import com.jeequan.jeepay.components.oss.constant.OssSavePlaceEnum;
23+
import jakarta.annotation.PostConstruct;
2324
import lombok.extern.slf4j.Slf4j;
2425
import org.springframework.beans.factory.annotation.Autowired;
2526
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
2627
import org.springframework.stereotype.Service;
2728
import org.springframework.web.multipart.MultipartFile;
2829

29-
import javax.annotation.PostConstruct;
3030
import java.io.File;
3131

3232
/**

jeepay-core/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141
</dependency>
4242

4343
<dependency>
44-
<groupId>javax.servlet</groupId>
45-
<artifactId>javax.servlet-api</artifactId>
44+
<groupId>jakarta.servlet</groupId>
45+
<artifactId>jakarta.servlet-api</artifactId>
4646
<scope>provided</scope> <!-- 仅编译依赖该jar, 运行时存在 -->
4747
</dependency>
4848

4949
<!-- mybatis plus -->
5050
<dependency>
5151
<groupId>com.baomidou</groupId>
52-
<artifactId>mybatis-plus-boot-starter</artifactId>
52+
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
5353
<version>${mybatis.plus.starter.version}</version>
5454
<scope>provided</scope>
5555
</dependency>

jeepay-core/src/main/java/com/jeequan/jeepay/core/beans/RequestKitBean.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
import org.springframework.web.context.request.RequestAttributes;
2626
import org.springframework.web.context.request.RequestContextHolder;
2727

28-
import javax.servlet.http.HttpServletRequest;
29-
import java.io.BufferedReader;
30-
import java.io.IOException;
31-
import java.io.InputStreamReader;
28+
import jakarta.servlet.http.HttpServletRequest;
3229
import java.util.Iterator;
3330
import java.util.Map;
3431
import java.util.stream.Collectors;

jeepay-core/src/main/java/com/jeequan/jeepay/core/ctrls/AbstractCtrl.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
import org.springframework.util.ObjectUtils;
3434
import org.springframework.web.multipart.MultipartFile;
3535

36-
import javax.servlet.http.HttpServletRequest;
37-
import javax.servlet.http.HttpServletResponse;
36+
import jakarta.servlet.http.HttpServletRequest;
37+
import jakarta.servlet.http.HttpServletResponse;
3838
import java.io.File;
3939
import java.math.BigDecimal;
4040
import java.util.Date;

jeepay-core/src/main/java/com/jeequan/jeepay/core/exception/BizExceptionResolver.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import org.springframework.web.servlet.HandlerExceptionResolver;
2626
import org.springframework.web.servlet.ModelAndView;
2727

28-
import javax.servlet.http.HttpServletRequest;
29-
import javax.servlet.http.HttpServletResponse;
28+
import jakarta.servlet.http.HttpServletRequest;
29+
import jakarta.servlet.http.HttpServletResponse;
3030
import java.io.IOException;
3131

3232
/*

jeepay-manager/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<!-- Knife4j -->
104104
<dependency>
105105
<groupId>com.github.xiaoymin</groupId>
106-
<artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
106+
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
107107
</dependency>
108108

109109
</dependencies>

jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/aop/MethodLogAop.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.springframework.web.context.request.RequestContextHolder;
3939
import org.springframework.web.context.request.ServletRequestAttributes;
4040

41-
import javax.servlet.http.HttpServletRequest;
41+
import jakarta.servlet.http.HttpServletRequest;
4242
import java.lang.reflect.Method;
4343
import java.util.Date;
4444
import java.util.concurrent.Executors;

jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/bootstrap/JeepayMgrApplication.java

+9-17
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
import com.alibaba.fastjson.parser.ParserConfig;
1919
import com.alibaba.fastjson.support.config.FastJsonConfig;
2020
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
21-
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
22-
import io.swagger.annotations.ApiOperation;
21+
import com.baomidou.mybatisplus.annotation.DbType;
22+
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
23+
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
2324
import org.mybatis.spring.annotation.MapperScan;
2425
import org.springframework.boot.SpringApplication;
2526
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -29,11 +30,6 @@
2930
import org.springframework.context.annotation.Configuration;
3031
import org.springframework.http.MediaType;
3132
import org.springframework.scheduling.annotation.EnableScheduling;
32-
import springfox.documentation.builders.ApiInfoBuilder;
33-
import springfox.documentation.builders.RequestHandlerSelectors;
34-
import springfox.documentation.spi.DocumentationType;
35-
import springfox.documentation.spring.web.plugins.Docket;
36-
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
3733

3834
import java.util.Arrays;
3935

@@ -46,7 +42,6 @@
4642
*/
4743
@SpringBootApplication
4844
@EnableScheduling
49-
@EnableSwagger2WebMvc
5045
@MapperScan("com.jeequan.jeepay.service.mapper") //Mybatis mapper接口路径
5146
@ComponentScan(basePackages = "com.jeequan.jeepay.*") //由于MainApplication没有在项目根目录, 需要配置basePackages属性使得成功扫描所有Spring组件;
5247
@Configuration
@@ -83,13 +78,10 @@ public HttpMessageConverters fastJsonConfig(){
8378

8479
/** Mybatis plus 分页插件 **/
8580
@Bean
86-
public PaginationInterceptor paginationInterceptor() {
87-
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
88-
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
89-
// paginationInterceptor.setOverflow(false);
90-
// 设置最大单页限制数量,默认 500 条,-1 不受限制
91-
// paginationInterceptor.setLimit(500);
92-
return paginationInterceptor;
81+
public MybatisPlusInterceptor mybatisPlusInterceptor() {
82+
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
83+
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
84+
return interceptor;
9385
}
9486

9587

@@ -101,14 +93,14 @@ public PaginationInterceptor paginationInterceptor() {
10193
* @Author: terrfly
10294
* @Date: 2023/6/13 15:04
10395
*/
104-
@Bean(value = "knife4jDockerBean")
96+
/*@Bean(value = "knife4jDockerBean")
10597
public Docket knife4jDockerBean() {
10698
return new Docket(DocumentationType.SWAGGER_2) //指定使用Swagger2规范
10799
.apiInfo(new ApiInfoBuilder().version("1.0").build()) //描述字段支持Markdown语法
108100
.groupName("运营平台") //分组名称
109101
.select() // 配置: 如何扫描
110102
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) // 只扫描: ApiOperation 注解文档。 也支持配置包名、 路径等扫描模式。
111103
.build();
112-
}
104+
}*/
113105

114106
}

jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/config/RedisConfig.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@
3333
@Configuration
3434
public class RedisConfig {
3535

36-
@Value("${spring.redis.host}")
36+
@Value("${spring.data.redis.host}")
3737
private String host;
3838

39-
@Value("${spring.redis.port}")
39+
@Value("${spring.data.redis.port}")
4040
private Integer port;
4141

42-
@Value("${spring.redis.timeout}")
42+
@Value("${spring.data.redis.timeout}")
4343
private Integer timeout;
4444

4545
@Value("${spring.redis.database}")
4646
private Integer defaultDatabase;
4747

48-
@Value("${spring.redis.password}")
48+
@Value("${spring.data.redis.password}")
4949
private String password;
5050

5151
/** 当前系统的redis缓存操作对象 (主对象) **/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.jeequan.jeepay.mgr.config;
2+
3+
import io.swagger.v3.oas.models.OpenAPI;
4+
import io.swagger.v3.oas.models.info.Contact;
5+
import io.swagger.v3.oas.models.info.Info;
6+
import io.swagger.v3.oas.models.info.License;
7+
import org.springframework.context.annotation.Bean;
8+
import org.springframework.context.annotation.Configuration;
9+
10+
/**
11+
* @description:
12+
* @author: zx
13+
* @date: 2024/12/27 23:02
14+
*/
15+
@Configuration
16+
public class SwaggerConfig {
17+
18+
@Bean
19+
public OpenAPI customOpenAPI(){
20+
return new OpenAPI()
21+
.info(new Info() // 基本信息配置
22+
.title("Jeepay运营平台 Api接口文档") // 标题
23+
.version("1.0") // 版本
24+
// 设置OpenAPI文档的联系信息,包括联系人姓名为"patrick",邮箱为"[email protected]"。
25+
.contact(new Contact().name("jeequan"))
26+
// 设置OpenAPI文档的许可证信息,包括许可证名称为"Apache 2.0",许可证URL为"http://springdoc.org"。
27+
.license(new License().name("Apache 2.0").url("https://www.jeequan.com"))
28+
);
29+
}
30+
31+
}

jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/ctrl/CommonCtrl.java

-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import com.jeequan.jeepay.core.entity.MchInfo;
2121
import com.jeequan.jeepay.core.model.BaseModel;
2222
import com.jeequan.jeepay.core.model.security.JeeUserDetails;
23-
import com.jeequan.jeepay.mgr.config.SystemYmlConfig;
2423
import com.jeequan.jeepay.service.impl.MchInfoService;
2524
import org.apache.commons.lang3.StringUtils;
2625
import org.springframework.beans.factory.annotation.Autowired;
@@ -38,8 +37,6 @@
3837
*/
3938
public abstract class CommonCtrl extends AbstractCtrl {
4039

41-
@Autowired
42-
protected SystemYmlConfig mainConfig;
4340
@Autowired
4441
protected MchInfoService mchInfoService;
4542

jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/ctrl/common/StaticController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class StaticController extends CommonCtrl {
4343
@Autowired private OssYmlConfig ossYmlConfig;
4444

4545
/** 图片预览 **/
46-
@GetMapping("/api/anon/localOssFiles/**/*.*")
46+
@GetMapping("/api/anon/localOssFiles/*/*.*")
4747
public ResponseEntity<?> imgView() {
4848

4949
try {

jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/secruity/JeeAuthenticationEntryPoint.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
*/
1616
package com.jeequan.jeepay.mgr.secruity;
1717

18+
import jakarta.servlet.http.HttpServletRequest;
19+
import jakarta.servlet.http.HttpServletResponse;
1820
import org.springframework.security.core.AuthenticationException;
1921
import org.springframework.security.web.AuthenticationEntryPoint;
2022
import org.springframework.stereotype.Component;
2123

22-
import javax.servlet.http.HttpServletRequest;
23-
import javax.servlet.http.HttpServletResponse;
2424
import java.io.IOException;
2525
import java.io.Serializable;
2626

0 commit comments

Comments
 (0)