Compare commits

..

82 Commits

Author SHA1 Message Date
4caff75cce Merge pull request #5935 from EightMonth/springboot3_config
修正spring boot3默认配置
2024-03-01 16:24:33 +08:00
811861a957 添加nacos sql自动创建nacos库 2024-03-01 16:15:06 +08:00
24623ba4b0 梳理服务配置信息 2024-03-01 16:06:12 +08:00
7c68b46943 添加springboot3的配置变更 2024-03-01 16:04:57 +08:00
7c34161369 删除无用文件 2024-02-29 17:41:13 +08:00
bc52aa918d gateway的配置改坏了,导致命名空间等不好使 2024-02-29 17:30:04 +08:00
9dfdd47b36 springboot3版本的仪表盘依赖有问题,升级一个版本 2024-01-12 11:32:26 +08:00
272a7540eb 仪表盘升级为springboot3版本 2024-01-12 11:00:51 +08:00
ad796f079f flywaydb兼容springboot3报错,先注释掉 2024-01-12 11:00:37 +08:00
e7e7716d05 Merge pull request #5782 from EightMonth/springboot3
同步主干分支版本代码,并升级jedis至3.8.0
2024-01-12 10:39:24 +08:00
c5d620d2b2 升级jedis版本至3.8.0 2024-01-08 13:54:04 +08:00
cdea05ebb0 Merge branch 'master' into springboot3
# Conflicts:
#	jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
#	jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/entity/JeecgDemo.java
#	jeecg-module-system/jeecg-system-biz/pom.xml
#	jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysTableWhiteListController.java
#	jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/WechatVerifyController.java
#	jeecg-module-system/jeecg-system-start/pom.xml
#	jeecg-server-cloud/jeecg-visual/jeecg-cloud-sentinel/pom.xml
#	pom.xml
2024-01-08 13:52:33 +08:00
ca9a433f3c Merge pull request #5765 from hoperunChen/springboot3-fix-#5723
fix issue for springboot3 #5723: 指定jaxb-runtime版本,添加修改记录
2024-01-04 21:41:11 +08:00
2be6052cd4 Merge pull request #5766 from hoperunChen/springboot3-fix-#5742
fix issue for springboot3 #5742: 修改代码生成时的schema注解参数
2024-01-04 21:40:53 +08:00
68ed67ee49 shiro 无法使用 spring boot 3.X 自带的jedis,降版本处理 Merge pull request #5767 from hoperunChen/springboot3-fix-#5741
fix issue for springboot3 #5741: shiro 无法使用 spring boot 3.X 自带的jedis,降版本处理
2024-01-04 21:40:31 +08:00
d5903ba52a Merge remote-tracking branch 'upstream/springboot3' into springboot3-fix-#5741 2024-01-04 20:37:37 +08:00
3ee635eddf fix issue for springboot3 #5723: 指定jaxb-runtime版本,添加修改记录 2024-01-04 20:32:26 +08:00
21bc68fb53 fix issue for springboot3 #5741: shiro 无法使用 spring boot 3.X 自带的jedis,降版本处理 2024-01-04 20:19:46 +08:00
6fe8f1d81a 从3.6.2+版本增加flyway自动升级数据库机制 2024-01-04 14:56:06 +08:00
0bd7f715c4 默认删除人大金仓依赖,需要请自己放开 2024-01-04 13:57:23 +08:00
041d88161e 2024年首版本发布(antd4和仪表盘大升级) 2024-01-03 22:12:07 +08:00
79a62aa056 从3.6.2+版本增加flyway自动升级数据库机制 2024-01-03 22:07:27 +08:00
b86b4d9676 从3.6.2+版本增加flyway自动升级数据库机制 2024-01-03 22:01:07 +08:00
aeaac80012 2024年首版本发布(antd4和仪表盘大升级) 2024-01-03 19:46:35 +08:00
e0ef20cf08 3.6.2版本对应的数据库脚本 2024-01-03 18:58:30 +08:00
f532e57862 解决升级到springboot3, 表单excel导出失败,找不到 javax/servlet/ServletOutputStream #5738 2024-01-03 17:26:41 +08:00
169a66f5dd 升级新版本号3.6.2 2024-01-03 13:47:33 +08:00
7e39b31123 日志暂时不做权限控制 2024-01-03 13:44:36 +08:00
18765450a6 2024年首版本发布(仪表盘大升级) 2024-01-03 13:40:44 +08:00
dff8c84d9c 2024年首版本发布(仪表盘大升级) 2024-01-03 13:37:06 +08:00
d962c34846 新版数据库,有新升级sql和权限授权配置 2024-01-03 13:36:01 +08:00
da08adbea1 fix issue for springboot3 #5742: 修改代码生成时的schema注解参数 2024-01-02 13:41:54 +08:00
46e3e62b59 fix issue for springboot3 #5741: shiro 无法使用 spring boot 3.X 自带的jedis,降版本处理 2024-01-02 13:31:57 +08:00
cd9794d818 删除无用代码 2023-12-31 17:11:18 +08:00
5034b7cf18 提供新版仪表盘 2023-12-31 15:14:04 +08:00
fdde84c68a 代码生成器更新 2023-12-29 21:14:49 +08:00
4c54ff6f52 Merge branch 'master' of https://github.com/zhangdaiscott/jeecg-boot 2023-12-29 19:44:16 +08:00
de3285dc1b 通知公告 2023-12-29 19:43:12 +08:00
7f0c035c4c 企业微信集成改造 2023-12-29 19:42:36 +08:00
43593e8def 加权限注解 2023-12-29 19:42:24 +08:00
48b0b608d8 租户改造 2023-12-29 19:42:13 +08:00
69287a772b 小功能修改 2023-12-29 19:41:44 +08:00
3656264f8a 提供积木报表fastjson2版本 2023-12-28 22:34:23 +08:00
3361d48cd4 Merge branch 'springboot3' of https://github.com/zhangdaiscott/jeecg-boot into springboot3 2023-12-28 11:03:26 +08:00
ed86ea3da1 默认不需要nosql支持包 2023-12-28 11:03:10 +08:00
3deb0e5487 Merge pull request #5730 from EightMonth/springboot3
修改自动生成接口文档范围
2023-12-28 10:49:10 +08:00
9e4792941e 修改自动秣接口文档范围 2023-12-28 10:43:58 +08:00
b5fd5fe782 Merge pull request #5716 from EightMonth/springboot3
升级fastjson至2.0.43,替换tomcat为undertow
2023-12-26 17:21:30 +08:00
33c0104a02 增加undertow配置到test\prod 环境 2023-12-26 17:11:54 +08:00
81ed5100af 补充注释 2023-12-26 16:42:24 +08:00
87f9dc0064 去除无意义内容 2023-12-26 15:17:50 +08:00
b311fedc6b 升级fastjson至2.0.43,替换tomcat为undertow 2023-12-26 15:03:35 +08:00
cfeb81ee1e Merge branch 'master' of https://github.com/zhangdaiscott/jeecg-boot.git 2023-12-26 14:08:37 +08:00
09f92f01aa 提交online新依赖(解决online接口安全漏洞问题) 2023-12-26 14:08:20 +08:00
e321a0405f 升级aliyun.oss和minio的依赖 2023-12-26 10:01:57 +08:00
d8bc74794d 仪表盘也支持springboot3 2023-12-21 15:31:12 +08:00
732f05dc74 提供springboot3版本的online依赖支持 2023-12-21 14:57:14 +08:00
6ce92798c6 Merge pull request #5704 from EightMonth/springboot3
升级jeecg 3.6.1版本
2023-12-21 11:46:59 +08:00
f4454e9348 Merge branch 'springboot3' into springboot3 2023-12-21 09:52:14 +08:00
d9134ae0c8 Update WechatVerifyController.java 2023-12-21 09:46:52 +08:00
25180e41c8 更新minidao支持springboot3版本 2023-12-21 09:29:16 +08:00
a99e3f2268 更新积木报表支持springboot3版本 2023-12-21 09:28:00 +08:00
d27c354bf1 修改错误的配置 2023-12-21 09:26:40 +08:00
d818b1dd9d 更新jeecg-boot-starter3依赖 2023-12-21 09:26:39 +08:00
bcdbec0091 更新jeecg-boot-starter3依赖 2023-12-21 09:26:39 +08:00
098bb12b9e 更改jeecg-boot-starter3依赖 2023-12-21 09:26:39 +08:00
4a6c750b19 为注释内容添加注释原因 2023-12-21 09:26:39 +08:00
d396e5304a Update pom.xml 2023-12-21 09:26:38 +08:00
9bed25be8c spring3 2023-12-21 09:26:30 +08:00
7109b42092 Merge pull request #5698 from EightMonth/springboot3
更新积木报表、Minidao支持Springboot3版本
2023-12-20 10:10:51 +08:00
1667b14194 更新minidao支持springboot3版本 2023-12-20 10:00:14 +08:00
e9514873d2 更新积木报表支持springboot3版本 2023-12-19 14:31:17 +08:00
0ee090664e 修改错误的配置 2023-11-13 20:03:53 +08:00
4a9eda4ab0 Merge pull request #5567 from EightMonth/spring3
更新jeecg-boot-starter3依赖
2023-11-13 18:45:02 +08:00
2416c8b251 更新jeecg-boot-starter3依赖 2023-11-13 16:19:22 +08:00
5b056f9dd6 更新jeecg-boot-starter3依赖 2023-11-13 16:12:46 +08:00
a93998dc56 Merge pull request #5566 from EightMonth/spring3
更改jeecg-boot-starter3依赖
2023-11-13 15:43:21 +08:00
268c27a782 更改jeecg-boot-starter3依赖 2023-11-13 15:34:25 +08:00
23ace2712a Merge pull request #5563 from EightMonth/spring3
Spring Boot3 & JDK 17
2023-11-13 09:49:04 +08:00
157feeb925 为注释内容添加注释原因 2023-11-06 14:16:02 +08:00
4e25d4162f Update pom.xml 2023-11-06 14:11:23 +08:00
47a68f31e1 spring3 2023-11-06 12:41:57 +08:00
335 changed files with 7912 additions and 5698 deletions

4
.gitignore vendored
View File

@ -9,4 +9,6 @@ rebel.xml
## front ## front
**/*.lock **/*.lock
os_del.cmd os_del.cmd
os_del_doc.cmd
.svn

View File

@ -7,13 +7,13 @@
JEECG BOOT Low Code Development Platform JEECG BOOT Low Code Development Platform
=============== ===============
当前最新版本: 3.6.1发布日期2023-12-11 当前最新版本: 3.6.2发布日期2024-01-08
[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE) [![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)
[![](https://img.shields.io/badge/Author-guojusoft-orange.svg)](http://www.jeecg.com) [![](https://img.shields.io/badge/Author-guojusoft-orange.svg)](http://www.jeecg.com)
[![](https://img.shields.io/badge/Blog-blog-blue.svg)](https://jeecg.blog.csdn.net) [![](https://img.shields.io/badge/Blog-blog-blue.svg)](https://jeecg.blog.csdn.net)
[![](https://img.shields.io/badge/version-3.6.1-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot) [![](https://img.shields.io/badge/version-3.6.2-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot)
[![GitHub stars](https://img.shields.io/github/stars/zhangdaiscott/jeecg-boot.svg?style=social&label=Stars)](https://github.com/zhangdaiscott/jeecg-boot) [![GitHub stars](https://img.shields.io/github/stars/zhangdaiscott/jeecg-boot.svg?style=social&label=Stars)](https://github.com/zhangdaiscott/jeecg-boot)
[![GitHub forks](https://img.shields.io/github/forks/zhangdaiscott/jeecg-boot.svg?style=social&label=Fork)](https://github.com/zhangdaiscott/jeecg-boot) [![GitHub forks](https://img.shields.io/github/forks/zhangdaiscott/jeecg-boot.svg?style=social&label=Fork)](https://github.com/zhangdaiscott/jeecg-boot)

View File

@ -7,13 +7,13 @@
JEECG BOOT 低代码开发平台 JEECG BOOT 低代码开发平台
=============== ===============
当前最新版本: 3.6.1发布日期2023-12-11 当前最新版本: 3.6.2发布日期2024-01-08
[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE) [![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)
[![](https://img.shields.io/badge/Author-北京国炬软件-orange.svg)](http://jeecg.com/aboutusIndex) [![](https://img.shields.io/badge/Author-北京国炬软件-orange.svg)](http://jeecg.com/aboutusIndex)
[![](https://img.shields.io/badge/Blog-官方博客-blue.svg)](https://jeecg.blog.csdn.net) [![](https://img.shields.io/badge/Blog-官方博客-blue.svg)](https://jeecg.blog.csdn.net)
[![](https://img.shields.io/badge/version-3.6.1-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot) [![](https://img.shields.io/badge/version-3.6.2-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot)
[![GitHub stars](https://img.shields.io/github/stars/zhangdaiscott/jeecg-boot.svg?style=social&label=Stars)](https://github.com/zhangdaiscott/jeecg-boot) [![GitHub stars](https://img.shields.io/github/stars/zhangdaiscott/jeecg-boot.svg?style=social&label=Stars)](https://github.com/zhangdaiscott/jeecg-boot)
[![GitHub forks](https://img.shields.io/github/forks/zhangdaiscott/jeecg-boot.svg?style=social&label=Fork)](https://github.com/zhangdaiscott/jeecg-boot) [![GitHub forks](https://img.shields.io/github/forks/zhangdaiscott/jeecg-boot.svg?style=social&label=Fork)](https://github.com/zhangdaiscott/jeecg-boot)
@ -83,7 +83,7 @@ Docker快速启动项目
----------------------------------- -----------------------------------
- 项目官网: [http://www.jeecg.com](http://www.jeecg.com) - 项目官网: [http://www.jeecg.com](http://www.jeecg.com)
- 开发文档: [http://help.jeecg.com](http://help.jeecg.com) - 开发文档: [https://help.jeecg.com](https://help.jeecg.com)
- 新手指南: [快速入门](http://www.jeecg.com/doc/quickstart) | [常见问题 ](http://www.jeecg.com/doc/qa) | [视频教程](https://space.bilibili.com/454617261/channel/series) | [1分钟低代码体验](https://my.oschina.net/jeecg/blog/3083313) - 新手指南: [快速入门](http://www.jeecg.com/doc/quickstart) | [常见问题 ](http://www.jeecg.com/doc/qa) | [视频教程](https://space.bilibili.com/454617261/channel/series) | [1分钟低代码体验](https://my.oschina.net/jeecg/blog/3083313)
- 在线演示 [Vue3演示](http://boot3.jeecg.com) | [APP演示](http://jeecg.com/appIndex) | [敲敲云零代码](https://qiaoqiaoyun.com) - 在线演示 [Vue3演示](http://boot3.jeecg.com) | [APP演示](http://jeecg.com/appIndex) | [敲敲云零代码](https://qiaoqiaoyun.com)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,11 +0,0 @@
-- 新增风格一对多内嵌和Tab风格
INSERT INTO sys_permission (id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('1691031996d5931315212', '1455100420297859074', 'AUTO在线一对多内嵌', '/online/cgformInnerTableList/:id', 'super/online/cgform/auto/innerTable/OnlCgformInnerTableList', 1, '', NULL, 1, NULL, '0', 1.00, 0, NULL, 1, 0, 1, 0, NULL, 'admin', '2023-08-14 18:20:20', 'admin', '2023-08-14 18:46:18', 0, 0, NULL, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('1691031996d5931315213', '1455100420297859074', 'AUTO在线Tab风格', '/online/cgformTabList/:id', 'super/online/cgform/auto/tab/OnlCgformTabList', 1, '', NULL, 1, NULL, '0', 1.00, 0, NULL, 1, 0, 1, 0, NULL, 'admin', '2023-08-14 18:20:20', 'admin', '2023-08-14 18:46:18', 0, 0, NULL, 0);
-- 安全online敏感接口加权限注解sql解析接口同步数据库接口导入表接口
INSERT INTO sys_permission (id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) VALUES ('1699374704168534017', '1460888189937176577', 'SQL解析', NULL, NULL, 0, NULL, NULL, 2, 'online:report:parseSql', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-09-06 18:51:17', NULL, NULL, 0, 0, '1', 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) VALUES ('1699374509749960705', '1455101470794850305', '查询数据库表名', NULL, NULL, 0, NULL, NULL, 2, 'online:form:queryTables', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-09-06 18:50:31', NULL, NULL, 0, 0, '1', 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) VALUES ('1699374269152100354', '1455101470794850305', '同步数据库', NULL, NULL, 0, NULL, NULL, 2, 'online:form:syncDb', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-09-06 18:49:33', NULL, NULL, 0, 0, '1', 0);
update sys_permission set is_leaf=0 where id in ('1460888189937176577','1455101470794850305');

View File

@ -1,11 +0,0 @@
版本升级方法?
JeecgBoot属于平台级产品每次升级改动内容较多目前做不到平滑升级。
升级方案建议:
1.代码升级 => 本地版本通过svn或者git做好主干在分支上做业务开发jeecg每次版本发布可以手工覆盖主干的代码对比合并代码
2.数据库升级 => 针对数据库我们每次发布会提供增量升级SQL可以通过执行增量SQL实现数据库的升级。
3.兼容问题 => 每次版本发布会针对不兼容地方标注说明,需要手工修改不兼容的代码。
注意: 升级sql目前只提供mysql版本执行完脚步后新菜单需要手工进行角色授权刷新首页才会出现。
【20230820 放开了系统管理等模块权限注解,如果没权限请通过角色授权授权对应的按钮权限】

15
db/版本升级说明.md Normal file
View File

@ -0,0 +1,15 @@
# 版本升级方法
> JeecgBoot属于平台级产品每次升级改动较大目前做不到平滑升级。
### 增量升级方案
#### 1.代码合并
本地通过svn或git做好主干在分支上做业务开发jeecg每次版本发布可以手工覆盖主干的代码对比合并代码
#### 2.数据库升级
- 从3.6.2+版本增加flyway自动升级数据库机制支持 mysql5.7、mysql8;
- 其他库请手工执行SQL, 目录: `jeecg-module-system\jeecg-system-start\src\main\resources\flyway\sql\mysql`
> 注意: 升级sql只提供mysql版本如果有权限升级, 还需要手工角色授权,退出重新登录才好使。
#### 3.兼容问题
每次发版,会针对不兼容地方重点说明。

View File

@ -4,11 +4,15 @@
<parent> <parent>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-parent</artifactId> <artifactId>jeecg-boot-parent</artifactId>
<version>3.6.1</version> <version>3.6.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>jeecg-boot-base-core</artifactId> <artifactId>jeecg-boot-base-core</artifactId>
<properties>
<spring-boot.version>3.1.5</spring-boot.version>
</properties>
<repositories> <repositories>
<repository> <repository>
<id>aliyun</id> <id>aliyun</id>
@ -43,12 +47,22 @@
<!--jeecg-tools--> <!--jeecg-tools-->
<dependency> <dependency>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-common</artifactId> <artifactId>jeecg-boot-common3</artifactId>
</dependency> </dependency>
<!--集成springmvc框架并实现自动配置 --> <!--集成springmvc框架并实现自动配置 -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency> </dependency>
<!-- websocket --> <!-- websocket -->
<dependency> <dependency>
@ -105,14 +119,14 @@
<!-- druid --> <!-- druid -->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId> <artifactId>druid-spring-boot-3-starter</artifactId>
<version>${druid.version}</version> <version>${druid.version}</version>
</dependency> </dependency>
<!-- 动态数据源 --> <!-- 动态数据源 -->
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId> <artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
<version>${dynamic-datasource-spring-boot-starter.version}</version> <version>${dynamic-datasource-spring-boot-starter.version}</version>
</dependency> </dependency>
@ -164,6 +178,12 @@
<groupId>org.apache.shiro</groupId> <groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring-boot-starter</artifactId> <artifactId>shiro-spring-boot-starter</artifactId>
<version>${shiro.version}</version> <version>${shiro.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- shiro-redis --> <!-- shiro-redis -->
<dependency> <dependency>
@ -179,13 +199,61 @@
<artifactId>checkstyle</artifactId> <artifactId>checkstyle</artifactId>
<groupId>com.puppycrawl.tools</groupId> <groupId>com.puppycrawl.tools</groupId>
</exclusion> </exclusion>
<!-- TODO shiro 无法使用 spring boot 3.X 自带的jedis降版本处理 -->
<exclusion>
<artifactId>jedis</artifactId>
<groupId>redis.clients</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- TODO shiro 无法使用 spring boot 3.X 自带的jedis降版本处理 -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>${jedis.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<classifier>jakarta</classifier>
<version>${shiro.version}</version>
<!-- 排除仍使用了javax.servlet的依赖 -->
<exclusions>
<exclusion>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 引入适配jakarta的依赖包 -->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<classifier>jakarta</classifier>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<classifier>jakarta</classifier>
<version>${shiro.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- knife4j --> <!-- knife4j -->
<dependency> <dependency>
<groupId>com.github.xiaoymin</groupId> <groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId> <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
<version>${knife4j-spring-boot-starter.version}</version> <version>${knife4j-spring-boot-starter.version}</version>
</dependency> </dependency>
@ -199,7 +267,7 @@
<!-- AutoPoi Excel工具类--> <!-- AutoPoi Excel工具类-->
<dependency> <dependency>
<groupId>org.jeecgframework</groupId> <groupId>org.jeecgframework.boot3</groupId>
<artifactId>autopoi-web</artifactId> <artifactId>autopoi-web</artifactId>
<version>${autopoi-web.version}</version> <version>${autopoi-web.version}</version>
<exclusions> <exclusions>
@ -242,6 +310,16 @@
<dependency> <dependency>
<groupId>com.xkcoding.justauth</groupId> <groupId>com.xkcoding.justauth</groupId>
<artifactId>justauth-spring-boot-starter</artifactId> <artifactId>justauth-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.squareup.okhttp3</groupId> <groupId>com.squareup.okhttp3</groupId>

View File

@ -117,14 +117,17 @@ public interface CommonAPI {
*/ */
Map<String, List<DictModel>> translateManyDict(String dictCodes, String keys); Map<String, List<DictModel>> translateManyDict(String dictCodes, String keys);
//update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
/** /**
* 15 字典表的 翻译,可批量 * 15 字典表的 翻译,可批量
* @param table * @param table
* @param text * @param text
* @param code * @param code
* @param keys 多个用逗号分割 * @param keys 多个用逗号分割
* @param dataSource 数据源
* @return * @return
*/ */
List<DictModel> translateDictFromTableByKeys(String table, String text, String code, String keys); List<DictModel> translateDictFromTableByKeys(String table, String text, String code, String keys, String dataSource);
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
} }

View File

@ -2,7 +2,7 @@ package org.jeecg.common.api.dto;
import lombok.Data; import lombok.Data;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.Serializable; import java.io.Serializable;
/** /**

View File

@ -1,8 +1,7 @@
package org.jeecg.common.api.vo; package org.jeecg.common.api.vo;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;
@ -15,7 +14,7 @@ import java.io.Serializable;
* @date 2019年1月19日 * @date 2019年1月19日
*/ */
@Data @Data
@ApiModel(value="接口返回对象", description="接口返回对象") @Schema(description="接口返回对象")
public class Result<T> implements Serializable { public class Result<T> implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -23,31 +22,31 @@ public class Result<T> implements Serializable {
/** /**
* 成功标志 * 成功标志
*/ */
@ApiModelProperty(value = "成功标志") @Schema(description = "成功标志")
private boolean success = true; private boolean success = true;
/** /**
* 返回处理消息 * 返回处理消息
*/ */
@ApiModelProperty(value = "返回处理消息") @Schema(description = "返回处理消息")
private String message = ""; private String message = "";
/** /**
* 返回代码 * 返回代码
*/ */
@ApiModelProperty(value = "返回代码") @Schema(description = "返回代码")
private Integer code = 0; private Integer code = 0;
/** /**
* 返回数据对象 data * 返回数据对象 data
*/ */
@ApiModelProperty(value = "返回数据对象") @Schema(description = "返回数据对象")
private T result; private T result;
/** /**
* 时间戳 * 时间戳
*/ */
@ApiModelProperty(value = "时间戳") @Schema(description = "时间戳")
private long timestamp = System.currentTimeMillis(); private long timestamp = System.currentTimeMillis();
public Result() { public Result() {

View File

@ -24,10 +24,10 @@ import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import javax.servlet.ServletRequest; import jakarta.servlet.ServletRequest;
import javax.servlet.ServletResponse; import jakarta.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Date; import java.util.Date;

View File

@ -140,11 +140,15 @@ public class DictAspect {
String code = field.getAnnotation(Dict.class).dicCode(); String code = field.getAnnotation(Dict.class).dicCode();
String text = field.getAnnotation(Dict.class).dicText(); String text = field.getAnnotation(Dict.class).dicText();
String table = field.getAnnotation(Dict.class).dictTable(); String table = field.getAnnotation(Dict.class).dictTable();
//update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
String dataSource = field.getAnnotation(Dict.class).ds();
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
List<String> dataList; List<String> dataList;
String dictCode = code; String dictCode = code;
if (!StringUtils.isEmpty(table)) { if (!StringUtils.isEmpty(table)) {
dictCode = String.format("%s,%s,%s", table, text, code); //update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
dictCode = String.format("%s,%s,%s,%s", table, text, code, dataSource);
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
} }
dataList = dataListMap.computeIfAbsent(dictCode, k -> new ArrayList<>()); dataList = dataListMap.computeIfAbsent(dictCode, k -> new ArrayList<>());
this.listAddAllDeduplicate(dataList, Arrays.asList(value.split(","))); this.listAddAllDeduplicate(dataList, Arrays.asList(value.split(",")));
@ -169,10 +173,15 @@ public class DictAspect {
String code = field.getAnnotation(Dict.class).dicCode(); String code = field.getAnnotation(Dict.class).dicCode();
String text = field.getAnnotation(Dict.class).dicText(); String text = field.getAnnotation(Dict.class).dicText();
String table = field.getAnnotation(Dict.class).dictTable(); String table = field.getAnnotation(Dict.class).dictTable();
//update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
// 自定义的字典表数据源
String dataSource = field.getAnnotation(Dict.class).ds();
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
String fieldDictCode = code; String fieldDictCode = code;
if (!StringUtils.isEmpty(table)) { if (!StringUtils.isEmpty(table)) {
fieldDictCode = String.format("%s,%s,%s", table, text, code); //update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
fieldDictCode = String.format("%s,%s,%s,%s", table, text, code, dataSource);
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
} }
String value = record.getString(field.getName()); String value = record.getString(field.getName());
@ -274,9 +283,18 @@ public class DictAspect {
String[] arr = dictCode.split(","); String[] arr = dictCode.split(",");
String table = arr[0], text = arr[1], code = arr[2]; String table = arr[0], text = arr[1], code = arr[2];
String values = String.join(",", needTranslDataTable); String values = String.join(",", needTranslDataTable);
//update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
// 自定义的数据源
String dataSource = null;
if (arr.length > 3) {
dataSource = arr[3];
}
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
log.debug("translateDictFromTableByKeys.dictCode:" + dictCode); log.debug("translateDictFromTableByKeys.dictCode:" + dictCode);
log.debug("translateDictFromTableByKeys.values:" + values); log.debug("translateDictFromTableByKeys.values:" + values);
List<DictModel> texts = commonApi.translateDictFromTableByKeys(table, text, code, values); //update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
List<DictModel> texts = commonApi.translateDictFromTableByKeys(table, text, code, values, dataSource);
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
log.debug("translateDictFromTableByKeys.result:" + texts); log.debug("translateDictFromTableByKeys.result:" + texts);
List<DictModel> list = translText.computeIfAbsent(dictCode, k -> new ArrayList<>()); List<DictModel> list = translText.computeIfAbsent(dictCode, k -> new ArrayList<>());
list.addAll(texts); list.addAll(texts);

View File

@ -21,7 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.List; import java.util.List;

View File

@ -39,4 +39,16 @@ public @interface Dict {
* @return 返回类型: String * @return 返回类型: String
*/ */
String dictTable() default ""; String dictTable() default "";
//update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
/**
* 方法描述: 数据字典表所在数据源名称
* 作 者: chenrui
* 日 期: 2023年12月20日-下午4:58
*
* @return 返回类型: String
*/
String ds() default "";
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
} }

View File

@ -69,6 +69,8 @@ public interface CommonConstant {
/** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */ /** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
Integer SC_INTERNAL_SERVER_ERROR_500 = 500; Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
/** {@code 404 Not Found} (HTTP/1.0 - RFC 1945) */
Integer SC_INTERNAL_NOT_FOUND_404 = 404;
/** {@code 200 OK} (HTTP/1.0 - RFC 1945) */ /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
Integer SC_OK_200 = 200; Integer SC_OK_200 = 200;

View File

@ -17,6 +17,9 @@ public interface DataBaseConstant {
/**postgreSQL达梦数据库*/ /**postgreSQL达梦数据库*/
public static final String DB_TYPE_POSTGRESQL = "POSTGRESQL"; public static final String DB_TYPE_POSTGRESQL = "POSTGRESQL";
/**人大金仓数据库*/
public static final String DB_TYPE_KINGBASEES = "KINGBASEES";
/**sqlserver数据库*/ /**sqlserver数据库*/
public static final String DB_TYPE_SQLSERVER = "SQLSERVER"; public static final String DB_TYPE_SQLSERVER = "SQLSERVER";

View File

@ -1,5 +1,7 @@
package org.jeecg.common.exception; package org.jeecg.common.exception;
import org.jeecg.common.constant.CommonConstant;
/** /**
* @Description: jeecg-boot自定义异常 * @Description: jeecg-boot自定义异常
* @author: jeecg-boot * @author: jeecg-boot
@ -7,10 +9,24 @@ package org.jeecg.common.exception;
public class JeecgBootException extends RuntimeException { public class JeecgBootException extends RuntimeException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 返回给前端的错误code
*/
private int errCode = CommonConstant.SC_INTERNAL_SERVER_ERROR_500;
public JeecgBootException(String message){ public JeecgBootException(String message){
super(message); super(message);
} }
public JeecgBootException(String message, int errCode){
super(message);
this.errCode = errCode;
}
public int getErrCode() {
return errCode;
}
public JeecgBootException(Throwable cause) public JeecgBootException(Throwable cause)
{ {
super(cause); super(cause);

View File

@ -33,7 +33,7 @@ public class JeecgBootExceptionHandler {
@ExceptionHandler(JeecgBootException.class) @ExceptionHandler(JeecgBootException.class)
public Result<?> handleJeecgBootException(JeecgBootException e){ public Result<?> handleJeecgBootException(JeecgBootException e){
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return Result.error(e.getMessage()); return Result.error(e.getErrCode(), e.getMessage());
} }
/** /**

View File

@ -23,9 +23,9 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;

View File

@ -9,10 +9,10 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
/** /**
* @Description: Entity基类 * @Description: Entity基类
@ -30,20 +30,20 @@ public class JeecgEntity implements Serializable {
* ID * ID
*/ */
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID") @Schema(description = "ID")
private java.lang.String id; private java.lang.String id;
/** /**
* 创建人 * 创建人
*/ */
@ApiModelProperty(value = "创建人") @Schema(description = "创建人")
@Excel(name = "创建人", width = 15) @Excel(name = "创建人", width = 15)
private java.lang.String createBy; private java.lang.String createBy;
/** /**
* 创建时间 * 创建时间
*/ */
@ApiModelProperty(value = "创建时间") @Schema(description = "创建时间")
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ -52,14 +52,14 @@ public class JeecgEntity implements Serializable {
/** /**
* 更新人 * 更新人
*/ */
@ApiModelProperty(value = "更新人") @Schema(description = "更新人")
@Excel(name = "更新人", width = 15) @Excel(name = "更新人", width = 15)
private java.lang.String updateBy; private java.lang.String updateBy;
/** /**
* 更新时间 * 更新时间
*/ */
@ApiModelProperty(value = "更新时间") @Schema(description = "更新时间")
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

View File

@ -5,7 +5,7 @@ import org.jeecg.common.system.vo.SysUserCacheInfo;
import org.jeecg.common.util.SpringContextUtils; import org.jeecg.common.util.SpringContextUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -11,10 +11,10 @@ import com.google.common.base.Joiner;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.Date; import java.util.Date;
import javax.servlet.ServletResponse; import jakarta.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import jakarta.servlet.http.HttpSession;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;

View File

@ -5,7 +5,7 @@ import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
/** /**
* *

View File

@ -19,7 +19,7 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.util.FileCopyUtils; import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.File; import java.io.File;
@ -302,7 +302,7 @@ public class CommonUtils {
DB_TYPE = DataBaseConstant.DB_TYPE_ORACLE; DB_TYPE = DataBaseConstant.DB_TYPE_ORACLE;
}else if(dbType.indexOf(DataBaseConstant.DB_TYPE_SQLSERVER)>=0||dbType.indexOf(sqlserver)>=0) { }else if(dbType.indexOf(DataBaseConstant.DB_TYPE_SQLSERVER)>=0||dbType.indexOf(sqlserver)>=0) {
DB_TYPE = DataBaseConstant.DB_TYPE_SQLSERVER; DB_TYPE = DataBaseConstant.DB_TYPE_SQLSERVER;
}else if(dbType.indexOf(DataBaseConstant.DB_TYPE_POSTGRESQL)>=0) { }else if(dbType.indexOf(DataBaseConstant.DB_TYPE_POSTGRESQL)>=0 || dbType.indexOf(DataBaseConstant.DB_TYPE_KINGBASEES)>=0) {
DB_TYPE = DataBaseConstant.DB_TYPE_POSTGRESQL; DB_TYPE = DataBaseConstant.DB_TYPE_POSTGRESQL;
}else if(dbType.indexOf(DataBaseConstant.DB_TYPE_MARIADB)>=0) { }else if(dbType.indexOf(DataBaseConstant.DB_TYPE_MARIADB)>=0) {
DB_TYPE = DataBaseConstant.DB_TYPE_MARIADB; DB_TYPE = DataBaseConstant.DB_TYPE_MARIADB;

View File

@ -1,6 +1,6 @@
package org.jeecg.common.util; package org.jeecg.common.util;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;

View File

@ -1,7 +1,7 @@
package org.jeecg.common.util; package org.jeecg.common.util;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.ServiceNameConstants; import org.jeecg.common.constant.ServiceNameConstants;

View File

@ -29,6 +29,17 @@ public class SqlInjectionUtil {
* 字典专用—sql注入关键词 * 字典专用—sql注入关键词
*/ */
private static String specialDictSqlXssStr = "exec |peformance_schema|information_schema|extractvalue|updatexml|geohash|gtid_subset|gtid_subtract|insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|+|--"; private static String specialDictSqlXssStr = "exec |peformance_schema|information_schema|extractvalue|updatexml|geohash|gtid_subset|gtid_subtract|insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|+|--";
/**
* 完整匹配的key不需要考虑前空格
*/
private static List<String> FULL_MATCHING_KEYWRODS = new ArrayList<>();
static {
FULL_MATCHING_KEYWRODS.add(";");
FULL_MATCHING_KEYWRODS.add("+");
FULL_MATCHING_KEYWRODS.add("--");
}
/** /**
* sql注入风险的 正则关键字 * sql注入风险的 正则关键字
* *
@ -50,6 +61,8 @@ public class SqlInjectionUtil {
* sql注释的正则 * sql注释的正则
*/ */
private final static Pattern SQL_ANNOTATION = Pattern.compile("/\\*[\\s\\S]*\\*/"); private final static Pattern SQL_ANNOTATION = Pattern.compile("/\\*[\\s\\S]*\\*/");
private final static String SQL_ANNOTATION2 = "--";
/** /**
* sql注入提示语 * sql注入提示语
*/ */
@ -128,7 +141,13 @@ public class SqlInjectionUtil {
if (sql.startsWith(keyword.trim())) { if (sql.startsWith(keyword.trim())) {
return true; return true;
} else if (sql.contains(keyword)) { } else if (sql.contains(keyword)) {
if (sql.contains(" " + keyword)) { // 需要匹配的sql注入关键词
String matchingText = " " + keyword;
if(FULL_MATCHING_KEYWRODS.contains(keyword)){
matchingText = keyword;
}
if (sql.contains(matchingText)) {
return true; return true;
} else { } else {
String regularStr = "\\s+\\S+" + keyword; String regularStr = "\\s+\\S+" + keyword;
@ -244,6 +263,13 @@ public class SqlInjectionUtil {
* @return * @return
*/ */
public static void checkSqlAnnotation(String str){ public static void checkSqlAnnotation(String str){
if(str.contains(SQL_ANNOTATION2)){
String error = "请注意SQL中不允许含注释有安全风险";
log.error(error);
throw new RuntimeException(error);
}
Matcher matcher = SQL_ANNOTATION.matcher(str); Matcher matcher = SQL_ANNOTATION.matcher(str);
if(matcher.find()){ if(matcher.find()){
String error = "请注意值可能存在SQL注入风险---> \\*.*\\"; String error = "请注意值可能存在SQL注入风险---> \\*.*\\";
@ -260,7 +286,7 @@ public class SqlInjectionUtil {
* *
* @param table * @param table
*/ */
private static Pattern tableNamePattern = Pattern.compile("^[a-zA-Z][a-zA-Z0-9_]{0,63}$"); private static Pattern tableNamePattern = Pattern.compile("^[a-zA-Z][a-zA-Z0-9_\\$]{0,63}$");
public static String getSqlInjectTableName(String table) { public static String getSqlInjectTableName(String table) {
if(oConvertUtils.isEmpty(table)){ if(oConvertUtils.isEmpty(table)){
return table; return table;

View File

@ -11,7 +11,7 @@ import org.jeecg.common.exception.JeecgBoot401Exception;
import org.jeecg.common.system.util.JwtUtil; import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
/** /**
* @Author scott * @Author scott

View File

@ -61,6 +61,10 @@ public class SsrfFileTypeFilter {
FILE_TYPE_WHITE_LIST.add("7z"); FILE_TYPE_WHITE_LIST.add("7z");
FILE_TYPE_WHITE_LIST.add("tar"); FILE_TYPE_WHITE_LIST.add("tar");
//app文件后缀
FILE_TYPE_WHITE_LIST.add("apk");
FILE_TYPE_WHITE_LIST.add("wgt");
//设置禁止文件的头部标记 //设置禁止文件的头部标记
FILE_TYPE_MAP.put("3c25402070616765206c", "jsp"); FILE_TYPE_MAP.put("3c25402070616765206c", "jsp");
FILE_TYPE_MAP.put("3c3f7068700a0a2f2a2a0a202a205048", "php"); FILE_TYPE_MAP.put("3c3f7068700a0a2f2a2a0a202a205048", "php");

View File

@ -7,7 +7,7 @@ import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.SymbolConstant; import org.jeecg.common.constant.SymbolConstant;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
@ -413,7 +413,7 @@ public class oConvertUtils {
return false; return false;
} }
String[] childs = childArray.toArray(new String[]{}); String[] childs = (String[]) childArray.toArray();
for (String v : childs) { for (String v : childs) {
if (!isIn(v, all)) { if (!isIn(v, all)) {
return false; return false;

View File

@ -3,7 +3,7 @@ package org.jeecg.config;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import org.jeecg.common.api.CommonAPI; import org.jeecg.common.api.CommonAPI;
import org.jeecg.common.system.vo.DictModel; import org.jeecg.common.system.vo.DictModel;

View File

@ -2,7 +2,9 @@ package org.jeecg.config;
import java.io.IOException; import java.io.IOException;
import javax.servlet.*; import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure;
import com.alibaba.druid.spring.boot3.autoconfigure.properties.DruidStatProperties;
import jakarta.servlet.*;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@ -11,8 +13,6 @@ import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
import com.alibaba.druid.util.Utils; import com.alibaba.druid.util.Utils;
/** /**

View File

@ -1,183 +1,183 @@
package org.jeecg.config; //package org.jeecg.config;
//
// 已使用swagger3config平替
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; //import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import io.swagger.annotations.ApiOperation; //import io.swagger.annotations.ApiOperation;
import org.jeecg.common.constant.CommonConstant; //import org.jeecg.common.constant.CommonConstant;
import org.springframework.beans.BeansException; //import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor; //import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; //import org.springframework.context.annotation.Import;
import org.springframework.util.ReflectionUtils; //import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.RestController; //import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; //import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; //import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; //import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration; //import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
import springfox.documentation.builders.ApiInfoBuilder; //import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder; //import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors; //import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors; //import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi; //import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.schema.ModelRef; //import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.*; //import springfox.documentation.service.*;
import springfox.documentation.spi.DocumentationType; //import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext; //import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket; //import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider; //import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider;
import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider; //import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
import springfox.documentation.swagger2.annotations.EnableSwagger2; //import springfox.documentation.swagger2.annotations.EnableSwagger2;
//
import java.lang.reflect.Field; //import java.lang.reflect.Field;
import java.util.ArrayList; //import java.util.ArrayList;
import java.util.Collections; //import java.util.Collections;
import java.util.List; //import java.util.List;
import java.util.stream.Collectors; //import java.util.stream.Collectors;
//
/** ///**
* @Author scott // * @Author scott
*/ // */
@Configuration //@Configuration
@EnableSwagger2 //开启 Swagger2 //@EnableSwagger2 //开启 Swagger2
@EnableKnife4j //开启 knife4j可以不写 //@EnableKnife4j //开启 knife4j可以不写
@Import(BeanValidatorPluginsConfiguration.class) //@Import(BeanValidatorPluginsConfiguration.class)
public class Swagger2Config implements WebMvcConfigurer { //public class Swagger2Config implements WebMvcConfigurer {
//
/** // /**
* // *
* 显示swagger-ui.html文档展示页还必须注入swagger资源 // * 显示swagger-ui.html文档展示页还必须注入swagger资源
* // *
* @param registry // * @param registry
*/ // */
@Override // @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { // public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); // registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/"); // registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); // registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
} // }
//
/** // /**
* swagger2的配置文件这里可以配置swagger2的一些基本的内容比如扫描的包等等 // * swagger2的配置文件这里可以配置swagger2的一些基本的内容比如扫描的包等等
* // *
* @return Docket // * @return Docket
*/ // */
@Bean(value = "defaultApi2") // @Bean(value = "defaultApi2")
public Docket defaultApi2() { // public Docket defaultApi2() {
return new Docket(DocumentationType.SWAGGER_2) // return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo()) // .apiInfo(apiInfo())
.select() // .select()
//此包路径下的类,才生成接口文档 // //此包路径下的类,才生成接口文档
.apis(RequestHandlerSelectors.basePackage("org.jeecg")) // .apis(RequestHandlerSelectors.basePackage("org.jeecg"))
//加了ApiOperation注解的类才生成接口文档 // //加了ApiOperation注解的类才生成接口文档
.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)) // .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) // .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.paths(PathSelectors.any()) // .paths(PathSelectors.any())
.build() // .build()
.securitySchemes(Collections.singletonList(securityScheme())) // .securitySchemes(Collections.singletonList(securityScheme()))
.securityContexts(securityContexts()) // .securityContexts(securityContexts())
.globalOperationParameters(setHeaderToken()); // .globalOperationParameters(setHeaderToken());
} // }
//
/*** // /***
* oauth2配置 // * oauth2配置
* 需要增加swagger授权回调地址 // * 需要增加swagger授权回调地址
* http://localhost:8888/webjars/springfox-swagger-ui/o2c.html // * http://localhost:8888/webjars/springfox-swagger-ui/o2c.html
* @return // * @return
*/ // */
@Bean // @Bean
SecurityScheme securityScheme() { // SecurityScheme securityScheme() {
return new ApiKey(CommonConstant.X_ACCESS_TOKEN, CommonConstant.X_ACCESS_TOKEN, "header"); // return new ApiKey(CommonConstant.X_ACCESS_TOKEN, CommonConstant.X_ACCESS_TOKEN, "header");
} // }
/** // /**
* JWT token // * JWT token
* @return // * @return
*/ // */
private List<Parameter> setHeaderToken() { // private List<Parameter> setHeaderToken() {
ParameterBuilder tokenPar = new ParameterBuilder(); // ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<>(); // List<Parameter> pars = new ArrayList<>();
tokenPar.name(CommonConstant.X_ACCESS_TOKEN).description("token").modelRef(new ModelRef("string")).parameterType("header").required(false).build(); // tokenPar.name(CommonConstant.X_ACCESS_TOKEN).description("token").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tokenPar.build()); // pars.add(tokenPar.build());
return pars; // return pars;
} // }
//
/** // /**
* api文档的详细信息函数,注意这里的注解引用的是哪个 // * api文档的详细信息函数,注意这里的注解引用的是哪个
* // *
* @return // * @return
*/ // */
private ApiInfo apiInfo() { // private ApiInfo apiInfo() {
return new ApiInfoBuilder() // return new ApiInfoBuilder()
// //大标题 // // //大标题
.title("JeecgBoot 后台服务API接口文档") // .title("JeecgBoot 后台服务API接口文档")
// 版本号 // // 版本号
.version("1.0") // .version("1.0")
// .termsOfServiceUrl("NO terms of service") //// .termsOfServiceUrl("NO terms of service")
// 描述 // // 描述
.description("后台API接口") // .description("后台API接口")
// 作者 // // 作者
.contact(new Contact("北京国炬信息技术有限公司","www.jeccg.com","jeecgos@163.com")) // .contact(new Contact("北京国炬信息技术有限公司","www.jeccg.com","jeecgos@163.com"))
.license("The Apache License, Version 2.0") // .license("The Apache License, Version 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") // .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.build(); // .build();
} // }
//
/** // /**
* 新增 securityContexts 保持登录状态 // * 新增 securityContexts 保持登录状态
*/ // */
private List<SecurityContext> securityContexts() { // private List<SecurityContext> securityContexts() {
return new ArrayList( // return new ArrayList(
Collections.singleton(SecurityContext.builder() // Collections.singleton(SecurityContext.builder()
.securityReferences(defaultAuth()) // .securityReferences(defaultAuth())
.forPaths(PathSelectors.regex("^(?!auth).*$")) // .forPaths(PathSelectors.regex("^(?!auth).*$"))
.build()) // .build())
); // );
} // }
//
private List<SecurityReference> defaultAuth() { // private List<SecurityReference> defaultAuth() {
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); // AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; // AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope; // authorizationScopes[0] = authorizationScope;
return new ArrayList( // return new ArrayList(
Collections.singleton(new SecurityReference(CommonConstant.X_ACCESS_TOKEN, authorizationScopes))); // Collections.singleton(new SecurityReference(CommonConstant.X_ACCESS_TOKEN, authorizationScopes)));
} // }
//
/** // /**
* 解决springboot2.6 和springfox不兼容问题 // * 解决springboot2.6 和springfox不兼容问题
* @return // * @return
*/ // */
@Bean // @Bean
public static BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() { // public static BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() {
return new BeanPostProcessor() { // return new BeanPostProcessor() {
//
@Override // @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { // public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider) { // if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider) {
customizeSpringfoxHandlerMappings(getHandlerMappings(bean)); // customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
} // }
return bean; // return bean;
} // }
//
private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings) { // private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings) {
List<T> copy = mappings.stream() // List<T> copy = mappings.stream()
.filter(mapping -> mapping.getPatternParser() == null) // .filter(mapping -> mapping.getPatternParser() == null)
.collect(Collectors.toList()); // .collect(Collectors.toList());
mappings.clear(); // mappings.clear();
mappings.addAll(copy); // mappings.addAll(copy);
} // }
//
@SuppressWarnings("unchecked") // @SuppressWarnings("unchecked")
private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) { // private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) {
try { // try {
Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings"); // Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings");
field.setAccessible(true); // field.setAccessible(true);
return (List<RequestMappingInfoHandlerMapping>) field.get(bean); // return (List<RequestMappingInfoHandlerMapping>) field.get(bean);
} catch (IllegalArgumentException | IllegalAccessException e) { // } catch (IllegalArgumentException | IllegalAccessException e) {
throw new IllegalStateException(e); // throw new IllegalStateException(e);
} // }
} // }
}; // };
} // }
//
//
} //}

View File

@ -0,0 +1,59 @@
package org.jeecg.config;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Paths;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.jeecg.common.constant.CommonConstant;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class Swagger3Config implements WebMvcConfigurer {
/**
*
* 显示swagger-ui.html文档展示页还必须注入swagger资源
*
* @param registry
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}
@Bean
public GroupedOpenApi swaggerOpenApi() {
return GroupedOpenApi.builder()
.group("default")
.packagesToScan("org.jeecg")
// 剔除以下几个包路径的接口生成文档
.packagesToExclude("org.jeecg.modules.drag", "org.jeecg.modules.online", "org.jeecg.modules.jmreport")
// 加了Operation注解的方法才生成接口文档
.addOpenApiMethodFilter(method -> method.isAnnotationPresent(Operation.class))
.build();
}
@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI()
.info(new Info()
.title("JeecgBoot 后台服务API接口文档")
.version("1.0")
.contact(new Contact().name("北京国炬信息技术有限公司").url("www.jeccg.com").email("jeecgos@163.com"))
.description( "后台API接口")
.termsOfService("NO terms of service")
.license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0.html"))
);
}
}

View File

@ -0,0 +1,19 @@
package org.jeecg.config;
import io.undertow.server.DefaultByteBufferPool;
import io.undertow.websockets.jsr.WebSocketDeploymentInfo;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component;
@Component
public class UndertowCustomizer implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
@Override
public void customize(UndertowServletWebServerFactory factory) {
factory.addDeploymentInfoCustomizers(deploymentInfo -> {
WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo();
webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(false, 1024));
deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo);
});
}
}

View File

@ -10,12 +10,15 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.prometheus.PrometheusMeterRegistry; import io.micrometer.prometheus.PrometheusMeterRegistry;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.actuate.trace.http.InMemoryHttpTraceRepository; import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.boot.actuate.web.exchanges.InMemoryHttpExchangeRepository;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -30,7 +33,6 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -133,8 +135,11 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
* https://blog.csdn.net/u013810234/article/details/110097201 * https://blog.csdn.net/u013810234/article/details/110097201
*/ */
@Bean @Bean
public InMemoryHttpTraceRepository getInMemoryHttpTrace(){ public InMemoryHttpExchangeRepository getInMemoryHttpTrace(){
return new InMemoryHttpTraceRepository(); InMemoryHttpExchangeRepository repository = new InMemoryHttpExchangeRepository();
// 默认保存1000条http请求记录
repository.setCapacity(1000);
return repository;
} }

View File

@ -31,7 +31,7 @@ public class WebSocketConfig {
FilterRegistrationBean bean = new FilterRegistrationBean(); FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(websocketFilter()); bean.setFilter(websocketFilter());
//TODO 临时注释掉测试下线上socket总断的问题 //TODO 临时注释掉测试下线上socket总断的问题
bean.addUrlPatterns("/websocket/*","/eoaSocket/*","/eoaNewChatSocket/*", "/newsWebsocket/*", "/vxeSocket/*"); bean.addUrlPatterns("/taskCountSocket/*", "/websocket/*","/eoaSocket/*","/eoaNewChatSocket/*", "/newsWebsocket/*", "/vxeSocket/*");
return bean; return bean;
} }

View File

@ -3,8 +3,8 @@ package org.jeecg.config.filter;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;
import org.jeecg.config.sign.util.BodyReaderHttpServletRequestWrapper; import org.jeecg.config.sign.util.BodyReaderHttpServletRequestWrapper;
import javax.servlet.*; import jakarta.servlet.*;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
/** /**

View File

@ -7,9 +7,9 @@ import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.common.util.TokenUtils; import org.jeecg.common.util.TokenUtils;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import javax.servlet.*; import jakarta.servlet.*;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
/** /**

View File

@ -17,9 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.AntPathMatcher; import org.springframework.util.AntPathMatcher;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.Set; import java.util.Set;

View File

@ -11,7 +11,7 @@ import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.config.mybatis.ThreadLocalDataHelper; import org.jeecg.config.mybatis.ThreadLocalDataHelper;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.lang.reflect.Method; import java.lang.reflect.Method;
/** /**

View File

@ -6,8 +6,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
/** /**
* 动态数据源切换拦截器 * 动态数据源切换拦截器

View File

@ -17,21 +17,20 @@ import org.jeecg.config.shiro.filters.CustomShiroFilterFactoryBean;
import org.jeecg.config.shiro.filters.JwtFilter; import org.jeecg.config.shiro.filters.JwtFilter;
import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn; import org.springframework.context.annotation.DependsOn;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import redis.clients.jedis.HostAndPort; import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster; import redis.clients.jedis.JedisCluster;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import javax.servlet.Filter; import jakarta.servlet.Filter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @author: Scott * @author: Scott
@ -76,6 +75,7 @@ public class ShiroConfig {
} }
} }
} }
// 配置不会被拦截的链接 顺序判断 // 配置不会被拦截的链接 顺序判断
filterChainDefinitionMap.put("/sys/cas/client/validateLogin", "anon"); //cas验证登录 filterChainDefinitionMap.put("/sys/cas/client/validateLogin", "anon"); //cas验证登录
filterChainDefinitionMap.put("/sys/randomImage/**", "anon"); //登录验证码接口排除 filterChainDefinitionMap.put("/sys/randomImage/**", "anon"); //登录验证码接口排除
@ -94,6 +94,9 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/auth/2step-code", "anon");//登录验证码 filterChainDefinitionMap.put("/auth/2step-code", "anon");//登录验证码
filterChainDefinitionMap.put("/sys/common/static/**", "anon");//图片预览 &下载文件不限制token filterChainDefinitionMap.put("/sys/common/static/**", "anon");//图片预览 &下载文件不限制token
filterChainDefinitionMap.put("/sys/common/pdf/**", "anon");//pdf预览 filterChainDefinitionMap.put("/sys/common/pdf/**", "anon");//pdf预览
//filterChainDefinitionMap.put("/sys/common/view/**", "anon");//图片预览不限制token
//filterChainDefinitionMap.put("/sys/common/download/**", "anon");//文件下载不限制token
filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件 filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件
filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码 filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码
@ -101,6 +104,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/sys/checkAuth", "anon"); //授权接口排除 filterChainDefinitionMap.put("/sys/checkAuth", "anon"); //授权接口排除
//update-begin--Author:scott Date:20221116 for排除静态资源后缀
filterChainDefinitionMap.put("/", "anon"); filterChainDefinitionMap.put("/", "anon");
filterChainDefinitionMap.put("/doc.html", "anon"); filterChainDefinitionMap.put("/doc.html", "anon");
filterChainDefinitionMap.put("/**/*.js", "anon"); filterChainDefinitionMap.put("/**/*.js", "anon");
@ -115,16 +119,17 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/**/*.ttf", "anon"); filterChainDefinitionMap.put("/**/*.ttf", "anon");
filterChainDefinitionMap.put("/**/*.woff", "anon"); filterChainDefinitionMap.put("/**/*.woff", "anon");
filterChainDefinitionMap.put("/**/*.woff2", "anon"); filterChainDefinitionMap.put("/**/*.woff2", "anon");
//update-end--Author:scott Date:20221116 for排除静态资源后缀
filterChainDefinitionMap.put("/druid/**", "anon"); filterChainDefinitionMap.put("/druid/**", "anon");
filterChainDefinitionMap.put("/swagger-ui.html", "anon"); filterChainDefinitionMap.put("/swagger-ui.html", "anon");
filterChainDefinitionMap.put("/swagger**/**", "anon"); filterChainDefinitionMap.put("/swagger**/**", "anon");
filterChainDefinitionMap.put("/webjars/**", "anon"); filterChainDefinitionMap.put("/webjars/**", "anon");
filterChainDefinitionMap.put("/v2/**", "anon"); filterChainDefinitionMap.put("/v3/**", "anon");
// 企业微信证书排除
filterChainDefinitionMap.put("/WW_verify*", "anon"); // update-begin--Author:sunjianlei Date:20210510 for排除消息通告查看详情页面用于第三方APP
filterChainDefinitionMap.put("/sys/annountCement/show/**", "anon"); filterChainDefinitionMap.put("/sys/annountCement/show/**", "anon");
// update-end--Author:sunjianlei Date:20210510 for排除消息通告查看详情页面用于第三方APP
//积木报表排除 //积木报表排除
filterChainDefinitionMap.put("/jmreport/**", "anon"); filterChainDefinitionMap.put("/jmreport/**", "anon");
@ -155,10 +160,10 @@ public class ShiroConfig {
//测试模块排除 //测试模块排除
filterChainDefinitionMap.put("/test/seata/**", "anon"); filterChainDefinitionMap.put("/test/seata/**", "anon");
// update-begin--author:liusq Date:20230522 for[issues/4829]访问不存在的url时会提示Token失效请重新登录呢
//错误路径排除 //错误路径排除
filterChainDefinitionMap.put("/error", "anon"); filterChainDefinitionMap.put("/error", "anon");
// update-end--author:liusq Date:20230522 for[issues/4829]访问不存在的url时会提示Token失效请重新登录呢 // 企业微信证书排除
filterChainDefinitionMap.put("/WW_verify*", "anon");
// 添加自己的过滤器并且取名为jwt // 添加自己的过滤器并且取名为jwt
Map<String, Filter> filterMap = new HashMap<String, Filter>(1); Map<String, Filter> filterMap = new HashMap<String, Filter>(1);
@ -253,8 +258,7 @@ public class ShiroConfig {
public IRedisManager redisManager() { public IRedisManager redisManager() {
log.info("===============(2)创建RedisManager,连接Redis.."); log.info("===============(2)创建RedisManager,连接Redis..");
IRedisManager manager; IRedisManager manager;
// sentinel cluster redis【issues/5569】shiro集成 redis 不支持 sentinel 方式部署的redis集群 #5569
// sentinel cluster redis
if (Objects.nonNull(redisProperties) if (Objects.nonNull(redisProperties)
&& Objects.nonNull(redisProperties.getSentinel()) && Objects.nonNull(redisProperties.getSentinel())
&& !CollectionUtils.isEmpty(redisProperties.getSentinel().getNodes())) { && !CollectionUtils.isEmpty(redisProperties.getSentinel().getNodes())) {
@ -266,6 +270,7 @@ public class ShiroConfig {
return sentinelManager; return sentinelManager;
} }
// redis 单机支持,在集群为空,或者集群无机器时候使用 add by jzyadmin@163.com // redis 单机支持,在集群为空,或者集群无机器时候使用 add by jzyadmin@163.com
if (lettuceConnectionFactory.getClusterConfiguration() == null || lettuceConnectionFactory.getClusterConfiguration().getClusterNodes().isEmpty()) { if (lettuceConnectionFactory.getClusterConfiguration() == null || lettuceConnectionFactory.getClusterConfiguration().getClusterNodes().isEmpty()) {
RedisManager redisManager = new RedisManager(); RedisManager redisManager = new RedisManager();

View File

@ -22,8 +22,8 @@ import org.jeecg.common.util.oConvertUtils;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.util.Set; import java.util.Set;
/** /**

View File

@ -12,7 +12,7 @@ import org.apache.shiro.web.servlet.AbstractShiroFilter;
import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.mgt.SecurityManager;
import org.springframework.beans.factory.BeanInitializationException; import org.springframework.beans.factory.BeanInitializationException;
import javax.servlet.Filter; import jakarta.servlet.Filter;
import java.util.Map; import java.util.Map;
/** /**

View File

@ -12,10 +12,10 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.ServletRequest; import jakarta.servlet.ServletRequest;
import javax.servlet.ServletResponse; import jakarta.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
/** /**
* @Description: 鉴权登录拦截器 * @Description: 鉴权登录拦截器

View File

@ -1,9 +1,9 @@
package org.jeecg.config.shiro.filters; package org.jeecg.config.shiro.filters;
import javax.servlet.ServletRequest; import jakarta.servlet.ServletRequest;
import javax.servlet.ServletResponse; import jakarta.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.AccessControlFilter; import org.apache.shiro.web.filter.AccessControlFilter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

View File

@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.annotation.Resource; import jakarta.annotation.Resource;
/** /**
* 签名 拦截器配置 * 签名 拦截器配置

View File

@ -4,8 +4,8 @@ package org.jeecg.config.sign.interceptor;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.SortedMap; import java.util.SortedMap;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;

View File

@ -1,10 +1,10 @@
package org.jeecg.config.sign.util; package org.jeecg.config.sign.util;
import javax.servlet.ReadListener; import jakarta.servlet.ReadListener;
import javax.servlet.ServletInputStream; import jakarta.servlet.ServletInputStream;
import javax.servlet.ServletRequest; import jakarta.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper; import jakarta.servlet.http.HttpServletRequestWrapper;
import java.io.*; import java.io.*;
import java.nio.charset.Charset; import java.nio.charset.Charset;

View File

@ -10,7 +10,7 @@ import java.util.Map;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.SymbolConstant; import org.jeecg.common.constant.SymbolConstant;

View File

@ -35,4 +35,5 @@ public class Firewall {
public void setLowCodeMode(String lowCodeMode) { public void setLowCodeMode(String lowCodeMode) {
this.lowCodeMode = lowCodeMode; this.lowCodeMode = lowCodeMode;
} }
} }

View File

@ -12,8 +12,8 @@ import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
/** /**

View File

@ -56,7 +56,7 @@
</div> </div>
<div style="width: 600px; margin: 0 auto; margin-top: 50px; font-size: 12px; -webkit-font-smoothing: subpixel-antialiased; text-size-adjust: 100%;"> <div style="width: 600px; margin: 0 auto; margin-top: 50px; font-size: 12px; -webkit-font-smoothing: subpixel-antialiased; text-size-adjust: 100%;">
<p style="text-align: center; line-height: 20.4px; text-size-adjust: 100%; font-family: 'Microsoft YaHei'!important; padding: 0px !important; margin: 0px !important; color: #7e8890 !important;"> <p style="text-align: center; line-height: 20.4px; text-size-adjust: 100%; font-family: 'Microsoft YaHei'!important; padding: 0px !important; margin: 0px !important; color: #7e8890 !important;">
<span class="appleLinks">Copyright © 2023-2024 北京国炬科技股份有限公司. 保留所有权利。</span> <span class="appleLinks">Copyright © 2023-2024 北京国炬信息技术有限公司. 保留所有权利。</span>
</p> </p>
<p style="text-align: center;line-height: 20.4px; text-size-adjust: 100%; font-family: 'Microsoft YaHei'!important; padding: 0px !important; margin: 0px; color: #7e8890 !important; margin-top: 10px;"> <p style="text-align: center;line-height: 20.4px; text-size-adjust: 100%; font-family: 'Microsoft YaHei'!important; padding: 0px !important; margin: 0px; color: #7e8890 !important; margin-top: 10px;">
<span class="appleLinks">邮件由系统自动发送,请勿直接回复本邮件!</span> <span class="appleLinks">邮件由系统自动发送,请勿直接回复本邮件!</span>

View File

@ -6,7 +6,10 @@
<body> <body>
<div class="box-content"> <div class="box-content">
<div class="info-top"> <div class="info-top">
<img src="https://jeecgdev.oss-cn-beijing.aliyuncs.com/temp/logo(1)_1697180761742.png" style="float: left; margin: 0 10px 0 0; width: 32px;height:32px" /><div style="color:#fff"><strong>【重要】新数据提醒</strong></div> <img src="https://qiaoqiaoyun.oss-cn-beijing.aliyuncs.com/site/qqyunemaillogo.png" style="width: 35px;height:35px; background: #5e8ee5; border-radius: 5px;" />
<div style="color:#fff;">
<strong>【重要】新数据提醒</strong>
</div>
</div> </div>
<div class="info-wrap"> <div class="info-wrap">
<div class="tips" style="padding:15px;"> <div class="tips" style="padding:15px;">
@ -23,12 +26,12 @@
<a style="color: #006eff;" href="${moreLink}" target="_blank" rel="noopener">[查看所有数据]</a> <a style="color: #006eff;" href="${moreLink}" target="_blank" rel="noopener">[查看所有数据]</a>
</p> </p>
</div> </div>
<div class="footer">北京国炬平台</div> <div class="footer">敲敲云平台</div>
<div class="footer" id="currentTime"></div> <div class="footer" id="currentTime"></div>
</div> </div>
<div style="width: 600px; margin: 0 auto; margin-top: 50px; font-size: 12px; -webkit-font-smoothing: subpixel-antialiased; text-size-adjust: 100%;"> <div style="width: 600px; margin: 0 auto; margin-top: 50px; font-size: 12px; -webkit-font-smoothing: subpixel-antialiased; text-size-adjust: 100%;">
<p style="text-align: center; line-height: 20.4px; text-size-adjust: 100%; font-family: 'Microsoft YaHei'!important; padding: 0px !important; margin: 0px !important; color: #7e8890 !important;"> <p style="text-align: center; line-height: 20.4px; text-size-adjust: 100%; font-family: 'Microsoft YaHei'!important; padding: 0px !important; margin: 0px !important; color: #7e8890 !important;">
<span class="appleLinks">Copyright © 2023-2024 北京国炬科技股份有限公司. 保留所有权利。</span> <span class="appleLinks">Copyright © 2023-2024 北京敲敲云科技有限公司. 保留所有权利。</span>
</p> </p>
<p style="text-align: center;line-height: 20.4px; text-size-adjust: 100%; font-family: 'Microsoft YaHei'!important; padding: 0px !important; margin: 0px; color: #7e8890 !important; margin-top: 10px;"> <p style="text-align: center;line-height: 20.4px; text-size-adjust: 100%; font-family: 'Microsoft YaHei'!important; padding: 0px !important; margin: 0px; color: #7e8890 !important; margin-top: 10px;">
<span class="appleLinks">邮件由系统自动发送,请勿直接回复本邮件!</span> <span class="appleLinks">邮件由系统自动发送,请勿直接回复本邮件!</span>
@ -46,6 +49,8 @@
} }
.info-top{ .info-top{
display: flex;
align-items: center;
padding: 15px 25px; padding: 15px 25px;
border-top-left-radius: 10px; border-top-left-radius: 10px;
border-top-right-radius: 10px; border-top-right-radius: 10px;

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>jeecg-boot-parent</artifactId> <artifactId>jeecg-boot-parent</artifactId>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<version>3.6.1</version> <version>3.6.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import jakarta.annotation.Resource;
/** /**
* 服务端提供方——feign接口 * 服务端提供方——feign接口
@ -24,7 +24,7 @@ public class JcloudDemoProviderController {
private JcloudDemoService jcloudDemoService; private JcloudDemoService jcloudDemoService;
@GetMapping("/getMessage") @GetMapping("/getMessage")
public String getMessage(@RequestParam String name) { public String getMessage(@RequestParam(name = "name") String name) {
String msg = jcloudDemoService.getMessage(name); String msg = jcloudDemoService.getMessage(name);
log.info(" 微服务被调用:{} ",msg); log.info(" 微服务被调用:{} ",msg);
return msg; return msg;

View File

@ -6,8 +6,8 @@ import org.apache.commons.io.IOUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import javax.swing.filechooser.FileSystemView; import javax.swing.filechooser.FileSystemView;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;

View File

@ -18,7 +18,7 @@ import org.jeecg.modules.demo.mock.vxe.entity.MockEntity;
import org.jeecg.modules.demo.mock.vxe.websocket.VxeSocket; import org.jeecg.modules.demo.mock.vxe.websocket.VxeSocket;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLDecoder; import java.net.URLDecoder;

View File

@ -6,12 +6,12 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.VxeSocketConst; import org.jeecg.common.constant.VxeSocketConst;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.websocket.OnClose; import jakarta.websocket.OnClose;
import javax.websocket.OnMessage; import jakarta.websocket.OnMessage;
import javax.websocket.OnOpen; import jakarta.websocket.OnOpen;
import javax.websocket.Session; import jakarta.websocket.Session;
import javax.websocket.server.PathParam; import jakarta.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint; import jakarta.websocket.server.ServerEndpoint;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;

View File

@ -4,13 +4,12 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiParam; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.mgt.DefaultSecurityManager; import org.apache.shiro.mgt.DefaultSecurityManager;
@ -30,8 +29,6 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
@ -44,7 +41,7 @@ import java.util.List;
* @Version:V2.0 * @Version:V2.0
*/ */
@Slf4j @Slf4j
@Api(tags = "单表DEMO") @Tag(name = "单表DEMO")
@RestController @RestController
@RequestMapping("/test/jeecgDemo") @RequestMapping("/test/jeecgDemo")
public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoService> { public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoService> {
@ -63,7 +60,7 @@ public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoSe
* @param req * @param req
* @return * @return
*/ */
@ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表") @Operation(summary = "获取所有Demo数据列表")
@GetMapping(value = "/list") @GetMapping(value = "/list")
@PermissionData(pageComponent = "jeecg/JeecgDemoList") @PermissionData(pageComponent = "jeecg/JeecgDemoList")
public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@ -88,7 +85,7 @@ public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoSe
*/ */
@PostMapping(value = "/add") @PostMapping(value = "/add")
@AutoLog(value = "添加测试DEMO") @AutoLog(value = "添加测试DEMO")
@ApiOperation(value = "添加DEMO", notes = "添加DEMO") @Operation(summary = "添加DEMO")
public Result<?> add(@RequestBody JeecgDemo jeecgDemo) { public Result<?> add(@RequestBody JeecgDemo jeecgDemo) {
jeecgDemoService.save(jeecgDemo); jeecgDemoService.save(jeecgDemo);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
@ -101,7 +98,7 @@ public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoSe
* @return * @return
*/ */
@AutoLog(value = "编辑DEMO", operateType = CommonConstant.OPERATE_TYPE_3) @AutoLog(value = "编辑DEMO", operateType = CommonConstant.OPERATE_TYPE_3)
@ApiOperation(value = "编辑DEMO", notes = "编辑DEMO") @Operation(summary = "编辑DEMO")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<?> edit(@RequestBody JeecgDemo jeecgDemo) { public Result<?> edit(@RequestBody JeecgDemo jeecgDemo) {
jeecgDemoService.updateById(jeecgDemo); jeecgDemoService.updateById(jeecgDemo);
@ -116,7 +113,7 @@ public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoSe
*/ */
@AutoLog(value = "删除测试DEMO") @AutoLog(value = "删除测试DEMO")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
@ApiOperation(value = "通过ID删除DEMO", notes = "通过ID删除DEMO") @Operation(summary = "通过ID删除DEMO")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) { public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
jeecgDemoService.removeById(id); jeecgDemoService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
@ -129,7 +126,7 @@ public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoSe
* @return * @return
*/ */
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
@ApiOperation(value = "批量删除DEMO", notes = "批量删除DEMO") @Operation(summary = "批量删除DEMO")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.jeecgDemoService.removeByIds(Arrays.asList(ids.split(","))); this.jeecgDemoService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
@ -142,8 +139,8 @@ public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoSe
* @return * @return
*/ */
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
@ApiOperation(value = "通过ID查询DEMO", notes = "通过ID查询DEMO") @Operation(summary = "通过ID查询DEMO")
public Result<?> queryById(@ApiParam(name = "id", value = "示例id", required = true) @RequestParam(name = "id", required = true) String id) { public Result<?> queryById(/*@ApiParam(name = "id", value = "示例id", required = true)*/ @RequestParam(name = "id", required = true) String id) {
JeecgDemo jeecgDemo = jeecgDemoService.getById(id); JeecgDemo jeecgDemo = jeecgDemoService.getById(id);
return Result.OK(jeecgDemo); return Result.OK(jeecgDemo);
} }
@ -475,7 +472,7 @@ public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoSe
* 测试Mono对象 * 测试Mono对象
* @return * @return
*/ */
@ApiOperation("Mono测试") @Operation(summary = "Mono测试")
@GetMapping(value ="/test") @GetMapping(value ="/test")
public Mono<String> test() { public Mono<String> test() {
//解决shiro报错No SecurityManager accessible to the calling code, either bound to the org.apache.shiro //解决shiro报错No SecurityManager accessible to the calling code, either bound to the org.apache.shiro

View File

@ -1,8 +1,7 @@
package org.jeecg.modules.demo.test.controller; package org.jeecg.modules.demo.test.controller;
import io.lettuce.core.dynamic.annotation.Param; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
@ -11,7 +10,10 @@ import org.jeecg.modules.demo.test.entity.JeecgDemo;
import org.jeecg.modules.demo.test.service.IJeecgDemoService; import org.jeecg.modules.demo.test.service.IJeecgDemoService;
import org.jeecg.modules.demo.test.service.IJeecgDynamicDataService; import org.jeecg.modules.demo.test.service.IJeecgDynamicDataService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@ -21,7 +23,7 @@ import java.util.List;
* @Date:2020-04-21 * @Date:2020-04-21
*/ */
@Slf4j @Slf4j
@Api(tags = "动态数据源测试") @Tag(name = "动态数据源测试")
@RestController @RestController
@RequestMapping("/test/dynamic") @RequestMapping("/test/dynamic")
public class JeecgDynamicDataController extends JeecgController<JeecgDemo, IJeecgDemoService> { public class JeecgDynamicDataController extends JeecgController<JeecgDemo, IJeecgDemoService> {
@ -37,7 +39,7 @@ public class JeecgDynamicDataController extends JeecgController<JeecgDemo, IJeec
*/ */
@PostMapping(value = "/test1") @PostMapping(value = "/test1")
@AutoLog(value = "动态切换数据源") @AutoLog(value = "动态切换数据源")
@ApiOperation(value = "动态切换数据源", notes = "动态切换数据源") @Operation(summary = "动态切换数据源")
public Result<List<JeecgDemo>> selectSpelByKey(@RequestParam(required = false) String dsName) { public Result<List<JeecgDemo>> selectSpelByKey(@RequestParam(required = false) String dsName) {
List<JeecgDemo> list = jeecgDynamicDataService.selectSpelByKey(dsName); List<JeecgDemo> list = jeecgDynamicDataService.selectSpelByKey(dsName);
return Result.OK(list); return Result.OK(list);

View File

@ -17,7 +17,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.util.Arrays; import java.util.Arrays;
/** /**

View File

@ -5,8 +5,8 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;

View File

@ -7,8 +7,8 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;

View File

@ -3,6 +3,7 @@ package org.jeecg.modules.demo.test.entity;
import java.io.Serializable; import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.Version; import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.v3.oas.annotations.media.Schema;
import org.jeecg.common.system.base.entity.JeecgEntity; import org.jeecg.common.system.base.entity.JeecgEntity;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -10,8 +11,6 @@ import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
@ -25,59 +24,59 @@ import lombok.experimental.Accessors;
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value="测试DEMO对象", description="测试DEMO") @Schema(description="测试DEMO")
@TableName("demo") @TableName("demo")
public class JeecgDemo extends JeecgEntity implements Serializable { public class JeecgDemo extends JeecgEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 姓名 */ /** 姓名 */
@Excel(name="姓名",width=25) @Excel(name="姓名",width=25)
@ApiModelProperty(value = "姓名") @Schema(description = "姓名")
private java.lang.String name; private java.lang.String name;
/** 关键词 */ /** 关键词 */
@ApiModelProperty(value = "关键词") @Schema(description = "关键词")
@Excel(name="关键词",width=15) @Excel(name="关键词",width=15)
private java.lang.String keyWord; private java.lang.String keyWord;
/** 打卡时间 */ /** 打卡时间 */
@ApiModelProperty(value = "打卡时间") @Schema(description = "打卡时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name="打卡时间",width=20,format="yyyy-MM-dd HH:mm:ss") @Excel(name="打卡时间",width=20,format="yyyy-MM-dd HH:mm:ss")
private java.util.Date punchTime; private java.util.Date punchTime;
/** 工资 */ /** 工资 */
@ApiModelProperty(value = "工资",example = "0") @Schema(description = "工资",example = "0")
@Excel(name="工资",width=15) @Excel(name="工资",type = 4,width=15)
private java.math.BigDecimal salaryMoney; private java.math.BigDecimal salaryMoney;
/** 奖金 */ /** 奖金 */
@ApiModelProperty(value = "奖金",example = "0") @Schema(description = "奖金",example = "0")
@Excel(name="奖金",width=15) @Excel(name="奖金",type = 4,width=15)
private java.lang.Double bonusMoney; private java.lang.Double bonusMoney;
/** 性别 {男:1,女:2} */ /** 性别 {男:1,女:2} */
@ApiModelProperty(value = "性别") @Schema(description = "性别")
@Excel(name = "性别", width = 15, dicCode = "sex") @Excel(name = "性别", width = 15, dicCode = "sex")
private java.lang.String sex; private java.lang.String sex;
/** 年龄 */ /** 年龄 */
@ApiModelProperty(value = "年龄",example = "0") @Schema(description = "年龄",example = "0")
@Excel(name="年龄",width=15) @Excel(name="年龄",type = 4,width=15)
private java.lang.Integer age; private java.lang.Integer age;
/** 生日 */ /** 生日 */
@ApiModelProperty(value = "生日") @Schema(description = "生日")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name="生日",format="yyyy-MM-dd") @Excel(name="生日",format="yyyy-MM-dd")
private java.util.Date birthday; private java.util.Date birthday;
/** 邮箱 */ /** 邮箱 */
@ApiModelProperty(value = "邮箱") @Schema(description = "邮箱")
@Excel(name="邮箱",width=30) @Excel(name="邮箱",width=30)
private java.lang.String email; private java.lang.String email;
/** 个人简介 */ /** 个人简介 */
@ApiModelProperty(value = "个人简介") @Schema(description = "个人简介")
private java.lang.String content; private java.lang.String content;
/** 部门编码 */ /** 部门编码 */
@Excel(name="部门编码",width=25) @Excel(name="部门编码",width=25)
@ApiModelProperty(value = "部门编码") @Schema(description = "部门编码")
private java.lang.String sysOrgCode; private java.lang.String sysOrgCode;
@ApiModelProperty(value = "租户ID") // @Schema(description = "租户ID")
private java.lang.Integer tenantId; private java.lang.Integer tenantId;
/** 乐观锁字段 */ /** 乐观锁字段 */
@Version @Version

View File

@ -18,7 +18,7 @@ import org.jeecg.modules.demo.mock.vxe.websocket.VxeSocket;
import org.jeecg.modules.dlglong.entity.MockEntity; import org.jeecg.modules.dlglong.entity.MockEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLDecoder; import java.net.URLDecoder;

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>jeecg-system-api</artifactId> <artifactId>jeecg-system-api</artifactId>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<version>3.6.1</version> <version>3.6.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -94,6 +94,22 @@ public interface ISysBaseAPI extends CommonAPI {
@GetMapping("/sys/api/getDepartIdsByUsername") @GetMapping("/sys/api/getDepartIdsByUsername")
List<String> getDepartIdsByUsername(@RequestParam("username") String username); List<String> getDepartIdsByUsername(@RequestParam("username") String username);
/**
* 8.2 通过用户账号查询部门父ID集合
* @param username
* @return 部门 parentIds
*/
@GetMapping("/sys/api/getDepartParentIdsByUsername")
Set<String> getDepartParentIdsByUsername(@RequestParam("username")String username);
/**
* 8.3 查询部门父ID集合
* @param depIds
* @return 部门 parentIds
*/
@GetMapping("/sys/api/getDepartParentIdsByDepIds")
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set depIds);
/** /**
* 9通过用户账号查询部门 name * 9通过用户账号查询部门 name
* @param username * @param username
@ -481,6 +497,14 @@ public interface ISysBaseAPI extends CommonAPI {
@GetMapping("/sys/api/loadCategoryDictItem") @GetMapping("/sys/api/loadCategoryDictItem")
List<String> loadCategoryDictItem(@RequestParam("ids") String ids); List<String> loadCategoryDictItem(@RequestParam("ids") String ids);
/**
* 44 反向翻译分类字典,用于导入
*
* @param names 名称,逗号分割
*/
@GetMapping("/sys/api/loadCategoryDictItemByNames")
List<String> loadCategoryDictItemByNames(@RequestParam("names") String names, @RequestParam("delNotExist") boolean delNotExist);
/** /**
* 43 根据字典code加载字典text * 43 根据字典code加载字典text
* *
@ -551,17 +575,20 @@ public interface ISysBaseAPI extends CommonAPI {
@GetMapping("/sys/api/translateManyDict") @GetMapping("/sys/api/translateManyDict")
Map<String, List<DictModel>> translateManyDict(@RequestParam("dictCodes") String dictCodes, @RequestParam("keys") String keys); Map<String, List<DictModel>> translateManyDict(@RequestParam("dictCodes") String dictCodes, @RequestParam("keys") String keys);
//update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
/** /**
* 49 字典表的 翻译,可批量 * 49 字典表的 翻译,可批量
* @param table * @param table
* @param text * @param text
* @param code * @param code
* @param keys 多个用逗号分割 * @param keys 多个用逗号分割
* @param ds
* @return * @return
*/ */
@Override @Override
@GetMapping("/sys/api/translateDictFromTableByKeys") @GetMapping("/sys/api/translateDictFromTableByKeys")
List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys); List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys, @RequestParam("ds") String ds);
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
/** /**
* 发送模板消息 * 发送模板消息

View File

@ -65,6 +65,16 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
return null; return null;
} }
@Override
public Set<String> getDepartParentIdsByUsername(String username) {
return null;
}
@Override
public Set<String> getDepartParentIdsByDepIds(Set depIds) {
return null;
}
@Override @Override
public List<String> getDepartNamesByUsername(String username) { public List<String> getDepartNamesByUsername(String username) {
return null; return null;
@ -275,10 +285,12 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
return null; return null;
} }
//update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
@Override @Override
public List<DictModel> translateDictFromTableByKeys(String table, String text, String code, String keys) { public List<DictModel> translateDictFromTableByKeys(String table, String text, String code, String keys, String dataSource) {
return null; return null;
} }
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
@Override @Override
public void sendTemplateMessage(MessageDTO message) { public void sendTemplateMessage(MessageDTO message) {
@ -319,6 +331,11 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
return null; return null;
} }
@Override
public List<String> loadCategoryDictItemByNames(String names, boolean delNotExist) {
return null;
}
@Override @Override
public List<String> loadDictItem(String dictCode, String keys) { public List<String> loadDictItem(String dictCode, String keys) {
return null; return null;

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>jeecg-system-api</artifactId> <artifactId>jeecg-system-api</artifactId>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<version>3.6.1</version> <version>3.6.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -89,6 +89,20 @@ public interface ISysBaseAPI extends CommonAPI {
*/ */
List<String> getDepartIdsByUsername(String username); List<String> getDepartIdsByUsername(String username);
/**
* 8.2 通过用户账号查询部门父ID集合
* @param username
* @return 部门 parentIds
*/
Set<String> getDepartParentIdsByUsername(String username);
/**
* 8.2 查询部门父ID集合
* @param depIds
* @return 部门 parentIds
*/
Set<String> getDepartParentIdsByDepIds(Set depIds);
/** /**
* 9通过用户账号查询部门 name * 9通过用户账号查询部门 name
* @param username * @param username
@ -373,6 +387,13 @@ public interface ISysBaseAPI extends CommonAPI {
*/ */
List<String> loadCategoryDictItem(String ids); List<String> loadCategoryDictItem(String ids);
/**
* 反向翻译分类字典,用于导入
*
* @param names 名称,逗号分割
*/
List<String> loadCategoryDictItemByNames(String names, boolean delNotExist);
/** /**
* 根据字典code加载字典text * 根据字典code加载字典text
* *

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>jeecg-module-system</artifactId> <artifactId>jeecg-module-system</artifactId>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<version>3.6.1</version> <version>3.6.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-module-system</artifactId> <artifactId>jeecg-module-system</artifactId>
<version>3.6.1</version> <version>3.6.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -20,7 +20,7 @@
<artifactId>hibernate-core</artifactId> <artifactId>hibernate-core</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot3</groupId>
<artifactId>hibernate-re</artifactId> <artifactId>hibernate-re</artifactId>
</dependency> </dependency>
@ -32,12 +32,12 @@
<!-- 积木报表 --> <!-- 积木报表 -->
<dependency> <dependency>
<groupId>org.jeecgframework.jimureport</groupId> <groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-spring-boot-starter</artifactId> <artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot3</groupId>
<artifactId>drag-free</artifactId> <artifactId>jimureport-drag</artifactId>
<version>1.0.2</version> <version>2.0.2</version>
</dependency> </dependency>
<!-- 积木报表 mongo redis 支持包 <!-- 积木报表 mongo redis 支持包
<dependency> <dependency>

View File

@ -1,33 +1,33 @@
package org.jeecg.config.init; //package org.jeecg.config.init;
//
import org.apache.catalina.Context; //import org.apache.catalina.Context;
import org.apache.tomcat.util.scan.StandardJarScanner; //import org.apache.tomcat.util.scan.StandardJarScanner;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; //import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
//
/** ///**
* @Description: TomcatFactoryConfig // * @Description: TomcatFactoryConfig
* @author: scott // * @author: scott
* @date: 2021年01月25日 11:40 // * @date: 2021年01月25日 11:40
*/ // */
@Configuration //@Configuration
public class TomcatFactoryConfig { //public class TomcatFactoryConfig {
/** // /**
* tomcat-embed-jasper引用后提示jar找不到的问题 // * tomcat-embed-jasper引用后提示jar找不到的问题
*/ // */
@Bean // @Bean
public TomcatServletWebServerFactory tomcatFactory() { // public TomcatServletWebServerFactory tomcatFactory() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory() { // TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory() {
@Override // @Override
protected void postProcessContext(Context context) { // protected void postProcessContext(Context context) {
((StandardJarScanner) context.getJarScanner()).setScanManifest(false); // ((StandardJarScanner) context.getJarScanner()).setScanManifest(false);
} // }
}; // };
factory.addConnectorCustomizers(connector -> { // factory.addConnectorCustomizers(connector -> {
connector.setProperty("relaxedPathChars", "[]{}"); // connector.setProperty("relaxedPathChars", "[]{}");
connector.setProperty("relaxedQueryChars", "[]{}"); // connector.setProperty("relaxedQueryChars", "[]{}");
}); // });
return factory; // return factory;
} // }
} //}

View File

@ -1,81 +1,81 @@
package org.jeecg.config.jimureport; //package org.jeecg.config.jimureport;
//
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.util.JwtUtil; //import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.system.vo.SysUserCacheInfo; //import org.jeecg.common.system.vo.SysUserCacheInfo;
import org.jeecg.common.util.RedisUtil; //import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.TokenUtils; //import org.jeecg.common.util.TokenUtils;
import org.jeecg.modules.jmreport.api.JmReportTokenServiceI; //import org.jeecg.modules.jmreport.api.JmReportTokenServiceI;
import org.jeecg.modules.system.service.impl.SysBaseApiImpl; //import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; //import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; //import org.springframework.util.CollectionUtils;
//
import javax.servlet.http.HttpServletRequest; //import jakarta.servlet.http.HttpServletRequest;
import java.util.HashMap; //import java.util.HashMap;
import java.util.Map; //import java.util.Map;
import java.util.Set; //import java.util.Set;
//
/** ///**
* 自定义积木报表鉴权(如果不进行自定义,则所有请求不做权限控制) // * 自定义积木报表鉴权(如果不进行自定义,则所有请求不做权限控制)
* * 1.自定义获取登录token // * * 1.自定义获取登录token
* * 2.自定义获取登录用户 // * * 2.自定义获取登录用户
* @author: jeecg-boot // * @author: jeecg-boot
*/ // */
//
//
@Slf4j //@Slf4j
@Component //@Component
public class JimuReportTokenService implements JmReportTokenServiceI { //public class JimuReportTokenService implements JmReportTokenServiceI {
@Autowired // @Autowired
private SysBaseApiImpl sysBaseApi; // private SysBaseApiImpl sysBaseApi;
@Autowired // @Autowired
@Lazy // @Lazy
private RedisUtil redisUtil; // private RedisUtil redisUtil;
//
@Override // @Override
public String getToken(HttpServletRequest request) { // public String getToken(HttpServletRequest request) {
return TokenUtils.getTokenByRequest(request); // return TokenUtils.getTokenByRequest(request);
} // }
//
@Override // @Override
public String getUsername(String token) { // public String getUsername(String token) {
return JwtUtil.getUsername(token); // return JwtUtil.getUsername(token);
} // }
//
@Override // @Override
public String[] getRoles(String token) { // public String[] getRoles(String token) {
String username = JwtUtil.getUsername(token); // String username = JwtUtil.getUsername(token);
Set roles = sysBaseApi.getUserRoleSet(username); // Set roles = sysBaseApi.getUserRoleSet(username);
if(CollectionUtils.isEmpty(roles)){ // if(CollectionUtils.isEmpty(roles)){
return null; // return null;
} // }
return (String[]) roles.toArray(new String[roles.size()]); // return (String[]) roles.toArray(new String[roles.size()]);
} // }
//
@Override // @Override
public Boolean verifyToken(String token) { // public Boolean verifyToken(String token) {
return TokenUtils.verifyToken(token, sysBaseApi, redisUtil); // return TokenUtils.verifyToken(token, sysBaseApi, redisUtil);
} // }
//
@Override // @Override
public Map<String, Object> getUserInfo(String token) { // public Map<String, Object> getUserInfo(String token) {
Map<String, Object> map = new HashMap(5); // Map<String, Object> map = new HashMap(5);
String username = JwtUtil.getUsername(token); // String username = JwtUtil.getUsername(token);
//此处通过token只能拿到一个信息 用户账号 后面的就是根据账号获取其他信息 查询数据或是走redis 用户根据自身业务可自定义 // //此处通过token只能拿到一个信息 用户账号 后面的就是根据账号获取其他信息 查询数据或是走redis 用户根据自身业务可自定义
SysUserCacheInfo userInfo = null; // SysUserCacheInfo userInfo = null;
try { // try {
userInfo = sysBaseApi.getCacheUser(username); // userInfo = sysBaseApi.getCacheUser(username);
} catch (Exception e) { // } catch (Exception e) {
log.error("获取用户信息异常:"+ e.getMessage()); // log.error("获取用户信息异常:"+ e.getMessage());
return map; // return map;
} // }
//设置账号名 // //设置账号名
map.put(SYS_USER_CODE, userInfo.getSysUserCode()); // map.put(SYS_USER_CODE, userInfo.getSysUserCode());
//设置部门编码 // //设置部门编码
map.put(SYS_ORG_CODE, userInfo.getSysOrgCode()); // map.put(SYS_ORG_CODE, userInfo.getSysOrgCode());
// 将所有信息存放至map 解析sql/api会根据map的键值解析 // // 将所有信息存放至map 解析sql/api会根据map的键值解析
return map; // return map;
} // }
} //}

View File

@ -14,7 +14,7 @@ import org.jeecg.modules.system.entity.SysTenantPack;
import org.jeecg.modules.system.entity.SysTenantPackUser; import org.jeecg.modules.system.entity.SysTenantPackUser;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Date; import java.util.Date;

View File

@ -140,6 +140,26 @@ public class SystemApiController {
return sysBaseApi.getDepartIdsByUsername(username); return sysBaseApi.getDepartIdsByUsername(username);
} }
/**
* 通过用户账号查询部门父ID集合
* @param username
* @return 部门 id
*/
@GetMapping("/getDepartParentIdsByUsername")
Set<String> getDepartParentIdsByUsername(@RequestParam("username") String username){
return sysBaseApi.getDepartParentIdsByUsername(username);
}
/**
* 查询部门父ID集合
* @param depIds
* @return 部门 id
*/
@GetMapping("/getDepartParentIdsByDepIds")
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set depIds){
return sysBaseApi.getDepartParentIdsByDepIds(depIds);
}
/** /**
* 通过用户账号查询部门 name * 通过用户账号查询部门 name
* @param username * @param username
@ -527,6 +547,17 @@ public class SystemApiController {
return sysBaseApi.loadCategoryDictItem(ids); return sysBaseApi.loadCategoryDictItem(ids);
} }
/**
* 反向翻译分类字典,用于导入
*
* @param names 名称,逗号分割
* @return
*/
@GetMapping("/loadCategoryDictItemByNames")
List<String> loadCategoryDictItemByNames(@RequestParam("names") String names, @RequestParam("delNotExist") boolean delNotExist) {
return sysBaseApi.loadCategoryDictItemByNames(names, delNotExist);
}
/** /**
* 根据字典code加载字典text * 根据字典code加载字典text
* *
@ -655,6 +686,7 @@ public class SystemApiController {
} }
//update-begin---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
/** /**
* 【接口签名验证】 * 【接口签名验证】
* 49 字典表的 翻译,可批量 * 49 字典表的 翻译,可批量
@ -663,12 +695,14 @@ public class SystemApiController {
* @param text * @param text
* @param code * @param code
* @param keys 多个用逗号分割 * @param keys 多个用逗号分割
* @param ds 数据源
* @return * @return
*/ */
@GetMapping("/translateDictFromTableByKeys") @GetMapping("/translateDictFromTableByKeys")
public List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys) { public List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys, @RequestParam("ds") String ds) {
return this.sysBaseApi.translateDictFromTableByKeys(table, text, code, keys); return this.sysBaseApi.translateDictFromTableByKeys(table, text, code, keys, ds);
} }
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
/** /**
* 发送模板信息 * 发送模板信息

View File

@ -2,8 +2,8 @@ package org.jeecg.modules.cas.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;

View File

@ -2,8 +2,8 @@ package org.jeecg.modules.message.controller;
import java.util.Arrays; import java.util.Arrays;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;

View File

@ -3,8 +3,8 @@ package org.jeecg.modules.message.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.jeecg.common.api.dto.message.MessageDTO; import org.jeecg.common.api.dto.message.MessageDTO;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;

View File

@ -18,8 +18,8 @@ import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.mail.MessagingException; import jakarta.mail.MessagingException;
import javax.mail.internet.MimeMessage; import jakarta.mail.internet.MimeMessage;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.List; import java.util.List;

View File

@ -19,7 +19,7 @@ import org.jeecg.modules.system.mapper.SysAnnouncementSendMapper;
import org.jeecg.modules.system.mapper.SysUserMapper; import org.jeecg.modules.system.mapper.SysUserMapper;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;

View File

@ -2,9 +2,9 @@ package org.jeecg.modules.message.websocket;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import javax.websocket.*; import jakarta.websocket.*;
import javax.websocket.server.PathParam; import jakarta.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint; import jakarta.websocket.server.ServerEndpoint;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.base.BaseMap; import org.jeecg.common.base.BaseMap;

View File

@ -10,8 +10,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import javax.swing.filechooser.FileSystemView; import javax.swing.filechooser.FileSystemView;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -6,7 +6,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;

View File

@ -1,6 +1,6 @@
package org.jeecg.modules.oss.controller; package org.jeecg.modules.oss.controller;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles; import org.apache.shiro.authz.annotation.RequiresRoles;

View File

@ -3,8 +3,8 @@ package org.jeecg.modules.quartz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -30,8 +30,8 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -47,7 +47,7 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("/sys/quartzJob") @RequestMapping("/sys/quartzJob")
@Slf4j @Slf4j
@Api(tags = "定时任务接口") @Tag(name = "定时任务接口")
public class QuartzJobController { public class QuartzJobController {
@Autowired @Autowired
private IQuartzJobService quartzJobService; private IQuartzJobService quartzJobService;
@ -79,7 +79,7 @@ public class QuartzJobController {
* @param quartzJob * @param quartzJob
* @return * @return
*/ */
//@RequiresRoles("admin") @RequiresRoles("admin")
@RequiresPermissions("system:quartzJob:add") @RequiresPermissions("system:quartzJob:add")
@RequestMapping(value = "/add", method = RequestMethod.POST) @RequestMapping(value = "/add", method = RequestMethod.POST)
public Result<?> add(@RequestBody QuartzJob quartzJob) { public Result<?> add(@RequestBody QuartzJob quartzJob) {
@ -93,7 +93,7 @@ public class QuartzJobController {
* @param quartzJob * @param quartzJob
* @return * @return
*/ */
//@RequiresRoles("admin") @RequiresRoles("admin")
@RequiresPermissions("system:quartzJob:edit") @RequiresPermissions("system:quartzJob:edit")
@RequestMapping(value = "/edit", method ={RequestMethod.PUT, RequestMethod.POST}) @RequestMapping(value = "/edit", method ={RequestMethod.PUT, RequestMethod.POST})
public Result<?> eidt(@RequestBody QuartzJob quartzJob) { public Result<?> eidt(@RequestBody QuartzJob quartzJob) {
@ -112,7 +112,7 @@ public class QuartzJobController {
* @param id * @param id
* @return * @return
*/ */
//@RequiresRoles("admin") @RequiresRoles("admin")
@RequiresPermissions("system:quartzJob:delete") @RequiresPermissions("system:quartzJob:delete")
@RequestMapping(value = "/delete", method = RequestMethod.DELETE) @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
public Result<?> delete(@RequestParam(name = "id", required = true) String id) { public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@ -131,7 +131,7 @@ public class QuartzJobController {
* @param ids * @param ids
* @return * @return
*/ */
//@RequiresRoles("admin") @RequiresRoles("admin")
@RequiresPermissions("system:quartzJob:deleteBatch") @RequiresPermissions("system:quartzJob:deleteBatch")
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE) @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
@ -151,10 +151,10 @@ public class QuartzJobController {
* @param id * @param id
* @return * @return
*/ */
//@RequiresRoles("admin") @RequiresRoles("admin")
@RequiresPermissions("system:quartzJob:pause") @RequiresPermissions("system:quartzJob:pause")
@GetMapping(value = "/pause") @GetMapping(value = "/pause")
@ApiOperation(value = "停止定时任务") @Operation(summary = "停止定时任务")
public Result<Object> pauseJob(@RequestParam(name = "id") String id) { public Result<Object> pauseJob(@RequestParam(name = "id") String id) {
QuartzJob job = quartzJobService.getById(id); QuartzJob job = quartzJobService.getById(id);
if (job == null) { if (job == null) {
@ -170,10 +170,10 @@ public class QuartzJobController {
* @param id * @param id
* @return * @return
*/ */
//@RequiresRoles("admin") @RequiresRoles("admin")
@RequiresPermissions("system:quartzJob:resume") @RequiresPermissions("system:quartzJob:resume")
@GetMapping(value = "/resume") @GetMapping(value = "/resume")
@ApiOperation(value = "启动定时任务") @Operation(summary = "启动定时任务")
public Result<Object> resumeJob(@RequestParam(name = "id") String id) { public Result<Object> resumeJob(@RequestParam(name = "id") String id) {
QuartzJob job = quartzJobService.getById(id); QuartzJob job = quartzJobService.getById(id);
if (job == null) { if (job == null) {
@ -271,7 +271,7 @@ public class QuartzJobController {
* @param id * @param id
* @return * @return
*/ */
//@RequiresRoles("admin") @RequiresRoles("admin")
@RequiresPermissions("system:quartzJob:execute") @RequiresPermissions("system:quartzJob:execute")
@GetMapping("/execute") @GetMapping("/execute")
public Result<?> execute(@RequestParam(name = "id", required = true) String id) { public Result<?> execute(@RequestParam(name = "id", required = true) String id) {

View File

@ -20,8 +20,8 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.HandlerMapping; import org.springframework.web.servlet.HandlerMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
/** /**

View File

@ -1,7 +1,7 @@
package org.jeecg.modules.system.controller; package org.jeecg.modules.system.controller;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
/** /**
* @Title: DuplicateCheckAction * @Title: DuplicateCheckAction
@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest;
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/sys/duplicate") @RequestMapping("/sys/duplicate")
@Api(tags="重复校验") @Tag(name="重复校验")
public class DuplicateCheckController { public class DuplicateCheckController {
@Autowired @Autowired
@ -36,7 +36,7 @@ public class DuplicateCheckController {
* @return * @return
*/ */
@RequestMapping(value = "/check", method = RequestMethod.GET) @RequestMapping(value = "/check", method = RequestMethod.GET)
@ApiOperation("重复校验接口") @Operation(summary = "重复校验接口")
public Result<String> doDuplicateCheck(DuplicateCheckVo duplicateCheckVo, HttpServletRequest request) { public Result<String> doDuplicateCheck(DuplicateCheckVo duplicateCheckVo, HttpServletRequest request) {
log.debug("----duplicate check------"+ duplicateCheckVo.toString()); log.debug("----duplicate check------"+ duplicateCheckVo.toString());

View File

@ -5,8 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.exceptions.ClientException; import com.aliyuncs.exceptions.ClientException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresRoles; import org.apache.shiro.authz.annotation.RequiresRoles;
@ -34,9 +34,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -46,7 +46,7 @@ import java.util.stream.Collectors;
*/ */
@RestController @RestController
@RequestMapping("/sys") @RequestMapping("/sys")
@Api(tags="用户登录") @Tag(name="用户登录")
@Slf4j @Slf4j
public class LoginController { public class LoginController {
@Autowired @Autowired
@ -70,7 +70,7 @@ public class LoginController {
private final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890"; private final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
@ApiOperation("登录接口") @Operation(summary = "登录接口")
@RequestMapping(value = "/login", method = RequestMethod.POST) @RequestMapping(value = "/login", method = RequestMethod.POST)
public Result<JSONObject> login(@RequestBody SysLoginModel sysLoginModel){ public Result<JSONObject> login(@RequestBody SysLoginModel sysLoginModel){
Result<JSONObject> result = new Result<JSONObject>(); Result<JSONObject> result = new Result<JSONObject>();
@ -395,7 +395,7 @@ public class LoginController {
* @param jsonObject * @param jsonObject
* @return * @return
*/ */
@ApiOperation("手机号登录接口") @Operation(summary ="手机号登录接口")
@PostMapping("/phoneLogin") @PostMapping("/phoneLogin")
public Result<JSONObject> phoneLogin(@RequestBody JSONObject jsonObject) { public Result<JSONObject> phoneLogin(@RequestBody JSONObject jsonObject) {
Result<JSONObject> result = new Result<JSONObject>(); Result<JSONObject> result = new Result<JSONObject>();
@ -507,7 +507,7 @@ public class LoginController {
* @param response * @param response
* @param key * @param key
*/ */
@ApiOperation("获取验证码") @Operation(summary ="获取验证码")
@GetMapping(value = "/randomImage/{key}") @GetMapping(value = "/randomImage/{key}")
public Result<String> randomImage(HttpServletResponse response,@PathVariable("key") String key){ public Result<String> randomImage(HttpServletResponse response,@PathVariable("key") String key){
Result<String> res = new Result<String>(); Result<String> res = new Result<String>();
@ -648,7 +648,7 @@ public class LoginController {
/** /**
* 登录二维码 * 登录二维码
*/ */
@ApiOperation(value = "登录二维码", notes = "登录二维码") @Operation(summary = "登录二维码")
@GetMapping("/getLoginQrcode") @GetMapping("/getLoginQrcode")
public Result<?> getLoginQrcode() { public Result<?> getLoginQrcode() {
String qrcodeId = CommonConstant.LOGIN_QRCODE_PRE+IdWorker.getIdStr(); String qrcodeId = CommonConstant.LOGIN_QRCODE_PRE+IdWorker.getIdStr();
@ -662,7 +662,7 @@ public class LoginController {
/** /**
* 扫码二维码 * 扫码二维码
*/ */
@ApiOperation(value = "扫码登录二维码", notes = "扫码登录二维码") @Operation(summary = "扫码登录二维码")
@PostMapping("/scanLoginQrcode") @PostMapping("/scanLoginQrcode")
public Result<?> scanLoginQrcode(@RequestParam String qrcodeId, @RequestParam String token) { public Result<?> scanLoginQrcode(@RequestParam String qrcodeId, @RequestParam String token) {
Object check = redisUtil.get(CommonConstant.LOGIN_QRCODE + qrcodeId); Object check = redisUtil.get(CommonConstant.LOGIN_QRCODE + qrcodeId);
@ -679,7 +679,7 @@ public class LoginController {
/** /**
* 获取用户扫码后保存的token * 获取用户扫码后保存的token
*/ */
@ApiOperation(value = "获取用户扫码后保存的token", notes = "获取用户扫码后保存的token") @Operation(summary = "获取用户扫码后保存的token")
@GetMapping("/getQrcodeToken") @GetMapping("/getQrcodeToken")
public Result getQrcodeToken(@RequestParam String qrcodeId) { public Result getQrcodeToken(@RequestParam String qrcodeId) {
Object token = redisUtil.get(CommonConstant.LOGIN_QRCODE_TOKEN + qrcodeId); Object token = redisUtil.get(CommonConstant.LOGIN_QRCODE_TOKEN + qrcodeId);

View File

@ -47,9 +47,9 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource; import jakarta.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;

View File

@ -3,7 +3,7 @@ package org.jeecg.modules.system.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;

View File

@ -32,8 +32,8 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;

View File

@ -4,8 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
@ -17,8 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.util.Arrays; import java.util.Arrays;
@ -30,7 +30,7 @@ import java.util.Arrays;
* @Version: V1.0 * @Version: V1.0
*/ */
@Slf4j @Slf4j
@Api(tags = "编码校验规则") @Tag(name = "编码校验规则")
@RestController @RestController
@RequestMapping("/sys/checkRule") @RequestMapping("/sys/checkRule")
public class SysCheckRuleController extends JeecgController<SysCheckRule, ISysCheckRuleService> { public class SysCheckRuleController extends JeecgController<SysCheckRule, ISysCheckRuleService> {
@ -48,7 +48,7 @@ public class SysCheckRuleController extends JeecgController<SysCheckRule, ISysCh
* @return * @return
*/ */
@AutoLog(value = "编码校验规则-分页列表查询") @AutoLog(value = "编码校验规则-分页列表查询")
@ApiOperation(value = "编码校验规则-分页列表查询", notes = "编码校验规则-分页列表查询") @Operation(summary = "编码校验规则-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result queryPageList( public Result queryPageList(
SysCheckRule sysCheckRule, SysCheckRule sysCheckRule,
@ -70,7 +70,7 @@ public class SysCheckRuleController extends JeecgController<SysCheckRule, ISysCh
* @return * @return
*/ */
@AutoLog(value = "编码校验规则-通过Code校验传入的值") @AutoLog(value = "编码校验规则-通过Code校验传入的值")
@ApiOperation(value = "编码校验规则-通过Code校验传入的值", notes = "编码校验规则-通过Code校验传入的值") @Operation(summary = "编码校验规则-通过Code校验传入的值")
@GetMapping(value = "/checkByCode") @GetMapping(value = "/checkByCode")
public Result checkByCode( public Result checkByCode(
@RequestParam(name = "ruleCode") String ruleCode, @RequestParam(name = "ruleCode") String ruleCode,
@ -97,7 +97,7 @@ public class SysCheckRuleController extends JeecgController<SysCheckRule, ISysCh
* @return * @return
*/ */
@AutoLog(value = "编码校验规则-添加") @AutoLog(value = "编码校验规则-添加")
@ApiOperation(value = "编码校验规则-添加", notes = "编码校验规则-添加") @Operation(summary = "编码校验规则-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result add(@RequestBody SysCheckRule sysCheckRule) { public Result add(@RequestBody SysCheckRule sysCheckRule) {
sysCheckRuleService.save(sysCheckRule); sysCheckRuleService.save(sysCheckRule);
@ -111,7 +111,7 @@ public class SysCheckRuleController extends JeecgController<SysCheckRule, ISysCh
* @return * @return
*/ */
@AutoLog(value = "编码校验规则-编辑") @AutoLog(value = "编码校验规则-编辑")
@ApiOperation(value = "编码校验规则-编辑", notes = "编码校验规则-编辑") @Operation(summary = "编码校验规则-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result edit(@RequestBody SysCheckRule sysCheckRule) { public Result edit(@RequestBody SysCheckRule sysCheckRule) {
sysCheckRuleService.updateById(sysCheckRule); sysCheckRuleService.updateById(sysCheckRule);
@ -125,7 +125,7 @@ public class SysCheckRuleController extends JeecgController<SysCheckRule, ISysCh
* @return * @return
*/ */
@AutoLog(value = "编码校验规则-通过id删除") @AutoLog(value = "编码校验规则-通过id删除")
@ApiOperation(value = "编码校验规则-通过id删除", notes = "编码校验规则-通过id删除") @Operation(summary = "编码校验规则-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result delete(@RequestParam(name = "id", required = true) String id) { public Result delete(@RequestParam(name = "id", required = true) String id) {
sysCheckRuleService.removeById(id); sysCheckRuleService.removeById(id);
@ -139,7 +139,7 @@ public class SysCheckRuleController extends JeecgController<SysCheckRule, ISysCh
* @return * @return
*/ */
@AutoLog(value = "编码校验规则-批量删除") @AutoLog(value = "编码校验规则-批量删除")
@ApiOperation(value = "编码校验规则-批量删除", notes = "编码校验规则-批量删除") @Operation(summary = "编码校验规则-批量删除")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.sysCheckRuleService.removeByIds(Arrays.asList(ids.split(","))); this.sysCheckRuleService.removeByIds(Arrays.asList(ids.split(",")));
@ -153,7 +153,7 @@ public class SysCheckRuleController extends JeecgController<SysCheckRule, ISysCh
* @return * @return
*/ */
@AutoLog(value = "编码校验规则-通过id查询") @AutoLog(value = "编码校验规则-通过id查询")
@ApiOperation(value = "编码校验规则-通过id查询", notes = "编码校验规则-通过id查询") @Operation(summary = "编码校验规则-通过id查询")
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
public Result queryById(@RequestParam(name = "id", required = true) String id) { public Result queryById(@RequestParam(name = "id", required = true) String id) {
SysCheckRule sysCheckRule = sysCheckRuleService.getById(id); SysCheckRule sysCheckRule = sysCheckRuleService.getById(id);

Some files were not shown because too many files have changed in this diff Show More