给迷你服务去掉一些依赖,缩减打包大小

This commit is contained in:
thinkgem
2025-10-15 21:13:38 +08:00
parent 6a41db0efc
commit 9e33b5c894
7 changed files with 85 additions and 56 deletions

View File

@@ -4,16 +4,14 @@
*/ */
package com.jeesite.modules.config.interceptor; package com.jeesite.modules.config.interceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.jeesite.common.config.Global; import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils; import com.jeesite.common.lang.StringUtils;
import com.jeesite.modules.sys.interceptor.LogInterceptor; import com.jeesite.modules.sys.interceptor.LogInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
* 后台管理日志记录拦截器 * 后台管理日志记录拦截器
@@ -21,8 +19,7 @@ import com.jeesite.modules.sys.interceptor.LogInterceptor;
* @version 2018年1月10日 * @version 2018年1月10日
*/ */
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(name="web.interceptor.log.enabled", havingValue="true", matchIfMissing=true) @ConditionalOnProperty(name="web.interceptor.log.enabled", havingValue="true", matchIfMissing=false)
@EnableWebMvc
public class LogInterceptorConfig implements WebMvcConfigurer { public class LogInterceptorConfig implements WebMvcConfigurer {
@Override @Override

View File

@@ -22,7 +22,6 @@ import com.jeesite.modules.sys.interceptor.MobileInterceptor;
*/ */
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(name="web.interceptor.mobile.enabled", havingValue="true", matchIfMissing=false) @ConditionalOnProperty(name="web.interceptor.mobile.enabled", havingValue="true", matchIfMissing=false)
@EnableWebMvc
public class MobileViewInterceptorConfig implements WebMvcConfigurer { public class MobileViewInterceptorConfig implements WebMvcConfigurer {
@Override @Override

View File

@@ -28,7 +28,7 @@ import java.io.IOException;
* @version 2022-09-27 * @version 2022-09-27
*/ */
@Controller @Controller
@ConditionalOnProperty(name="file.isFileStreamDown", havingValue="true", matchIfMissing=true) @ConditionalOnProperty(name={"file.enabled","file.isFileStreamDown"}, havingValue="true", matchIfMissing=true)
@ApiIgnore @ApiIgnore
public class UserfilesController extends BaseController { public class UserfilesController extends BaseController {

View File

@@ -4,26 +4,24 @@
*/ */
package com.jeesite.modules.sys.web; package com.jeesite.modules.sys.web;
import javax.servlet.http.HttpServletRequest; import com.jeesite.common.web.BaseController;
import com.jeesite.common.web.http.ServletUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import com.jeesite.common.web.BaseController;
import com.jeesite.common.web.http.ServletUtils;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
/** /**
* 公共标签Controller * 公共标签Controller
* @author ThinkGem * @author ThinkGem
* @version 2017-5-7 * @version 2020-5-7
*/ */
@Controller @Controller
@RequestMapping(value = "tags") @RequestMapping(value = "tags")
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) @ConditionalOnProperty(name={"config.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
@ApiIgnore @ApiIgnore
public class TagsController extends BaseController { public class TagsController extends BaseController {

View File

@@ -198,6 +198,10 @@ page:
# 每页最大条数,防止分页过大导致系统缓慢或内存溢出 # 每页最大条数,防止分页过大导致系统缓慢或内存溢出
maxPageSize: 999 maxPageSize: 999
# 基础配置(参数、模块、字典)
config:
enabled: true
# 用户相关 # 用户相关
user: user:
enabled: true enabled: true

View File

@@ -43,7 +43,66 @@
<groupId>com.jeesite</groupId> <groupId>com.jeesite</groupId>
<artifactId>jeesite-framework</artifactId> <artifactId>jeesite-framework</artifactId>
<version>${project.parent.version}</version> <version>${project.parent.version}</version>
<exclusions>
<exclusion>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
</exclusion>
<exclusion>
<groupId>com.atomikos</groupId>
<artifactId>transactions-jdbc</artifactId>
</exclusion>
<exclusion>
<groupId>com.atomikos</groupId>
<artifactId>transactions-jta</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
</exclusion>
<exclusion>
<groupId>net.sf.jmimemagic</groupId>
<artifactId>jmimemagic</artifactId>
</exclusion>
<exclusion>
<groupId>net.coobird</groupId>
<artifactId>thumbnailator</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
</exclusion>
<exclusion>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
</exclusion>
<exclusion>
<groupId>com.bladejava</groupId>
<artifactId>blade-patchca</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId> <artifactId>spring-boot-starter-tomcat</artifactId>

View File

@@ -27,19 +27,9 @@ server:
servlet: servlet:
context-path: /js context-path: /js
register-default-servlet: false register-default-servlet: false
# encoding.enabled: true
tomcat: tomcat:
uri-encoding: UTF-8 uri-encoding: UTF-8
# 表单请求数据的最大大小
max-http-form-post-size: 20MB max-http-form-post-size: 20MB
# # 进程的最大连接数
# max-connections: 8192
# # 连接数满后的排队个数
# accept-count: 100
# # 线程数最大和最小个数
# threads:
# max: 200
# min-spare: 10
# 当 Nginx 为 httpstomcat 为 http 时,设置该选项为 true # 当 Nginx 为 httpstomcat 为 http 时,设置该选项为 true
schemeHttps: false schemeHttps: false
@@ -48,16 +38,13 @@ server:
#========== Database sttings ==========# #========== Database sttings ==========#
#======================================# #======================================#
# 数据库连接(默认关闭,如果和 web.core.enabled 同时开启可使用如下功能: # 数据库连接
# 配置参数http://127.0.0.1:8980/js/a/sys/config/list
# 模块管理http://127.0.0.1:8980/js/a/sys/module/list
# 字典管理http://127.0.0.1:8980/js/a/sys/dictType/list
jdbc: jdbc:
# # Mysql 数据库配置 # Mysql 数据库配置
# type: mysql # type: mysql
# driver: com.mysql.cj.jdbc.Driver # driver: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/jeesite_mini?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai # url: jdbc:mysql://127.0.0.1:3306/jeesite_v5?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai
# username: root # username: root
# password: 123456 # password: 123456
# testSql: SELECT 1 # testSql: SELECT 1
@@ -72,6 +59,10 @@ jdbc:
# 最大连接数 # 最大连接数
maxActive: 20 maxActive: 20
# JTA事务
jta:
enabled: false
#======================================# #======================================#
#========== Framework settings ========# #========== Framework settings ========#
#======================================# #======================================#
@@ -96,10 +87,6 @@ spring:
pathmatch: pathmatch:
matching-strategy: ANT_PATH_MATCHER matching-strategy: ANT_PATH_MATCHER
# JTA事务
jta:
enabled: false
# 缓存配置 # 缓存配置
cache: cache:
# 缓存及会话共享(专业版) # 缓存及会话共享(专业版)
@@ -126,7 +113,7 @@ adminPath: /a
# 前端基础路径 # 前端基础路径
frontPath: /f frontPath: /f
# 配置相关功能(参数、模块、字典) # 基础配置(参数、模块、字典)
config: config:
enabled: false enabled: false
@@ -151,29 +138,14 @@ gen:
state: state:
enabled: true enabled: true
# Web 相 # 核心功能 Controller 开
web: web:
# MVC拦截器访问日志和手机视图
interceptor:
log:
enabled: false
mobile:
enabled: false
# 核心模块的Web功能开启
core: core:
enabled: false enabled: false
# 在线API文档工具
swagger:
enabled: false
# 文件上传 # 文件上传
file: file:
enabled: false enabled: false
isFileStreamDown: false
# 消息提醒中心 # 消息提醒中心
msg: msg: