From 53db8b6c4caef2727a056f86885c8dbe74a89c04 Mon Sep 17 00:00:00 2001 From: wangbin Date: Mon, 30 Dec 2024 17:32:21 +0800 Subject: [PATCH] =?UTF-8?q?springboot=E5=8D=87=E7=BA=A7=E5=88=B02.7.x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- report-core/pom.xml | 55 ++++++++++--------- .../gaea/business/base/BaseController.java | 4 +- .../gaea/business/filter/UrlDecodeFilter.java | 5 +- .../service/impl/GaeaFileServiceImpl.java | 4 +- .../src/main/resources/bootstrap-dev.yml | 7 +-- report-core/src/main/resources/bootstrap.yml | 14 ++++- 6 files changed, 49 insertions(+), 40 deletions(-) diff --git a/report-core/pom.xml b/report-core/pom.xml index 142c2201..4bfbca37 100644 --- a/report-core/pom.xml +++ b/report-core/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 2.3.5.RELEASE + 2.7.14 @@ -14,7 +14,7 @@ com.anji-plus aj-report - 1.5.0.RELEASE + 1.6.0.RELEASE UTF-8 @@ -26,6 +26,16 @@ + + org.springframework.cloud + spring-cloud-starter-bootstrap + 3.1.5 + + + org.springframework.cloud + spring-cloud-context + 3.1.5 + org.springframework.boot spring-boot-starter-web @@ -38,18 +48,11 @@ - org.apache.logging.log4j - log4j-to-slf4j - 2.15.0 + log4j + log4j + 1.2.17 - - org.apache.logging.log4j - log4j-api - 2.15.0 - - - org.springframework.boot spring-boot-starter-cache @@ -66,12 +69,6 @@ spring-test - - org.springframework.cloud - spring-cloud-context - 2.2.6.RELEASE - - org.springframework.boot spring-boot-configuration-processor @@ -81,7 +78,7 @@ com.anji-plus spring-boot-gaea - 2.0.5.RELEASE + 2.9.4.RELEASE org.springframework.boot @@ -97,15 +94,22 @@ com.anji-plus spring-boot-starter-gaea-oss - 2.0.5.RELEASE + 2.9.4.RELEASE - com.baomidou mybatis-plus-boot-starter - 3.3.2 + 3.5.2 + + + org.springframework.boot + spring-boot-starter-aop + + + org.aspectj + aspectjweaver + 1.9.7 - mysql mysql-connector-java @@ -137,7 +141,7 @@ org.projectlombok lombok - 1.18.10 + 1.18.34 true @@ -185,7 +189,6 @@ xmlworker 5.5.13 - @@ -237,7 +240,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.3.0 + src/main/assembly/assembly.xml diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/base/BaseController.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/base/BaseController.java index 0052d6c5..7a49ada1 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/base/BaseController.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/base/BaseController.java @@ -1,10 +1,10 @@ package com.anjiplus.template.gaea.business.base; +import com.anji.plus.gaea.curd.entity.GaeaBaseEntity; import org.springframework.context.i18n.LocaleContextHolder; import com.anji.plus.gaea.curd.controller.GaeaBaseController; import com.anji.plus.gaea.curd.dto.BaseDTO; -import com.anji.plus.gaea.curd.entity.BaseEntity; import com.anji.plus.gaea.curd.params.PageParam; /** @@ -13,7 +13,7 @@ import com.anji.plus.gaea.curd.params.PageParam; * @author WongBin * @date 2021/3/26 */ -public abstract class BaseController

+public abstract class BaseController

extends GaeaBaseController { /** * 获取当前语言类型 diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/UrlDecodeFilter.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/UrlDecodeFilter.java index 0d79a3a0..9f59a895 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/UrlDecodeFilter.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/UrlDecodeFilter.java @@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import java.io.IOException; import java.net.URLDecoder; +import java.util.Collections; import java.util.Enumeration; import java.util.Map; import java.util.Set; @@ -63,10 +64,8 @@ public class UrlDecodeFilter implements Filter { @Override public Enumeration getParameterNames() { - Set keySet = parameterMap.keySet(); - IteratorEnumeration iteratorEnumeration = new IteratorEnumeration(keySet.iterator()); - return iteratorEnumeration; + return Collections.enumeration(keySet); } @Override diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/file/service/impl/GaeaFileServiceImpl.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/file/service/impl/GaeaFileServiceImpl.java index c6332e58..9674dfa8 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/file/service/impl/GaeaFileServiceImpl.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/file/service/impl/GaeaFileServiceImpl.java @@ -20,11 +20,9 @@ import org.apache.commons.lang3.StringUtils; import org.apache.http.entity.ContentType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.http.ResponseEntity; import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; @@ -41,7 +39,7 @@ import java.util.UUID; */ @Service @Slf4j -@RefreshScope +//@RefreshScope public class GaeaFileServiceImpl implements GaeaFileService { @Value("${spring.gaea.subscribes.oss.downloadPath:''}") diff --git a/report-core/src/main/resources/bootstrap-dev.yml b/report-core/src/main/resources/bootstrap-dev.yml index a3cb06f5..2a6f2fda 100644 --- a/report-core/src/main/resources/bootstrap-dev.yml +++ b/report-core/src/main/resources/bootstrap-dev.yml @@ -4,17 +4,14 @@ spring: url: jdbc:mysql://10.108.26.197:3306/aj_report?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false username: root password: appuser@anji + type: com.alibaba.druid.pool.DruidDataSource gaea: subscribes: oss: #文件存储 enabled: true ##允许上传的文件后缀 - file-type-while-list: .png|.jpg|.gif|.icon|.pdf|.xlsx|.xls|.csv|.mp4|.avi|.jpeg|.aaa|.svg + file-type-white-list: .png|.jpg|.gif|.icon|.pdf|.xlsx|.xls|.csv|.mp4|.avi|.jpeg|.aaa|.svg # 用于文件上传成功后,生成文件的下载公网完整URL downloadPath: http://127.0.0.1:9095/file/download nfs: path: D:\\aaa\\ - - - - diff --git a/report-core/src/main/resources/bootstrap.yml b/report-core/src/main/resources/bootstrap.yml index 99f7baab..a045678f 100644 --- a/report-core/src/main/resources/bootstrap.yml +++ b/report-core/src/main/resources/bootstrap.yml @@ -5,8 +5,20 @@ server: charset: UTF-8 force: true enabled: true +springfox: + documentation: + auto-startup: false spring: + cloud: + bootstrap: + enabled: true + main: + allow-bean-definition-overriding: true + allow-circular-references: true + mvc: + pathmatch: + matching-strategy: ant_path_matcher profiles: active: dev application: @@ -78,7 +90,7 @@ spring: oss: #文件存储 都配置的情况下优先级minio->amazonS3->nfs enabled: true ##允许上传的文件后缀 - file-type-while-list: .png|.jpg|.gif|.icon|.pdf|.xlsx|.xls|.csv|.mp4|.avi|.jpeg|.aaa|.svg + file-type-white-list: .png|.jpg|.gif|.icon|.pdf|.xlsx|.xls|.csv|.mp4|.avi|.jpeg|.aaa|.svg # 用于文件上传成功后,生成文件的下载公网完整URL,http://serverip:9095/file/download,注意填写IP必须填写后端服务所在的机器IP downloadPath: http://10.108.26.197:9095/file/download nfs: