Compare commits

..

100 Commits

Author SHA1 Message Date
e877929a42 Merge branch 'HEAD' of https://github.com/jeecgboot/JeecgBoot.git 2025-04-08 22:05:42 +08:00
5f5970d7d5 解决钉钉登录报错 class com.alibaba.fastjson2.JSONObject cannot be cast to class com.alibaba.fastjson.JSONObject 2025-04-08 22:05:20 +08:00
e05c9ddc08 Merge pull request #8073 from EightMonth/master
新增controller测试用例
2025-04-08 16:27:43 +08:00
b77e9e25a3 AI功能介绍 2025-04-08 15:51:11 +08:00
8c406dcdea 项目介绍 2025-04-08 11:44:45 +08:00
215b263d1a 项目介绍 2025-04-08 11:41:21 +08:00
4247ffd082 AIGC专题介绍页 2025-04-08 11:04:32 +08:00
ec87621858 AI流程大模型功能 2025-04-08 10:48:24 +08:00
bc6cf0e7b4 Merge branch 'HEAD' of https://github.com/jeecgboot/JeecgBoot.git 2025-04-08 09:56:48 +08:00
353ad058d1 AIGC 功能视频介绍 2025-04-08 09:56:32 +08:00
cf63b056d5 新增controller测试用例 2025-04-08 09:20:00 +08:00
f743622655 Merge pull request #8066 from EightMonth/master
编写单个controller的测试用例
2025-04-07 16:08:30 +08:00
70a1f0b7db 编写单个controller的测试用例 2025-04-07 15:59:46 +08:00
bb4cdf93b1 Merge pull request #8059 from EightMonth/master
优化swagger文档架构改造
2025-04-04 23:05:37 +08:00
7d7fde63ec 【issues/7996】表格列组件取消所有或者只勾选中间,显示非预期 2025-04-04 22:46:30 +08:00
c22fd21233 【issues/7812】linkageConfig改变了,vxetable没更新 2025-04-04 22:45:00 +08:00
d4d0c884f0 归集spring-doc默认配置 2025-04-03 22:31:26 +08:00
e6fe3459e4 配置调整 2025-04-03 18:17:43 +08:00
9ebc3c49ec 优化swagger文档架构改造 2025-04-03 17:54:51 +08:00
45e9b03e2d app地址修改 2025-04-03 12:05:47 +08:00
696b65240f AI大模型支持 2025-04-03 12:03:34 +08:00
f4339677e7 版本发布日期调整 2025-04-03 11:50:05 +08:00
0aaf0ad3ad AIGC应用平台介绍 2025-04-03 11:33:45 +08:00
0e5cd5bb3e AIGC介绍 2025-04-03 11:29:26 +08:00
24406a4cac AI介绍 2025-04-03 11:27:53 +08:00
1a1c840a3b AI功能展示 2025-04-03 11:25:29 +08:00
2e257343a4 aigc独立专题介绍页面 2025-04-03 11:20:05 +08:00
7871c465c8 ERP风格内嵌子表生成源代码,展开子表的会根据展开的次数进行创建销毁子表的组件 2025-04-03 10:09:36 +08:00
714d9dc244 解决启动警告 WARN io.undertow.websockets.jsr:68 - UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used 2025-04-03 00:00:18 +08:00
f23b176cf4 fix: update link text for GitHub URL in header 2025-04-02 22:45:42 +08:00
494f5e21f5 undertow配置、增加springdoc配置、简化flyway配置 2025-04-01 22:02:39 +08:00
dea260cae3 注释掉日志打印 2025-04-01 21:35:45 +08:00
0fcc08c204 fix: update import path for AiChatProperties in ChatServiceImpl 2025-04-01 21:33:08 +08:00
608d2e1318 Merge pull request #8038 from EightMonth/knife_biz
Knife4j升级4.4.0 业务代码改动
2025-04-01 21:28:35 +08:00
7e436f2efd Merge pull request #8039 from EightMonth/knife_arch
Knife4j升级4.4.0 架构代码改动
2025-04-01 21:28:23 +08:00
c18fb68e81 接口文档调整,为免登录接口排除token校验请求头 2025-04-01 17:01:58 +08:00
299f63c6e9 修改token验证请求头信息及排除不需要的接口信息 2025-04-01 15:05:08 +08:00
20037ae02b 添加误移除内容 2025-03-31 16:36:43 +08:00
dcdbb5ac7a 3.7.4 版本数据库脚本 2025-03-31 16:11:25 +08:00
cd9ba3bac9 新增改动 2025-03-31 15:58:26 +08:00
060bf2282c 更新readme 2025-03-31 15:15:17 +08:00
d88f2f81e9 knife4j升级4.4.0注解改造 2025-03-31 14:54:06 +08:00
18cc746fcf 升级java-jwt到4.5.0 2025-03-31 14:35:47 +08:00
fcc7842e89 修改自动生成接口文档范围
(cherry picked from commit ff58a1dd26)
2025-03-31 14:32:33 +08:00
e91af8cfd3 knife4j升级4.4.0架构改造 2025-03-31 14:25:56 +08:00
a57cc1fa3d 3.7.4 版本升级online在线开发模块 2025-03-31 14:23:05 +08:00
80d37f9a03 3.7.4 版本升级online在线开发模块 2025-03-31 11:58:30 +08:00
502ef2f65d 【同步3.7.4版本代码】新增全局布局隐藏配置,优化多个组件的属性和逻辑 2025-03-30 19:09:07 +08:00
62daec9c16 3.7.4 版本增量升级SQL 2025-03-30 18:40:49 +08:00
9191a8b620 【3.7.4 开源代码同步】新增断言异常类和断言工具类,优化JWT工具类,更新文件类型白名单,切换undertow配置,修改多个YAML配置文件 2025-03-30 17:51:55 +08:00
4fb53637aa 支持数据库说明 2025-03-28 18:32:58 +08:00
178a2368cb 3.7.4(预计发布日期:2025-04-10,代码逐步提交) 2025-03-28 09:35:57 +08:00
0813dee0d4 优化oConvertUtils中childArray转换逻辑 2025-03-27 19:47:09 +08:00
9579a60abd jdk支持说明:支持jdk8、17、21 2025-03-27 19:38:46 +08:00
5cd5bf7a0b 移除冗余Flyway配置,优化application.yml文件 2025-03-27 18:48:03 +08:00
c0265981d1 视频介绍 2025-03-27 18:43:18 +08:00
2ec13165d3 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	jeecg-boot/pom.xml
2025-03-27 18:26:20 +08:00
ac5ee60364 Merge pull request #8027 from EightMonth/master
移除junit4,使用默认junit5
2025-03-27 18:09:34 +08:00
5ff1b56fe2 移除junit4,使用默认junit5 2025-03-27 16:58:35 +08:00
ea914be3a6 升级至3.7.4,更新Dockerfile及jdk依赖 2025-03-27 15:19:41 +08:00
cb65e1796c 【3.7.4版本底层依赖大升级】
默认改成JDK17;fastjson升级至2.0.56;升级spring-cloud小版本;升级jimureport到最新版1.9.5;升级weixin4j到2.0.1;
spring-cloud >2021.0.8
spring-cloud-alibaba >2021.0.6.2
2025-03-27 15:19:00 +08:00
ff815f1ae6 更新版本至3.7.4并调整发布时间 2025-03-27 15:17:48 +08:00
c8ebdc162f 更新版本至3.7.4并调整发布时间 2025-03-27 15:17:08 +08:00
76df4f8600 Merge pull request #8006 from EightMonth/master
回退 "fastjson升级至2.0.43"
2025-03-25 15:04:30 +08:00
a27b94c4c6 Revert "fastjson升级至2.0.43"
This reverts commit d87ffc11e7.
2025-03-25 14:55:36 +08:00
5ad06274cb 升级shiro至1.13.0及shiro-redis至3.2.3 2025-03-25 14:34:31 +08:00
d38fa1901e Merge pull request #8003 from EightMonth/master
fastjson升级至2.0.43
2025-03-25 14:29:10 +08:00
b4aab76057 Merge branch 'master' of https://github.com/EightMonth/jeecg-boot 2025-03-25 14:00:58 +08:00
d87ffc11e7 fastjson升级至2.0.43 2025-03-25 14:00:43 +08:00
a67b3409b1 Merge pull request #7981 from EightMonth/master
修复 #7951 CVE-2023-6378
2025-03-21 23:38:08 +08:00
e11d831114 修复 #7951 CVE-2023-6378 2025-03-20 16:50:37 +08:00
ec410456b2 Merge pull request #7879 from yangyang122/feature/tenant_edit_role
in tenant mode, edit role constraints change
2025-03-20 10:46:46 +08:00
e9326cab8c Merge pull request #7651 from testnet0/master
修复flyway自动升级失败
2025-03-20 10:39:08 +08:00
61d2857ca7 【issues/7940】componentProps写成函数形式时,updateSchema写成对象时,参数没合并 --- 2025-03-20 10:09:48 +08:00
cba4847413 【issues/7948】修复JselectRole组件不支持双向绑定 --- 2025-03-20 10:09:06 +08:00
bc56384325 【issues/7954】BasicUpload组件上传文件,限制上传格式校验出错 --- 2025-03-20 10:08:20 +08:00
d7dc1b8dc7 【issues/7956】修复showSummary: false时且有内嵌子表时合计栏错位 2025-03-20 10:06:57 +08:00
11d9f2b4e4 视频介绍 2025-03-18 10:10:33 +08:00
64fcf7fcfc 提供完整的初始化sql 含积木报表最新增量sql 2025-03-16 16:04:43 +08:00
e6ddeef18c 默认关闭AI助手悬浮按钮 2025-03-13 09:53:05 +08:00
47a074d9cb 解决严重bug,War包方式部署,服务启动报错 2025-03-11 09:43:39 +08:00
c32f0407e8 更新README.md,添加AI大模型文档链接 2025-03-09 16:38:00 +08:00
22bbc23069 更新README.md,优化AI功能列表及支持模型 2025-03-07 18:25:33 +08:00
b2078d502a 更新README.md,添加AI平台支持及功能介绍 2025-03-07 18:20:10 +08:00
ed165464c8 升级druid版本到1.2.24 #7869
升级jeewx-api版本到weixin4j 2.0.0
2025-03-07 15:55:09 +08:00
9cf66e7026 Merge branch 'master' of https://github.com/zhangdaiscott/jeecg-boot 2025-03-06 22:04:19 +08:00
11f8038196 AIGC功能模块即将出炉 2025-03-06 22:03:29 +08:00
d2105dc095 in tenant mode, edit role constraints change 2025-03-04 14:58:38 +08:00
32287d98ac Merge pull request #7833 from hoperunChen/QQYUN/QQYUN-10958
[QQYUN-10958]删除jeecgboot中的MongoAutoConfiguration,因为jm-nosql中已经有了
2025-03-03 17:19:27 +08:00
31cf94ac7b Merge pull request #7850 from EightMonth/master
修复 #7702
2025-03-03 16:38:39 +08:00
0d28c92c83 master分支默认jdk8 2025-03-02 17:57:26 +08:00
1cc5cee92d 升级项目介绍 2025-03-02 17:53:04 +08:00
26246eda7a 升级druid版本到1.2.24 #7869
升级jeewx-api版本到weixin4j 2.0.0
2025-03-02 17:49:29 +08:00
10dd2a2dd0 反馈bug 2025-02-28 16:05:08 +08:00
5abc745496 jeecg官方文档更新 2025-02-26 10:30:57 +08:00
353e8e2fb6 [issues/7288]数据权限,查看自己拥有部门的权限中存在问题 #7288--- 2025-02-24 22:49:58 +08:00
56661815ec 【issues/7830】合计小数计算精度 --- 2025-02-24 22:48:45 +08:00
03b6d20fcb 修复 #7702 2025-02-24 17:33:52 +08:00
2388c8c46d [QQYUN-10958]删除jeecgboot中的MongoAutoConfiguration,因为jm-nosql中已经有了 2025-02-20 10:43:20 +08:00
ac30ed67bc 修复flyway自动升级失败 2024-12-25 15:38:39 +08:00
396 changed files with 7194 additions and 4545 deletions

163
README-AI.md Normal file
View File

@ -0,0 +1,163 @@
AIGC应用平台介绍
===============
即将发布:`最新版本 V3.8.0发布提供Jeecg AIGC 提供AI应用平台+知识库问答`
> JeecgBoot 平台的AIGC功能模块是一套类似`Dify`的`AIGC应用开发平台`+`知识库问答`是一款基于LLM大语言模型AI应用平台和 RAG 的知识库问答系统。
其直观的界面结合了 AI 流程编排、RAG 管道、知识库管理、模型管理、对接向量库、实时运行可观察等让您可以快速从原型到生产拥有AI服务能力。
### AI视频介绍
[![](https://jeecgos.oss-cn-beijing.aliyuncs.com/files/jeecg_aivideo.png)](https://www.bilibili.com/video/BV1zmd7YFE4w)
#### Dify `VS` JEECG AI
> JEECG AI与Dify相比在多个方面展现出显著的优势特别是在文档处理、格式和图片保持方面。以下是一些具体的优点
> - Markdown文档库导入
> JEECG AI允许用户直接导入整个Markdown文档库这不仅保留markdown格式还支持图片的导入确保文档内容的完整性和可视化效果。
> - 对话回复格式美观:
> 在对话过程中JEECG AI能够保持回复内容的原格式也不丢失图片使得输出的文章更加美观不会出现格式错乱的情况还支持图片的渲染。
> - PDF文档导入与格式转换
> JEECG AI在处理PDF文档时能够更好地保持原始格式和图片确保转换后的内容与原始文档一致。这哥功能在许多AI产品中表现不佳而JEECG AI在这方面做出了显著的优化
| 功能 | Dify | Jeecg AI |
| --- | --- | --- |
| AI工作流 | 有 | 有 |
| RAG 管道向量搜索 | 有 | 有 |
| AI模型管理 | 有 | 有 |
| AI应用管理 | 有 | 有 |
| AI知识库 | 有 | 有 |
| 产品方向 | 一款独立的 LLM 应用开发平台 | 低代码与AIGC应用二者结合的平台 |
| 业务集成 | 业务集成能力弱 | 更方便与业务系统集成,调用系统接口和逻辑更加方便 |
| AI业务流 | 侧重AI逻辑流程 | AI流程编排作为低代码的业务引擎用户可以通过AI流程配置各种业务流和AI流程 |
| 上传markdown文档库(支持图片) | 不支持 | 支持 |
| AI对话支持发图和展示图片 | 支持 | 支持 |
| 实现语言 | python + react | JAVA + vue3 |
| 功能 | Dify | Jeecg AI |
|------------|------------------|-----------------------------------------|
| AI工作流 | 有 | 有 |
| RAG 管道向量搜索 | 有 | 有 |
| AI模型管理 | 有 | 有 |
| AI应用管理 | 有 | 有 |
| AI知识库 | 有 | 有 |
| 产品方向 | 一款独立的 LLM 应用开发平台 | 低代码与AIGC应用二者结合的平台 |
| 业务集成 | 业务集成能力弱 | 更方便与业务系统集成,调用系统接口和逻辑更加方便 |
| AI业务流 | 侧重AI逻辑流程 | AI流程编排作为低代码的业务引擎用户可以通过AI流程配置各种业务流和AI流程 |
| 实现语言 | python + react | JAVA + vue3 |
| 上传markdown文档库(支持图片) | 不支持 | 支持 |
| AI对话支持发图和展示图片 | 支持 | 支持 |
## 功能特点
- AI流程: 提供强大的AI流程设计器引擎支持编排 AI 工作过程,满足复杂业务场景,支持画布上构建和实时运行查看 AI流程运行情况。
- AI流程即服务: 通过AI流程编排你需要的智能体结合AI+自定义开发节点 实现功能性 API让你瞬间拥有各种智能体API。
- AI助手对话功能: 集成 ChatGPT、Deepseek、智普、私有大模型 等 AI 模型,提供智能对话和生成式 AI 功能,深度与知识库结合提供更精准的知识。
- RAG 功能: 涵盖从文档摄入到检索的所有内容,支持从 PDF、PPT 和其他常见文档格式中提取文本支持检索增强生成RAG将未训练数据与 AI 模型集成,提升智能交互能力。
- AI 知识库: 通过导入文档或已有问答对进行训练,让 AI 模型能根据文档以交互式对话方式回答问题。
- 模型管理支持对接各种大模型包括本地私有大模型Deepseek/ Llama 3 / Qwen 2 等)、国内公共大模型(通义千问 / 腾讯混元 / 字节豆包 / 百度千帆 / 智谱 AI / Kimi 等和国外公共大模型OpenAI / Claude / Gemini 等);
- 无缝嵌入Iframe一键嵌入,支持将AI聊天助手快速嵌入到第三方系统让系统快速拥有智能问答能力提高用户满意度。
## 产品体验
- 使用手册https://help.jeecg.com/aigc
- 演示地址https://boot3.jeecg.com
## 功能列表
- AI应用管理(普通应用、高级流程应用)
- AI模型管理
- AI知识库
- AI应用平台(普通、对接AI流程)
- AI流程编排
- AI聊天支持嵌入第三方
- AI向量库对接
## 支持AI模型
| AI大模型 | 支持 |
|---------------| --- |
| DeepSeek | √ |
| ChatGTP | √ |
| Qwq | √ |
| 智库 | √ |
| Ollama本地搭建大模型 | √ |
| 等等。。 | √ |
## AIGC能做什么
AIGC模块是一个基于AI的自动化流程编排工具和聊天应用搭建平台它可以帮助用户快速生成AI流程接口和聊天应用提高效率。
以下是一些具体的应用场景和示例:
- 你可能需要一个翻译接口可以通过AI流程编排搭建出来。
- 你可能需要一个接口转换工具可以通过AI流程编排搭建出来。比如jimureport所需要接口返回格式与你的系统不同你通过AI接口实现自动转换
- 你可能需要一个聊天机器人可以通过AI流程编排搭建出来。
- 你可能需要一个自动化流程可以通过AI流程编排搭建出来。
- 你可能需要一个自动化处理文件的流程可以通过AI流程结合python脚本实现操作电脑文件等。
## AI应用平台功能展示
AI模型列表
![](https://oscimg.oschina.net/oscnet//a5fb3e0d69ca1706b0de221535c7acaa.png)
选择AI模型配置你的参数
![](https://oscimg.oschina.net/oscnet//1f941472758a5fc227f54f2683953b8e.png)
AI知识库支持手工录入文本导入pdf\\word\\excel等文档支持问答对训练
![](https://oscimg.oschina.net/oscnet//150bb33f48d6c8e2ae059e2a58f4200b.png)
![](https://oscimg.oschina.net/oscnet//032d16c915b0f79318935484c81df260.png)
AI流程提供强大的AI流程设计器引擎支持编排 AI 工作过程,满足复杂业务场景,支持画布上构建和实时运行查看 AI流程运行情况。
![](https://oscimg.oschina.net/oscnet//f40f9aa275cd4aea94e1c209513151e2.png)
目前支持的节点有开始、结束、AI知识库节点、AI节点、分类节点、分支节点、JAVA节点、脚本节点、子流程节点、http请求节点、直接回复节点等节点
![](https://oscimg.oschina.net/oscnet//6d86480ab1bbfab5b2e6992b416b2152.png)
节点项配置
![](https://oscimg.oschina.net/oscnet//90a5f76b6b4fc406e2e2b87245b35459.png)
在线运行看结果
![](https://oscimg.oschina.net/oscnet//bc9817a7bbd94936a5a3e885abe3cb38.png)
AI应用配置支持AI流程配置和简单的AI配置
![](https://oscimg.oschina.net/oscnet//a853d9be4d3756806799ad025e722df8.png)![](https://oscimg.oschina.net/oscnet//d3bcbf5977c6fb75a8f996e1e40590be.png)
可以关联多个知识库右侧是AI智能回复你可以搭建自己的智能体比如搭建一个 “诗词达人” “翻译助手”
![](https://oscimg.oschina.net/oscnet//c26a848136be3e22ec1e0651e78976c2.png)
可以将创建的聊天应用,集成到第三方系统中
![](https://oscimg.oschina.net/oscnet//39c6f589ef46f0454b229915ffa263f4.png)

View File

@ -7,12 +7,12 @@
JEECG BOOT AI Low Code Platform JEECG BOOT AI Low Code Platform
=============== ===============
Current version: 3.7.3 (Release date: 2025-02-10) Current version: 3.7.4 (Release date: 2025-04-07)
[![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/version-3.7.3-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot) [![](https://img.shields.io/badge/version-3.7.4-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)
@ -37,7 +37,7 @@ AI Empowering Low-Code: Currently, JeecgBoot supports AI large models such as Ch
Technical support Technical support
----------------------------------- -----------------------------------
Problems or bugs in use can be found in [Making on the Issues](https://github.com/jeecgboot/JeecgBoot/issues/new) Problems or bugs in use can be found in [Making on the Issues](https://github.com/jeecgboot/JeecgBoot/issues/new?template=bug_report.md)
##### Project description ##### Project description
@ -49,6 +49,11 @@ Problems or bugs in use can be found in [Making on the Issues](https://github.co
| `jeecg-uniapp` | [APP development framework, a code multi terminal adaptation, and support APP, small program, H5](https://github.com/jeecgboot/jeecg-uniapp) | | `jeecg-uniapp` | [APP development framework, a code multi terminal adaptation, and support APP, small program, H5](https://github.com/jeecgboot/jeecg-uniapp) |
### Video Introduction
[![](https://upload.jeecg.com/jeecg/qiaoqiaoyunsite/jeecgvideo02.png)](https://www.bilibili.com/video/BV1Nk4y1o7Qc)
Download other source code Download other source code
----------------------------------- -----------------------------------
@ -64,8 +69,8 @@ Jeecg-Boot AI low code platform can be applied in the development of any J2EE pr
Starts the project Starts the project
----------------------------------- -----------------------------------
- [IDEA Quick start](https://help.jeecg.com/java/setup/idea/startup.html) - [IDEA Quick start](https://help.jeecg.com/java/setup/idea/startup)
- [Docker Quick start](https://help.jeecg.com/java/docker/quick.html) - [Docker Quick start](https://help.jeecg.com/java/docker/quick)
@ -74,9 +79,9 @@ Technical documentation
- Website [http://www.jeecg.com](http://www.jeecg.com) - Website [http://www.jeecg.com](http://www.jeecg.com)
- Demo [OnlineDemo](http://boot3.jeecg.com) | [APP](http://jeecg.com/appIndex) - Demo [OnlineDemo](http://boot3.jeecg.com) | [APP](http://jeecg.com/appIndex)
- Doc [DocumentCenter](http://help.jeecg.com) | [AI Config](https://help.jeecg.com/java/ai/aichat.html) - Doc [DocumentCenter](http://help.jeecg.com) | [AI Config](https://help.jeecg.com/java/ai/aichat)
- Newbie guide [Quick start](http://www.jeecg.com/doc/quickstart) | [Q&A ](http://www.jeecg.com/doc/qa) | [1 minute experience](https://my.oschina.net/jeecg/blog/3083313) - Newbie guide [Quick start](http://www.jeecg.com/doc/quickstart) | [Q&A ](http://www.jeecg.com/doc/qa) | [1 minute experience](https://my.oschina.net/jeecg/blog/3083313)
- QQ group ⑩716488839、⑨808791225、⑧825232878、⑦791696430、⑥730954414(full)、683903138(full)、⑤860162132(full)、④774126647(full)、③816531124(full)、②769925425(full)、①284271917(full) - QQ group ⑩716488839、⑨808791225
@ -176,7 +181,7 @@ Technical Architecture:
#### Development Environment #### Development Environment
- Language: Java 8+ (17) - Language: Java Default Jdk17(support jdk8、jdk21)
- IDE(JAVA) : IDEA (lombok plug-in must be installed) - IDE(JAVA) : IDEA (lombok plug-in must be installed)
@ -193,17 +198,17 @@ Technical Architecture:
- Basic framework: Spring Boot 2.7.18 - Basic framework: Spring Boot 2.7.18
- Microservice framework: Spring Cloud Alibaba 2021.0.1.0 - Microservice framework: Spring Cloud Alibaba 2021.0.6.2
- Persistence layer framework: MybatisPlus 3.5.3.2 - Persistence layer framework: MybatisPlus 3.5.3.2
- Report tool: JimuReport 1.9.3 - Report tool: JimuReport 1.9.5
- Security framework: Apache Shiro 1.12.0, Jwt 3.11.0 - Security framework: Apache Shiro 1.13.0, Jwt 4.5.0
- Microservice technology stack: Spring Cloud Alibaba, Nacos, Gateway, Sentinel, Skywalking - Microservice technology stack: Spring Cloud Alibaba, Nacos, Gateway, Sentinel, Skywalking
- Database connection pool: Alibaba Druid 1.1.22 - Database connection pool: Alibaba Druid 1.1.24
- Log printing: logback - Log printing: logback
@ -242,8 +247,16 @@ Technical Architecture:
| --- | --- | | --- | --- |
| DeepSeek | √ | | DeepSeek | √ |
| ChatGPT | √ | | ChatGPT | √ |
| Qwq | √ |
| 智库 | √ |
| Ollama本地搭建大模型 | √ |
| 等等。。 | √ |
AI Config https://help.jeecg.com/java/ai/aichat
AI APP: https://help.jeecg.com/aigc
AI Config https://help.jeecg.com/java/ai/aichat.html
## Microservice solutions ## Microservice solutions
@ -255,7 +268,7 @@ AI Config https://help.jeecg.com/java/ai/aichat.html
- 6. Distributed files Minio and Alioss √ - 6. Distributed files Minio and Alioss √
- 7. Unified permission control - 7. Unified permission control
- 8. Service monitoring SpringBootAdmin√ - 8. Service monitoring SpringBootAdmin√
- 9. link tracking Skywalking [reference document](https://help.jeecg.com/java/springcloud/super/skywarking.html) - 9. link tracking Skywalking [reference document](https://help.jeecg.com/java/springcloud/super/skywarking)
- 10. Messaging middleware RabbitMQ √ - 10. Messaging middleware RabbitMQ √
- 11. Distributed task xxl-job √ - 11. Distributed task xxl-job √
- 12. Distributed Transaction Seata - 12. Distributed Transaction Seata
@ -272,8 +285,8 @@ AI Config https://help.jeecg.com/java/ai/aichat.html
![功能蓝图](https://jeecgos.oss-cn-beijing.aliyuncs.com/upload/test/Jeecg-Boot-lantu202005_1590912449914.jpg "在这里输入图片标题") ![功能蓝图](https://jeecgos.oss-cn-beijing.aliyuncs.com/upload/test/Jeecg-Boot-lantu202005_1590912449914.jpg "在这里输入图片标题")
### quick start ### quick start
- Microservice Development [Monomer upgrade to microservice](https://help.jeecg.com/java/springcloud/switchcloud/monomer.html) - Microservice Development [Monomer upgrade to microservice](https://help.jeecg.com/java/springcloud/switchcloud/monomer)
- [Docker starts the micro-service background](https://help.jeecg.com/java/docker/springcloud.html) - [Docker starts the micro-service background](https://help.jeecg.com/java/docker/springcloud)
### Effect of system ### Effect of system

117
README.md
View File

@ -2,12 +2,12 @@
JeecgBoot AI低代码平台 JeecgBoot AI低代码平台
=============== ===============
当前最新版本: 3.7.3发布日期2025-02-10 当前最新版本: 3.7.4发布日期2025-04-07
[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/jeecgboot/JeecgBoot/blob/master/LICENSE) [![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/jeecgboot/JeecgBoot/blob/master/LICENSE)
[![](https://img.shields.io/badge/Author-北京国炬软件-orange.svg)](http://guojusoft.com) [![](https://img.shields.io/badge/Author-北京国炬软件-orange.svg)](http://guojusoft.com)
[![](https://img.shields.io/badge/version-3.7.3-brightgreen.svg)](https://github.com/jeecgboot/JeecgBoot) [![](https://img.shields.io/badge/version-3.7.4-brightgreen.svg)](https://github.com/jeecgboot/JeecgBoot)
[![GitHub stars](https://img.shields.io/github/stars/zhangdaiscott/jeecg-boot.svg?style=social&label=Stars)](https://github.com/jeecgboot/JeecgBoot) [![GitHub stars](https://img.shields.io/github/stars/zhangdaiscott/jeecg-boot.svg?style=social&label=Stars)](https://github.com/jeecgboot/JeecgBoot)
[![GitHub forks](https://img.shields.io/github/forks/zhangdaiscott/jeecg-boot.svg?style=social&label=Fork)](https://github.com/jeecgboot/JeecgBoot) [![GitHub forks](https://img.shields.io/github/forks/zhangdaiscott/jeecg-boot.svg?style=social&label=Fork)](https://github.com/jeecgboot/JeecgBoot)
@ -30,24 +30,25 @@ JeecgBoot 提供了一系列 `AI能力` `低代码模块`,实现在线开发`
`AI赋能低代码:` 目前JeecgBoot支持AI大模型`ChatGPT``DeepSeek`,现在最新版默认使用`DeepSeek`速度更快质量更高。目前提供了AI对话助手、AI建表、AI报表、AI写文章、AI流程编排、AI知识库问答等功能。 `AI赋能低代码:` 目前JeecgBoot支持AI大模型`ChatGPT``DeepSeek`,现在最新版默认使用`DeepSeek`速度更快质量更高。目前提供了AI对话助手、AI建表、AI报表、AI写文章、AI流程编排、AI知识库问答等功能。
### 视频介绍
[![](https://jeecgos.oss-cn-beijing.aliyuncs.com/files/flow_video.png)](https://www.bilibili.com/video/BV1Nk4y1o7Qc)
适用项目 适用项目
----------------------------------- -----------------------------------
JeecgBoot AI低代码平台可以应用在任何J2EE项目的开发中支持信创国产化默认适配达梦和人大金仓。尤其适合SAAS项目、企业信息管理系统MIS、内部办公系统OA、企业资源计划系统ERP、客户关系管理系统CRM其半智能手工Merge的开发方式可以显著提高开发效率70%以上,极大降低开发成本。 JeecgBoot AI低代码平台可以应用在任何J2EE项目的开发中支持信创国产化默认适配达梦和人大金仓。尤其适合SAAS项目、企业信息管理系统MIS、内部办公系统OA、企业资源计划系统ERP、客户关系管理系统CRM其半智能手工Merge的开发方式可以显著提高开发效率70%以上,极大降低开发成本。
### 视频介绍 项目说明
-----------------------------------
[![](https://upload.jeecg.com/jeecg/qiaoqiaoyunsite/jeecgvideo02.png)](https://www.bilibili.com/video/BV1Nk4y1o7Qc)
#### 项目说明
| 项目名 | 说明 | | 项目名 | 说明 |
|--------------------|------------------------| |--------------------|------------------------|
| `jeecg-boot` | 后端源码JAVASpringBoot微服务架构 | | `jeecg-boot` | 后端源码JAVASpringBoot微服务架构 |
| `jeecgboot-vue3` | 前端源码VUE3vue3+vite6+ts最新技术栈 | | `jeecgboot-vue3` | 前端源码VUE3vue3+vite6+ts最新技术栈 |
| `jeecg-uniapp` | [配套APP框架](https://github.com/jeecgboot/jeecg-uniapp) 适配多个终端支持APP、小程序、H5 | | `JeecgUniapp` | [配套APP框架](https://github.com/jeecgboot/JeecgUniapp) 适配多个终端支持APP、小程序、H5 |
@ -55,39 +56,70 @@ JeecgBoot AI低代码平台可以应用在任何J2EE项目的开发中
----------------------------------- -----------------------------------
- 官方网站: [http://www.jeecg.com](http://www.jeecg.com) - 官方网站: [http://www.jeecg.com](http://www.jeecg.com)
- 在线演示 [在线演示](http://boot3.jeecg.com) | [APP演示](http://jeecg.com/appIndex) - 在线演示 [平台演示](http://boot3.jeecg.com) | [APP演示](http://jeecg.com/appIndex) | [体验低代码](https://jeecg.blog.csdn.net/article/details/106079007) | [体验零代码](https://app.qiaoqiaoyun.com/myapps/index)
- 快速体验 [一分钟体验低代码](https://jeecg.blog.csdn.net/article/details/106079007?spm=1001.2014.3001.5502 "一分钟体验零代码") | [在线体验零代码](https://app.qiaoqiaoyun.com/myapps/index "在线体验零代码") - 开发文档 [文档中心](https://help.jeecg.com) | [AIGC大模块](https://help.jeecg.com/aigc)
- 开发文档: [文档中心](https://help.jeecg.com) | [AI集成配置(支持DeepSeek)](https://help.jeecg.com/java/ai/aichat.html) - 新手指南: [快速入门](http://www.jeecg.com/doc/quickstart) | [入门视频](http://jeecg.com/doc/video) | [如何反馈问题](https://github.com/jeecgboot/JeecgBoot/issues/new?template=bug_report.md)
- 反馈问题: [在Github上提Issues](https://github.com/jeecgboot/JeecgBoot/issues/new)
- 新手指南: [快速入门](http://www.jeecg.com/doc/quickstart) | [入门视频](http://jeecg.com/doc/video)
- QQ交流群 ⑩716488839、⑨808791225(满)、其他(满) - QQ交流群 ⑩716488839、⑨808791225(满)、其他(满)
启动项目 启动项目
----------------------------------- -----------------------------------
- [IDEA启动前后端项目](https://help.jeecg.com/java/setup/idea/startup.html) - [IDEA启动前后端项目](https://help.jeecg.com/java/setup/idea/startup)
- [Docker一键启动前后端](https://help.jeecg.com/java/docker/quick.html) - [Docker一键启动前后端](https://help.jeecg.com/java/docker/quick)
AIGC功能清单
AIGC应用平台介绍
----------------------------------- -----------------------------------
- AI对聊天助手 > JeecgBoot 平台的AIGC功能模块是一套类似`Dify`的`AIGC应用开发平台`+`知识库问答`是一款基于LLM大语言模型AI应用平台和 RAG 的知识库问答系统。
其直观的界面结合了 AI 流程编排、RAG 管道、知识库管理、模型管理、对接向量库、实时运行可观察等让您可以快速从原型到生产拥有AI服务能力。
- [AIGC专题介绍页](README-AI.md)
- [AIGC开发文档](https://help.jeecg.com/aigc)
##### AI视频介绍
[![](https://jeecgos.oss-cn-beijing.aliyuncs.com/files/jeecg_aivideo.png)](https://www.bilibili.com/video/BV1zmd7YFE4w)
##### Dify `VS` JEECG AI
> JEECG AI与Dify相比在多个方面展现出显著的优势特别是在文档处理、格式和图片保持方面。以下是一些具体的优点
> - Markdown文档库导入
> JEECG AI允许用户直接导入整个Markdown文档库这不仅保留markdown格式还支持图片的导入确保文档内容的完整性和可视化效果。
> - 对话回复格式美观:
> 在对话过程中JEECG AI能够保持回复内容的原格式也不丢失图片使得输出的文章更加美观不会出现格式错乱的情况还支持图片的渲染。
> - PDF文档导入与格式转换
> JEECG AI在处理PDF文档时能够更好地保持原始格式和图片确保转换后的内容与原始文档一致。这哥功能在许多AI产品中表现不佳而JEECG AI在这方面做出了显著的优化
##### 功能大模块
- AI应用开发平台
- AI知识库系统
- AI大模型管理
- AI流程编排
- AI对话支持图片
- AI对话助手(智能问答)
- AI建表Online表单 - AI建表Online表单
- AI写文章CMS - AI写文章CMS
- AI表单建议表单设计器 - AI表单字段建议(表单设计器)
- AI流程编排研发中
- AI知识库问答系统研发中 ##### AI大模型支持
- AI应用开发平台研发中
- AI聊天窗口支持嵌入第三方研发中 | AI大模型 | 支持 |
| --- | --- |
| DeepSeek | √ |
| ChatGTP | √ |
| Qwq | √ |
| 智库 | √ |
| Ollama本地模型 | √ |
| 等等。。 | √ |
<b>关注公众号了解官方动态</b>
![公众号](https://jeecg.com/images/jeecg/qrcode_jeecgboot.jpg "在这里输入图片标题")
技术架构: 技术架构:
@ -96,15 +128,15 @@ AIGC功能清单
#### 后端 #### 后端
- IDE建议 IDEA (必须安装lombok插件 ) - IDE建议 IDEA (必须安装lombok插件 )
- 语言Java 8+ (支持17) - 语言Java 默认jdk17(支持jdk8、jdk21)
- 依赖管理Maven - 依赖管理Maven
- 基础框架Spring Boot 2.7.18 - 基础框架Spring Boot 2.7.18
- 微服务框架: Spring Cloud Alibaba 2021.0.1.0 - 微服务框架: Spring Cloud Alibaba 2021.0.6.2
- 持久层框架MybatisPlus 3.5.3.2 - 持久层框架MybatisPlus 3.5.3.2
- 报表工具: JimuReport 1.9.3 - 报表工具: JimuReport 1.9.5
- 安全框架Apache Shiro 1.12.0Jwt 3.11.0 - 安全框架Apache Shiro 1.13.0Jwt 4.5.0
- 微服务技术栈Spring Cloud Alibaba、Nacos、Gateway、Sentinel、Skywalking - 微服务技术栈Spring Cloud Alibaba、Nacos、Gateway、Sentinel、Skywalking
- 数据库连接池阿里巴巴Druid 1.1.22 - 数据库连接池阿里巴巴Druid 1.1.24
- AI大模型支持 `ChatGPT` `DeepSeek`切换 - AI大模型支持 `ChatGPT` `DeepSeek`切换
- 日志打印logback - 日志打印logback
- 缓存Redis - 缓存Redis
@ -130,7 +162,9 @@ AIGC功能清单
` ( 因为Vite6 需要 Node.js 18 / 20+ )` ` ( 因为Vite6 需要 Node.js 18 / 20+ )`
#### 支持 #### 平台支持数据
> jeecgboot平台支持以下数据库默认我们只提供mysql脚本其他数据库可以参考[转库文档](https://my.oschina.net/jeecg/blog/4905722)自己转。
| 数据库 | 支持 | | 数据库 | 支持 |
| --- | --- | | --- | --- |
@ -139,20 +173,11 @@ AIGC功能清单
| Sqlserver2017 | √ | | Sqlserver2017 | √ |
| PostgreSQL | √ | | PostgreSQL | √ |
| MariaDB | √ | | MariaDB | √ |
| MariaDB | √ |
| 达梦 | √ | | 达梦 | √ |
| 人大金仓 | √ | | 人大金仓 | √ |
| TiDB | √ | | TiDB | √ |
| kingbase8 | √ |
#### 支持AI大模型
| AI大模型 | 支持 |
| --- | --- |
| DeepSeek | √ |
| ChatGTP | √ |
| Ollama本地搭建大模型 | √ |
AI集成文档 https://help.jeecg.com/java/ai/aichat.html
## 微服务解决方案 ## 微服务解决方案
@ -166,7 +191,7 @@ AI集成文档 https://help.jeecg.com/java/ai/aichat.html
- 6、分布式文件 Minio、阿里OSS √ - 6、分布式文件 Minio、阿里OSS √
- 7、统一权限控制 JWT + Shiro √ - 7、统一权限控制 JWT + Shiro √
- 8、服务监控 SpringBootAdmin√ - 8、服务监控 SpringBootAdmin√
- 9、链路跟踪 Skywalking [参考文档](https://help.jeecg.com/java/springcloud/super/skywarking.html) - 9、链路跟踪 Skywalking [参考文档](https://help.jeecg.com/java/springcloud/super/skywarking)
- 10、消息中间件 RabbitMQ √ - 10、消息中间件 RabbitMQ √
- 11、分布式任务 xxl-job √ - 11、分布式任务 xxl-job √
- 12、分布式事务 Seata - 12、分布式事务 Seata
@ -178,8 +203,8 @@ AI集成文档 https://help.jeecg.com/java/ai/aichat.html
#### 微服务方式启动 #### 微服务方式启动
- [单体快速切换微服务](https://help.jeecg.com/java/springcloud/switchcloud/monomer.html) - [单体快速切换微服务](https://help.jeecg.com/java/springcloud/switchcloud/monomer)
- [Docker一键启动微服务前后端](https://help.jeecg.com/java/docker/quickcloud.html) - [Docker一键启动微服务前后端](https://help.jeecg.com/java/docker/quickcloud)
#### 微服务架构图 #### 微服务架构图

View File

@ -2,12 +2,12 @@
JeecgBoot 低代码开发平台 JeecgBoot 低代码开发平台
=============== ===============
当前最新版本: 3.7.3发布日期2025-02-10 当前最新版本: 3.7.4发布日期2025-04-10
[![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/version-3.7.3-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot) [![](https://img.shields.io/badge/version-3.7.4-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)
@ -44,14 +44,14 @@ JeecgBoot 是一款基于代码生成器的`低代码开发平台`!前后端
启动项目 启动项目
----------------------------------- -----------------------------------
- [IDEA启动前后端项目](https://help.jeecg.com/java/setup/idea/startup.html) - [IDEA启动前后端项目](https://help.jeecg.com/java/setup/idea/startup)
- [Docker一键启动前后端](https://help.jeecg.com/java/docker/quick.html) - [Docker一键启动前后端](https://help.jeecg.com/java/docker/quick)
微服务启动 微服务启动
----------------------------------- -----------------------------------
- [单体快速切换微服务](https://help.jeecg.com/java/springcloud/switchcloud/monomer.html) - [单体快速切换微服务](https://help.jeecg.com/java/springcloud/switchcloud/monomer)
- [Docker启动微服务后台](https://help.jeecg.com/java/docker/springcloud.html) - [Docker启动微服务后台](https://help.jeecg.com/java/docker/springcloud)
@ -66,10 +66,10 @@ JeecgBoot 是一款基于代码生成器的`低代码开发平台`!前后端
- 基础框架Spring Boot 2.7.18 - 基础框架Spring Boot 2.7.18
- 微服务框架: Spring Cloud Alibaba 2021.0.1.0 - 微服务框架: Spring Cloud Alibaba 2021.0.1.0
- 持久层框架MybatisPlus 3.5.3.2 - 持久层框架MybatisPlus 3.5.3.2
- 报表工具: JimuReport 1.8.1 - 报表工具: JimuReport 1.9.4
- 安全框架Apache Shiro 1.12.0Jwt 3.11.0 - 安全框架Apache Shiro 1.12.0Jwt 3.11.0
- 微服务技术栈Spring Cloud Alibaba、Nacos、Gateway、Sentinel、Skywalking - 微服务技术栈Spring Cloud Alibaba、Nacos、Gateway、Sentinel、Skywalking
- 数据库连接池阿里巴巴Druid 1.1.22 - 数据库连接池阿里巴巴Druid 1.1.24
- 日志打印logback - 日志打印logback
- 缓存Redis - 缓存Redis
- 其他autopoi, fastjsonpoiSwagger-uiquartz, lombok简化代码等。 - 其他autopoi, fastjsonpoiSwagger-uiquartz, lombok简化代码等。
@ -113,7 +113,7 @@ JeecgBoot 是一款基于代码生成器的`低代码开发平台`!前后端
- 6、分布式文件 Minio、阿里OSS √ - 6、分布式文件 Minio、阿里OSS √
- 7、统一权限控制 JWT + Shiro √ - 7、统一权限控制 JWT + Shiro √
- 8、服务监控 SpringBootAdmin√ - 8、服务监控 SpringBootAdmin√
- 9、链路跟踪 Skywalking [参考文档](https://help.jeecg.com/java/springcloud/super/skywarking.html) - 9、链路跟踪 Skywalking [参考文档](https://help.jeecg.com/java/springcloud/super/skywarking)
- 10、消息中间件 RabbitMQ √ - 10、消息中间件 RabbitMQ √
- 11、分布式任务 xxl-job √ - 11、分布式任务 xxl-job √
- 12、分布式事务 Seata - 12、分布式事务 Seata

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,6 @@
> JeecgBoot属于平台级产品每次升级改动较大目前做不到平滑升级。 > JeecgBoot属于平台级产品每次升级改动较大目前做不到平滑升级。
### 增量升级方案 ### 增量升级方案
#### 1.代码合并 #### 1.代码合并
本地通过svn或git做好主干在分支上做业务开发jeecg每次版本发布可以手工覆盖主干的代码对比合并代码 本地通过svn或git做好主干在分支上做业务开发jeecg每次版本发布可以手工覆盖主干的代码对比合并代码
@ -12,12 +11,5 @@
- 其他库请手工执行SQL, 目录: `jeecg-module-system\jeecg-system-start\src\main\resources\flyway\sql\mysql` - 其他库请手工执行SQL, 目录: `jeecg-module-system\jeecg-system-start\src\main\resources\flyway\sql\mysql`
> 注意: 升级sql只提供mysql版本如果有权限升级, 还需要手工角色授权,退出重新登录才好使。 > 注意: 升级sql只提供mysql版本如果有权限升级, 还需要手工角色授权,退出重新登录才好使。
#### 3.其他数据库脚本说明 #### 3.兼容问题
原先官方默认提供oracle和SqlServer的脚本但是维护成本太高未提供脚本的数据库可以参考下面的文档自己转
https://my.oschina.net/jeecg/blog/4905722
注意定时任务的表qrtz_*,需要删掉用原始的脚本重新执行一下)
quartz-2.2.3-distribution.tar.gz放到百度网盘中大家自己下载执行所需数据库脚本
https://pan.baidu.com/s/1WrmZdUuAPg3iBwJ-LoHWyg?pwd=8mdz
#### 4.兼容问题
每次发版,会针对不兼容地方重点说明。 每次发版,会针对不兼容地方重点说明。

View File

@ -4,15 +4,11 @@
<parent> <parent>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-parent</artifactId> <artifactId>jeecg-boot-parent</artifactId>
<version>3.7.3</version> <version>3.7.4</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>
@ -47,7 +43,7 @@
<!--jeecg-tools--> <!--jeecg-tools-->
<dependency> <dependency>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-common3</artifactId> <artifactId>jeecg-boot-common</artifactId>
</dependency> </dependency>
<!--集成springmvc框架并实现自动配置 --> <!--集成springmvc框架并实现自动配置 -->
<dependency> <dependency>
@ -119,14 +115,14 @@
<!-- druid --> <!-- druid -->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-3-starter</artifactId> <artifactId>druid-spring-boot-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-boot3-starter</artifactId> <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>${dynamic-datasource-spring-boot-starter.version}</version> <version>${dynamic-datasource-spring-boot-starter.version}</version>
</dependency> </dependency>
@ -178,7 +174,6 @@
<version>${dm8.version}</version> <version>${dm8.version}</version>
</dependency> </dependency>
<!-- Quartz定时任务 --> <!-- Quartz定时任务 -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -196,14 +191,7 @@
<dependency> <dependency>
<groupId>org.apache.shiro</groupId> <groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring-boot-starter</artifactId> <artifactId>shiro-spring-boot-starter</artifactId>
<classifier>jakarta</classifier>
<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>
@ -219,61 +207,13 @@
<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-openapi3-jakarta-spring-boot-starter</artifactId> <artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
<version>${knife4j-spring-boot-starter.version}</version> <version>${knife4j-spring-boot-starter.version}</version>
</dependency> </dependency>
@ -283,11 +223,21 @@
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<artifactId>codegenerate</artifactId> <artifactId>codegenerate</artifactId>
<version>${codegenerate.version}</version> <version>${codegenerate.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
<exclusion>
<artifactId>mysql-connector-java</artifactId>
<groupId>mysql</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- AutoPoi Excel工具类--> <!-- AutoPoi Excel工具类-->
<dependency> <dependency>
<groupId>org.jeecgframework.boot3</groupId> <groupId>org.jeecgframework</groupId>
<artifactId>autopoi-web</artifactId> <artifactId>autopoi-web</artifactId>
<version>${autopoi-web.version}</version> <version>${autopoi-web.version}</version>
<exclusions> <exclusions>
@ -312,6 +262,12 @@
<dependency> <dependency>
<groupId>io.minio</groupId> <groupId>io.minio</groupId>
<artifactId>minio</artifactId> <artifactId>minio</artifactId>
<exclusions>
<exclusion>
<artifactId>checker-qual</artifactId>
<groupId>org.checkerframework</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- 阿里云短信 --> <!-- 阿里云短信 -->
@ -330,16 +286,6 @@
<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>
@ -363,11 +309,10 @@
<groupId>cn.hutool</groupId> <groupId>cn.hutool</groupId>
<artifactId>hutool-crypto</artifactId> <artifactId>hutool-crypto</artifactId>
</dependency> </dependency>
<!-- chatgpt --> <!-- chatgpt -->
<dependency> <dependency>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-starter3-chatgpt</artifactId> <artifactId>jeecg-boot-starter-chatgpt</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

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

View File

@ -21,14 +21,13 @@ import org.jeecg.common.util.IpUtils;
import org.jeecg.common.util.SpringContextUtils; import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.springframework.core.LocalVariableTableParameterNameDiscoverer; import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
import org.springframework.core.StandardReflectionParameterNameDiscoverer;
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 jakarta.annotation.Resource; import javax.annotation.Resource;
import jakarta.servlet.ServletRequest; import javax.servlet.ServletRequest;
import jakarta.servlet.ServletResponse; import javax.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Date; import java.util.Date;
@ -173,7 +172,7 @@ public class AutoLogAspect {
// 请求的方法参数值 // 请求的方法参数值
Object[] args = joinPoint.getArgs(); Object[] args = joinPoint.getArgs();
// 请求的方法参数名称 // 请求的方法参数名称
StandardReflectionParameterNameDiscoverer u=new StandardReflectionParameterNameDiscoverer(); LocalVariableTableParameterNameDiscoverer u = new LocalVariableTableParameterNameDiscoverer();
String[] paramNames = u.getParameterNames(method); String[] paramNames = u.getParameterNames(method);
if (args != null && paramNames != null) { if (args != null && paramNames != null) {
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {

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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.List; import java.util.List;

View File

@ -0,0 +1,21 @@
package org.jeecg.common.exception;
/**
* jeecgboot断言异常
* for [QQYUN-10990]AIRAG
* @author chenrui
* @date 2025/2/14 14:31
*/
public class JeecgBootAssertException extends JeecgBootException {
private static final long serialVersionUID = 1L;
public JeecgBootAssertException(String message) {
super(message);
}
public JeecgBootAssertException(String message, int errCode) {
super(message, errCode);
}
}

View File

@ -1,8 +1,6 @@
package org.jeecg.common.exception; package org.jeecg.common.exception;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
@ -25,14 +23,19 @@ import org.springframework.dao.DuplicateKeyException;
import org.springframework.data.redis.connection.PoolException; import org.springframework.data.redis.connection.PoolException;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.validation.ObjectError;
import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MaxUploadSizeExceededException; import org.springframework.web.multipart.MaxUploadSizeExceededException;
import org.springframework.web.servlet.NoHandlerFoundException; import org.springframework.web.servlet.NoHandlerFoundException;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 异常处理器 * 异常处理器
@ -47,6 +50,13 @@ public class JeecgBootExceptionHandler {
@Resource @Resource
BaseCommonService baseCommonService; BaseCommonService baseCommonService;
@ExceptionHandler(MethodArgumentNotValidException.class)
public Result<?> handleValidationExceptions(MethodArgumentNotValidException e) {
log.error(e.getMessage(), e);
addSysLog(e);
return Result.error("校验失败!" + e.getBindingResult().getAllErrors().stream().map(ObjectError::getDefaultMessage).collect(Collectors.joining(",")));
}
/** /**
* 处理自定义异常 * 处理自定义异常
*/ */

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 jakarta.annotation.Resource; import javax.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;

View File

@ -2,6 +2,7 @@ package org.jeecg.common.system.base.entity;
import java.io.Serializable; import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
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;
@ -12,7 +13,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
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基类

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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -6,18 +6,16 @@ import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.exceptions.JWTDecodeException; import com.auth0.jwt.exceptions.JWTDecodeException;
import com.auth0.jwt.interfaces.DecodedJWT; import com.auth0.jwt.interfaces.DecodedJWT;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
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 java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
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;
@ -202,11 +200,13 @@ public class JwtUtil {
} }
//update-begin---author:chenrui ---date:20250107 for[QQYUN-10785]数据权限,查看自己拥有部门的权限中存在问题 #7288------------ //update-begin---author:chenrui ---date:20250107 for[QQYUN-10785]数据权限,查看自己拥有部门的权限中存在问题 #7288------------
// 是否存在字符串标志 // 是否存在字符串标志
boolean multiStr = false; boolean multiStr;
if(oConvertUtils.isNotEmpty(key) && key.trim().matches("^\\[\\w+]$")){ if(oConvertUtils.isNotEmpty(key) && key.trim().matches("^\\[\\w+]$")){
key = key.substring(1,key.length()-1); key = key.substring(1,key.length()-1);
multiStr = true; multiStr = true;
} } else {
multiStr = false;
}
//update-end---author:chenrui ---date:20250107 for[QQYUN-10785]数据权限,查看自己拥有部门的权限中存在问题 #7288------------ //update-end---author:chenrui ---date:20250107 for[QQYUN-10785]数据权限,查看自己拥有部门的权限中存在问题 #7288------------
//替换为当前系统时间(年月日) //替换为当前系统时间(年月日)
if (key.equals(DataBaseConstant.SYS_DATE)|| key.toLowerCase().equals(DataBaseConstant.SYS_DATE_TABLE)) { if (key.equals(DataBaseConstant.SYS_DATE)|| key.toLowerCase().equals(DataBaseConstant.SYS_DATE_TABLE)) {
@ -289,7 +289,15 @@ public class JwtUtil {
//update-begin---author:chenrui ---date:20250107 for[QQYUN-10785]数据权限,查看自己拥有部门的权限中存在问题 #7288------------ //update-begin---author:chenrui ---date:20250107 for[QQYUN-10785]数据权限,查看自己拥有部门的权限中存在问题 #7288------------
returnValue = user.getSysMultiOrgCode().stream() returnValue = user.getSysMultiOrgCode().stream()
.filter(Objects::nonNull) .filter(Objects::nonNull)
.map(orgCode -> "'" + orgCode + "'") //update-begin---author:chenrui ---date:20250224 for[issues/7288]数据权限,查看自己拥有部门的权限中存在问题 #7288------------
.map(orgCode -> {
if (multiStr) {
return "'" + orgCode + "'";
} else {
return orgCode;
}
})
//update-end---author:chenrui ---date:20250224 for[issues/7288]数据权限,查看自己拥有部门的权限中存在问题 #7288------------
.collect(Collectors.joining(", ")); .collect(Collectors.joining(", "));
//update-end---author:chenrui ---date:20250107 for[QQYUN-10785]数据权限,查看自己拥有部门的权限中存在问题 #7288------------ //update-end---author:chenrui ---date:20250107 for[QQYUN-10785]数据权限,查看自己拥有部门的权限中存在问题 #7288------------
} }

View File

@ -0,0 +1,239 @@
package org.jeecg.common.util;
import org.jeecg.common.exception.JeecgBootAssertException;
/**
* 断言检查工具
* for for [QQYUN-10990]AIRAG
* @author chenrui
* @date 2017-06-22 10:05:56
*/
public class AssertUtils {
/**
* 确保对象为空,如果不为空抛出异常
*
* @param msg
* @param obj
* @throws JeecgBootAssertException
* @author chenrui
* @date 2017-06-22 10:05:56
*/
public static void assertEmpty(String msg, Object obj) {
if (oConvertUtils.isObjectNotEmpty(obj)) {
throw new JeecgBootAssertException(msg);
}
}
/**
* 确保对象不为空,如果为空抛出异常
*
* @param msg
* @param obj
* @throws JeecgBootAssertException
* @author chenrui
* @date 2017-06-22 10:05:56
*/
public static void assertNotEmpty(String msg, Object obj) {
if (oConvertUtils.isObjectEmpty(obj)) {
throw new JeecgBootAssertException(msg);
}
}
/**
* 验证对象是否相同
*
* @param message
* @param expected
* @param actual
* @author chenrui
* @date 2018/9/12 15:45
*/
public static void assertEquals(String message, Object expected,
Object actual) {
if (oConvertUtils.isEqual(expected, actual)) {
return;
}
throw new JeecgBootAssertException(message);
}
/**
* 验证不相同
*
* @param message
* @param expected
* @param actual
* @author chenrui
* @date 2018/9/12 15:45
*/
public static void assertNotEquals(String message, Object expected,
Object actual) {
if (oConvertUtils.isEqual(expected, actual)) {
throw new JeecgBootAssertException(message);
}
}
/**
* 验证是否相等
*
* @param message
* @param expected
* @param actual
* @author chenrui
* @date 2018/9/12 15:45
*/
public static void assertSame(String message, Object expected,
Object actual) {
if (expected == actual) {
return;
}
throw new JeecgBootAssertException(message);
}
/**
* 验证不相等
*
* @param message
* @param unexpected
* @param actual
* @author chenrui
* @date 2018/9/12 15:45
*/
public static void assertNotSame(String message, Object unexpected,
Object actual) {
if (unexpected == actual) {
throw new JeecgBootAssertException(message);
}
}
/**
* 验证是否为真
*
* @param message
* @param condition
*/
public static void assertTrue(String message, boolean condition) {
if (!condition) {
throw new JeecgBootAssertException(message);
}
}
/**
* 验证 condition是否为false
*
* @param message
* @param condition
*/
public static void assertFalse(String message, boolean condition) {
assertTrue(message, !condition);
}
/**
* 验证是否存在
*
* @param message
* @param obj
* @param objs
* @param <T>
* @throws JeecgBootAssertException
* @author chenrui
* @date 2018/1/31 22:14
*/
public static <T> void assertIn(String message, T obj, T... objs) {
assertNotEmpty(message, obj);
assertNotEmpty(message, objs);
if (!oConvertUtils.isIn(obj, objs)) {
throw new JeecgBootAssertException(message);
}
}
/**
* 验证是否不存在
*
* @param message
* @param obj
* @param objs
* @param <T>
* @throws JeecgBootAssertException
* @author chenrui
* @date 2018/1/31 22:14
*/
public static <T> void assertNotIn(String message, T obj, T... objs) {
assertNotEmpty(message, obj);
assertNotEmpty(message, objs);
if (oConvertUtils.isIn(obj, objs)) {
throw new JeecgBootAssertException(message);
}
}
/**
* 确保src大于des
*
* @param message
* @param src
* @param des
* @author chenrui
* @date 2018/9/19 15:30
*/
public static void assertGt(String message, Number src, Number des) {
if (oConvertUtils.isGt(src, des)) {
return;
}
throw new JeecgBootAssertException(message);
}
/**
* 确保src大于等于des
*
* @param message
* @param src
* @param des
* @author chenrui
* @date 2018/9/19 15:30
*/
public static void assertGe(String message, Number src, Number des) {
if (oConvertUtils.isGe(src, des)) {
return;
}
throw new JeecgBootAssertException(message);
}
/**
* 确保src小于des
*
* @param message
* @param src
* @param des
* @author chenrui
* @date 2018/9/19 15:30
*/
public static void assertLt(String message, Number src, Number des) {
if (oConvertUtils.isGe(src, des)) {
throw new JeecgBootAssertException(message);
}
}
/**
* 确保src小于等于des
*
* @param message
* @param src
* @param des
* @author chenrui
* @date 2018/9/19 15:30
*/
public static void assertLe(String message, Number src, Number des) {
if (oConvertUtils.isGt(src, des)) {
throw new JeecgBootAssertException(message);
}
}
}

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 jakarta.servlet.http.HttpServletRequest; import javax.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 jakarta.servlet.http.HttpServletRequest; import javax.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;

View File

@ -1,10 +1,10 @@
package org.jeecg.common.util; package org.jeecg.common.util;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;

View File

@ -4,13 +4,13 @@ import com.alibaba.fastjson.JSON;
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.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.constant.SymbolConstant; import org.jeecg.common.constant.SymbolConstant;
import org.jeecg.common.handler.IFillRuleHandler; import org.jeecg.common.handler.IFillRuleHandler;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import javax.servlet.http.HttpServletRequest;
/** /**

View File

@ -1,6 +1,6 @@
package org.jeecg.common.util; package org.jeecg.common.util;
import jakarta.servlet.http.HttpServletRequest; import javax.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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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

@ -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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/** /**
* @Author scott * @Author scott

View File

@ -1,6 +1,6 @@
package org.jeecg.common.util.encryption; package org.jeecg.common.util.encryption;
import org.apache.shiro.lang.codec.Base64; import org.apache.shiro.codec.Base64;
import javax.crypto.Cipher; import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.IvParameterSpec;

View File

@ -42,6 +42,7 @@ public class SsrfFileTypeFilter {
FILE_TYPE_WHITE_LIST.add("pdf"); FILE_TYPE_WHITE_LIST.add("pdf");
FILE_TYPE_WHITE_LIST.add("csv"); FILE_TYPE_WHITE_LIST.add("csv");
// FILE_TYPE_WHITE_LIST.add("xml"); // FILE_TYPE_WHITE_LIST.add("xml");
FILE_TYPE_WHITE_LIST.add("md");
//音视频文件 //音视频文件
FILE_TYPE_WHITE_LIST.add("mp4"); FILE_TYPE_WHITE_LIST.add("mp4");
@ -65,6 +66,10 @@ public class SsrfFileTypeFilter {
FILE_TYPE_WHITE_LIST.add("apk"); FILE_TYPE_WHITE_LIST.add("apk");
FILE_TYPE_WHITE_LIST.add("wgt"); FILE_TYPE_WHITE_LIST.add("wgt");
//幻灯片文件后缀
FILE_TYPE_WHITE_LIST.add("ppt");
FILE_TYPE_WHITE_LIST.add("pptx");
//设置禁止文件的头部标记 //设置禁止文件的头部标记
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

@ -9,10 +9,11 @@ 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 jakarta.servlet.http.HttpServletRequest; import javax.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;
import java.lang.reflect.Array;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
@ -463,7 +464,7 @@ public class oConvertUtils {
return false; return false;
} }
String[] childs = (String[]) childArray.toArray(); List<String> childs = childArray.toJavaList(String.class);
for (String v : childs) { for (String v : childs) {
if (!isIn(v, all)) { if (!isIn(v, all)) {
return false; return false;
@ -1029,4 +1030,108 @@ public class oConvertUtils {
return result; return result;
} }
/**
* 判断对象是否为空 <br/>
* 支持各种类型的对象
* for for [QQYUN-10990]AIRAG
* @param obj
* @return
* @author chenrui
* @date 2025/2/13 18:34
*/
public static boolean isObjectEmpty(Object obj) {
if (null == obj) {
return true;
}
if (obj instanceof CharSequence) {
return isEmpty(obj);
} else if (obj instanceof Map) {
return ((Map<?, ?>) obj).isEmpty();
} else if (obj instanceof Iterable) {
return isObjectEmpty(((Iterable<?>) obj).iterator());
} else if (obj instanceof Iterator) {
return !((Iterator<?>) obj).hasNext();
} else if (isArray(obj)) {
return 0 == Array.getLength(obj);
}
return false;
}
/**
* iterator 是否为空
* for for [QQYUN-10990]AIRAG
* @param iterator Iterator对象
* @return 是否为空
*/
public static boolean isEmptyIterator(Iterator<?> iterator) {
return null == iterator || false == iterator.hasNext();
}
/**
* 判断对象是否不为空
* for for [QQYUN-10990]AIRAG
* @param object
* @return
* @author chenrui
* @date 2025/2/13 18:35
*/
public static boolean isObjectNotEmpty(Object object) {
return !isObjectEmpty(object);
}
/**
* 如果src大于des返回true
* for [QQYUN-10990]AIRAG
* @param src
* @param des
* @return
* @author: chenrui
* @date: 2018/9/19 15:30
*/
public static boolean isGt(Number src, Number des) {
if (null == src || null == des) {
throw new IllegalArgumentException("参数不能为空");
}
if (src.doubleValue() > des.doubleValue()) {
return true;
}
return false;
}
/**
* 如果src大于等于des返回true
* for [QQYUN-10990]AIRAG
* @param src
* @param des
* @return
* @author: chenrui
* @date: 2018/9/19 15:30
*/
public static boolean isGe(Number src, Number des) {
if (null == src || null == des) {
throw new IllegalArgumentException("参数不能为空");
}
if (src.doubleValue() < des.doubleValue()) {
return false;
}
return true;
}
/**
* 判断是否存在
* for [QQYUN-10990]AIRAG
* @param obj
* @param objs
* @param <T>
* @return
* @author chenrui
* @date 2020/9/12 15:50
*/
public static <T> boolean isIn(T obj, T... objs) {
return isIn(obj, objs);
}
} }

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 jakarta.annotation.Resource; import javax.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,9 +2,7 @@ package org.jeecg.config;
import java.io.IOException; import java.io.IOException;
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure; import javax.servlet.*;
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;
@ -13,6 +11,8 @@ 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

@ -12,7 +12,6 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* @author eightmonth@qq.com
* 启动程序修改DruidWallConfig配置 * 启动程序修改DruidWallConfig配置
* 允许SELECT语句的WHERE子句是一个永真条件 * 允许SELECT语句的WHERE子句是一个永真条件
* @author eightmonth * @author eightmonth

View File

@ -17,6 +17,10 @@ public class JeecgBaseConfig {
* @TODO 降低使用成本加的默认值,实际以 yml配置 为准 * @TODO 降低使用成本加的默认值,实际以 yml配置 为准
*/ */
private String signatureSecret = "dd05f1c54d63749eda95f9fa6d49v442a"; private String signatureSecret = "dd05f1c54d63749eda95f9fa6d49v442a";
/**
* 自定义后台资源前缀解决表单设计器无法通过前端nginx转发访问
*/
private String customResourcePrefixPath;
/** /**
* 需要加强校验的接口清单 * 需要加强校验的接口清单
*/ */
@ -68,6 +72,14 @@ public class JeecgBaseConfig {
*/ */
private BaiduApi baiduApi; private BaiduApi baiduApi;
public String getCustomResourcePrefixPath() {
return customResourcePrefixPath;
}
public void setCustomResourcePrefixPath(String customResourcePrefixPath) {
this.customResourcePrefixPath = customResourcePrefixPath;
}
public Elasticsearch getElasticsearch() { public Elasticsearch getElasticsearch() {
return elasticsearch; return elasticsearch;
} }

View File

@ -1,9 +1,8 @@
//package org.jeecg.config; //package org.jeecg.config;
// //
// //
//import io.swagger.annotations.ApiOperation; //import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
//import org.jeecg.common.constant.CommonConstant; //import org.jeecg.common.constant.CommonConstant;
//import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
//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;
@ -19,13 +18,15 @@
//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.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.WebMvcRequestHandlerProvider; //import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
//import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; //import springfox.documentation.swagger2.annotations.EnableSwagger2;
// //
//import java.lang.reflect.Field; //import java.lang.reflect.Field;
//import java.util.ArrayList; //import java.util.ArrayList;
@ -37,7 +38,8 @@
// * @Author scott // * @Author scott
// */ // */
//@Configuration //@Configuration
//@EnableSwagger2WebMvc //@EnableSwagger2 //开启 Swagger2
//@EnableKnife4j //开启 knife4j可以不写
//@Import(BeanValidatorPluginsConfiguration.class) //@Import(BeanValidatorPluginsConfiguration.class)
//public class Swagger2Config implements WebMvcConfigurer { //public class Swagger2Config implements WebMvcConfigurer {
// //
@ -95,14 +97,6 @@
// 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());
// //update-begin-author:liusq---date:2024-08-15--for: 开启多租户时全局参数增加租户id
// if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
// ParameterBuilder tenantPar = new ParameterBuilder();
// tenantPar.name(CommonConstant.TENANT_ID).description("租户ID").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
// pars.add(tenantPar.build());
// }
// //update-end-author:liusq---date:2024-08-15--for: 开启多租户时全局参数增加租户id
//
// return pars; // return pars;
// } // }
// //
@ -157,7 +151,7 @@
// //
// @Override // @Override
// public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { // public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
// if (bean instanceof WebMvcRequestHandlerProvider) { // if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider) {
// customizeSpringfoxHandlerMappings(getHandlerMappings(bean)); // customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
// } // }
// return bean; // return bean;

View File

@ -66,7 +66,7 @@ public class Swagger3Config implements WebMvcConfigurer {
// 全局添加鉴权参数 // 全局添加鉴权参数
if (openApi.getPaths() != null) { if (openApi.getPaths() != null) {
openApi.getPaths().forEach((path, pathItem) -> { openApi.getPaths().forEach((path, pathItem) -> {
log.info("path: {}", path); //log.debug("path: {}", path);
// 检查当前路径是否在排除列表中 // 检查当前路径是否在排除列表中
boolean isExcluded = excludedPaths.stream().anyMatch(excludedPath -> boolean isExcluded = excludedPaths.stream().anyMatch(excludedPath ->
excludedPath.equals(path) || excludedPath.equals(path) ||

View File

@ -11,20 +11,19 @@ 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.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.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
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.web.exchanges.InMemoryHttpExchangeRepository; import org.springframework.boot.actuate.trace.http.InMemoryHttpTraceRepository;
import org.springframework.boot.autoconfigure.jackson.JacksonProperties; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
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;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.http.CacheControl;
import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
@ -34,12 +33,14 @@ 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;
import java.time.LocalTime; import java.time.LocalTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
/** /**
* Spring Boot 2.0 解决跨域问题 * Spring Boot 2.0 解决跨域问题
@ -70,6 +71,8 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
.addResourceLocations("file:" + jeecgBaseConfig.getPath().getWebapp() + "//"); .addResourceLocations("file:" + jeecgBaseConfig.getPath().getWebapp() + "//");
} }
resourceHandlerRegistration.addResourceLocations(staticLocations.split(",")); resourceHandlerRegistration.addResourceLocations(staticLocations.split(","));
// 设置缓存控制标头 Cache-Control有效期为30天
resourceHandlerRegistration.setCacheControl(CacheControl.maxAge(30, TimeUnit.DAYS));
} }
/** /**
@ -147,6 +150,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
* 解决metrics端点不显示jvm信息的问题(zyf) * 解决metrics端点不显示jvm信息的问题(zyf)
*/ */
@Bean @Bean
@ConditionalOnBean(name = "meterRegistryPostProcessor")
InitializingBean forcePrometheusPostProcessor(BeanPostProcessor meterRegistryPostProcessor) { InitializingBean forcePrometheusPostProcessor(BeanPostProcessor meterRegistryPostProcessor) {
return () -> meterRegistryPostProcessor.postProcessAfterInitialization(prometheusMeterRegistry, ""); return () -> meterRegistryPostProcessor.postProcessAfterInitialization(prometheusMeterRegistry, "");
} }

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 jakarta.servlet.*; import javax.servlet.*;
import jakarta.servlet.http.HttpServletRequest; import javax.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 jakarta.servlet.*; import javax.servlet.*;
import jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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 jakarta.annotation.Resource; import javax.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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

@ -60,7 +60,18 @@ public class MybatisPlusSaasConfig {
TENANT_TABLE.add("sys_category"); TENANT_TABLE.add("sys_category");
TENANT_TABLE.add("sys_data_source"); TENANT_TABLE.add("sys_data_source");
TENANT_TABLE.add("sys_position"); TENANT_TABLE.add("sys_position");
//TENANT_TABLE.add("sys_announcement"); //b-2.仪表盘
TENANT_TABLE.add("onl_drag_page");
TENANT_TABLE.add("onl_drag_dataset_head");
TENANT_TABLE.add("jimu_report_data_source");
TENANT_TABLE.add("jimu_report");
TENANT_TABLE.add("jimu_dict");
//b-4.AIRAG
TENANT_TABLE.add("airag_app");
TENANT_TABLE.add("airag_flow");
TENANT_TABLE.add("airag_knowledge");
TENANT_TABLE.add("airag_knowledge_doc");
TENANT_TABLE.add("airag_model");
} }
//2.示例测试 //2.示例测试

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 jakarta.servlet.http.HttpServletRequest; import javax.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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/** /**
* 动态数据源切换拦截器 * 动态数据源切换拦截器

View File

@ -32,9 +32,9 @@ import org.springframework.web.filter.DelegatingFilterProxy;
import redis.clients.jedis.HostAndPort; import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster; import redis.clients.jedis.JedisCluster;
import jakarta.annotation.Resource; import javax.annotation.Resource;
import jakarta.servlet.Filter; import javax.servlet.DispatcherType;
import jakarta.servlet.DispatcherType; import javax.servlet.Filter;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.*; import java.util.*;
@ -217,6 +217,10 @@ public class ShiroConfig {
//update-begin---author:chenrui ---date:20241202 for[issues/7491]运行时间好长,效率慢 ------------ //update-begin---author:chenrui ---date:20241202 for[issues/7491]运行时间好长,效率慢 ------------
registration.addUrlPatterns("/test/ai/chat/send"); registration.addUrlPatterns("/test/ai/chat/send");
//update-end---author:chenrui ---date:20241202 for[issues/7491]运行时间好长,效率慢 ------------ //update-end---author:chenrui ---date:20241202 for[issues/7491]运行时间好长,效率慢 ------------
registration.addUrlPatterns("/airag/flow/run");
registration.addUrlPatterns("/airag/flow/debug");
registration.addUrlPatterns("/airag/chat/send");
registration.addUrlPatterns("/airag/app/debug");
//支持异步 //支持异步
registration.setAsyncSupported(true); registration.setAsyncSupported(true);
registration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.ASYNC); registration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.ASYNC);

View File

@ -23,8 +23,8 @@ import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import jakarta.annotation.Resource; import javax.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import javax.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 jakarta.servlet.Filter; import javax.servlet.Filter;
import java.util.Map; import java.util.Map;
/** /**

View File

@ -13,10 +13,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 jakarta.servlet.ServletRequest; import javax.servlet.ServletRequest;
import jakarta.servlet.ServletResponse; import javax.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/** /**
* @Description: 鉴权登录拦截器 * @Description: 鉴权登录拦截器

View File

@ -1,9 +1,9 @@
package org.jeecg.config.shiro.filters; package org.jeecg.config.shiro.filters;
import jakarta.servlet.ServletRequest; import javax.servlet.ServletRequest;
import jakarta.servlet.ServletResponse; import javax.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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

@ -91,6 +91,10 @@ public class IgnoreAuthPostProcessor implements InitializingBean {
if (bases.length > 0) { if (bases.length > 0) {
for (String base : bases) { for (String base : bases) {
for (String uri : uris) { for (String uri : uris) {
// 如果uri包含路径占位符, 则需要将其替换为*
if (uri.matches(".*\\{.*}.*")) {
uri = uri.replaceAll("\\{.*?}", "*");
}
urls.add(prefix(base) + prefix(uri)); urls.add(prefix(base) + prefix(uri));
} }
} }

View File

@ -1,5 +1,7 @@
package org.jeecg.config.shiro.ignore; package org.jeecg.config.shiro.ignore;
import org.springframework.util.AntPathMatcher;
import org.springframework.util.PathMatcher;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -12,6 +14,7 @@ import java.util.List;
public class InMemoryIgnoreAuth { public class InMemoryIgnoreAuth {
private static final List<String> IGNORE_AUTH_LIST = new ArrayList<>(); private static final List<String> IGNORE_AUTH_LIST = new ArrayList<>();
private static PathMatcher MATCHER = new AntPathMatcher();
public InMemoryIgnoreAuth() {} public InMemoryIgnoreAuth() {}
public static void set(List<String> list) { public static void set(List<String> list) {
@ -28,7 +31,7 @@ public class InMemoryIgnoreAuth {
public static boolean contains(String url) { public static boolean contains(String url) {
for (String ignoreAuth : IGNORE_AUTH_LIST) { for (String ignoreAuth : IGNORE_AUTH_LIST) {
if (url.endsWith(ignoreAuth)) { if(MATCHER.match(ignoreAuth,url)){
return true; return true;
} }
} }

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 jakarta.annotation.Resource; import javax.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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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 jakarta.servlet.ReadListener; import javax.servlet.ReadListener;
import jakarta.servlet.ServletInputStream; import javax.servlet.ServletInputStream;
import jakarta.servlet.ServletRequest; import javax.servlet.ServletRequest;
import jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequestWrapper; import javax.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 jakarta.servlet.http.HttpServletRequest; import javax.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

@ -14,8 +14,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 jakarta.annotation.Resource; import javax.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
/** /**

View File

@ -3,10 +3,10 @@ package org.jeecg.test.sqlinjection;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.jsqlparser.JSQLParserException; import net.sf.jsqlparser.JSQLParserException;
import org.jeecg.common.util.SqlInjectionUtil; import org.jeecg.common.util.SqlInjectionUtil;
import org.junit.Test; import org.junit.jupiter.api.Test;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
/** /**

View File

@ -3,10 +3,10 @@ package org.jeecg.test.sqlinjection;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.jsqlparser.JSQLParserException; import net.sf.jsqlparser.JSQLParserException;
import org.jeecg.common.util.SqlInjectionUtil; import org.jeecg.common.util.SqlInjectionUtil;
import org.junit.Test; import org.junit.jupiter.api.Test;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
/** /**

View File

@ -3,10 +3,10 @@ package org.jeecg.test.sqlinjection;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.jsqlparser.JSQLParserException; import net.sf.jsqlparser.JSQLParserException;
import org.jeecg.common.util.SqlInjectionUtil; import org.jeecg.common.util.SqlInjectionUtil;
import org.junit.Test; import org.junit.jupiter.api.Test;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
/** /**

View File

@ -2,7 +2,7 @@ package org.jeecg.test.sqlinjection;
import com.baomidou.mybatisplus.core.toolkit.sql.SqlInjectionUtils; import com.baomidou.mybatisplus.core.toolkit.sql.SqlInjectionUtils;
import org.jeecg.common.util.SqlInjectionUtil; import org.jeecg.common.util.SqlInjectionUtil;
import org.junit.Test; import org.junit.jupiter.api.Test;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -4,7 +4,7 @@ import net.sf.jsqlparser.JSQLParserException;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.common.util.sqlparse.JSqlParserUtils; import org.jeecg.common.util.sqlparse.JSqlParserUtils;
import org.jeecg.common.util.sqlparse.vo.SelectSqlInfo; import org.jeecg.common.util.sqlparse.vo.SelectSqlInfo;
import org.junit.Test; import org.junit.jupiter.api.Test;
import java.util.Map; import java.util.Map;

View File

@ -1,17 +1,12 @@
package org.jeecg.test.sqlparse; package org.jeecg.test.sqlparse;
import net.sf.jsqlparser.JSQLParserException;
import org.jeecg.common.util.IpUtils; import org.jeecg.common.util.IpUtils;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.junit.Test; import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/** /**
* @author: scott * @author: scott
* @date: 2024年04月29日 16:48 * @date: 2024年04月29日 16:48

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.7.3</version> <version>3.7.4</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 jakarta.annotation.Resource; import javax.annotation.Resource;
/** /**
* 服务端提供方——feign接口 * 服务端提供方——feign接口

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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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 jakarta.servlet.http.HttpServletRequest; import javax.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 jakarta.websocket.OnClose; import javax.websocket.OnClose;
import jakarta.websocket.OnMessage; import javax.websocket.OnMessage;
import jakarta.websocket.OnOpen; import javax.websocket.OnOpen;
import jakarta.websocket.Session; import javax.websocket.Session;
import jakarta.websocket.server.PathParam; import javax.websocket.server.PathParam;
import jakarta.websocket.server.ServerEndpoint; import javax.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,12 +4,13 @@ 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.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
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,6 +31,8 @@ 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;
@ -141,7 +144,7 @@ public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoSe
*/ */
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
@Operation(summary = "通过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(@Parameter(name = "id", description = "示例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);
} }

View File

@ -10,10 +10,7 @@ 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.PostMapping; import org.springframework.web.bind.annotation.*;
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;

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 jakarta.servlet.http.HttpServletRequest; import javax.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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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

@ -76,7 +76,7 @@ public class JeecgDemo extends JeecgEntity implements Serializable {
@Schema(description = "部门编码") @Schema(description = "部门编码")
private java.lang.String sysOrgCode; private java.lang.String sysOrgCode;
// @Schema(description = "租户ID") @Schema(description = "租户ID")
private java.lang.Integer tenantId; private java.lang.Integer tenantId;
/** 乐观锁字段 */ /** 乐观锁字段 */
@Version @Version

View File

@ -26,6 +26,12 @@ public interface IJeecgDemoService extends JeecgService<JeecgDemo> {
* @return demo对象 * @return demo对象
*/ */
public JeecgDemo getByIdCacheable(String id); public JeecgDemo getByIdCacheable(String id);
/**
* 通过id过去demo数据先读缓存在读数据库
* @param id 数据库id
* @return demo对象
*/
public JeecgDemo getByIdCacheableTTL(String id);
/** /**
* 查询列表数据 在service中获取数据权限sql信息 * 查询列表数据 在service中获取数据权限sql信息

View File

@ -71,6 +71,22 @@ public class JeecgDemoServiceImpl extends ServiceImpl<JeecgDemoMapper, JeecgDemo
} }
/**
* @Cacheable自定义TTL#60单位是秒目前只支持这一种格式
* 通过注解方式指定缓存有效期60秒
*
* 参考博客https://www.cnblogs.com/h2285409/p/18324396
*/
@Override
@Cacheable(cacheNames = "ceshi:redis:ttl#60", key = "#id")
public JeecgDemo getByIdCacheableTTL(String id) {
JeecgDemo t = jeecgDemoMapper.selectById(id);
System.err.println("---未读缓存,读取数据库---");
System.err.println(t);
return t;
}
@Override @Override
public IPage<JeecgDemo> queryListWithPermission(int pageSize,int pageNo) { public IPage<JeecgDemo> queryListWithPermission(int pageSize,int pageNo) {
Page<JeecgDemo> page = new Page<>(pageNo, pageSize); Page<JeecgDemo> page = new Page<>(pageNo, pageSize);

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 jakarta.servlet.http.HttpServletRequest; import javax.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.7.3</version> <version>3.7.4</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

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.7.3</version> <version>3.7.4</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

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.7.3</version> <version>3.7.4</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.7.3</version> <version>3.7.4</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.boot3</groupId> <groupId>org.jeecgframework.boot</groupId>
<artifactId>hibernate-re</artifactId> <artifactId>hibernate-re</artifactId>
</dependency> </dependency>
@ -32,7 +32,7 @@
<!-- 积木报表 --> <!-- 积木报表 -->
<dependency> <dependency>
<groupId>org.jeecgframework.jimureport</groupId> <groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId> <artifactId>jimureport-spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jeecgframework.jimureport</groupId> <groupId>org.jeecgframework.jimureport</groupId>
@ -41,7 +41,7 @@
<!-- 积木BI --> <!-- 积木BI -->
<dependency> <dependency>
<groupId>org.jeecgframework.jimureport</groupId> <groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimubi-spring-boot3-starter</artifactId> <artifactId>jimubi-spring-boot-starter</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -26,8 +26,11 @@ public class CodeTemplateInitListener implements ApplicationListener<Application
@Override @Override
public void onApplicationEvent(ApplicationReadyEvent event) { public void onApplicationEvent(ApplicationReadyEvent event) {
try { try {
log.info(" Init Code Generate Template [ 检测如果是JAR启动环境Copy模板到config目录 ] "); long startTime = System.currentTimeMillis(); // 记录开始时间
log.info(" Init Code Generate Template [ 检测如果是JAR启动Copy模板到config目录 ] ");
this.initJarConfigCodeGeneratorTemplate(); this.initJarConfigCodeGeneratorTemplate();
long endTime = System.currentTimeMillis(); // 记录结束时间
log.info(" Init Code Generate Template completed in " + (endTime - startTime) + " ms"); // 计算并记录耗时
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -1,18 +1,28 @@
package org.jeecg.config; package org.jeecg.config.init;
import io.undertow.server.DefaultByteBufferPool; import io.undertow.server.DefaultByteBufferPool;
import io.undertow.websockets.jsr.WebSocketDeploymentInfo; import io.undertow.websockets.jsr.WebSocketDeploymentInfo;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component; import org.springframework.context.annotation.Configuration;
/**
* Undertow配置
*
* 解决启动提示 WARN io.undertow.websockets.jsr:68 - UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
*/
@Configuration
public class UndertowConfiguration implements WebServerFactoryCustomizer<UndertowServletWebServerFactory>{
@Component
public class UndertowCustomizer implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
@Override @Override
public void customize(UndertowServletWebServerFactory factory) { public void customize(UndertowServletWebServerFactory factory) {
factory.addDeploymentInfoCustomizers(deploymentInfo -> { factory.addDeploymentInfoCustomizers(deploymentInfo -> {
WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo();
webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(false, 1024));
// 设置合理的参数
webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(true, 8192));
deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo); deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo);
}); });
} }

View File

@ -12,7 +12,7 @@ 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 jakarta.servlet.http.HttpServletRequest; import javax.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;
@ -36,7 +36,11 @@ public class JimuReportTokenService implements JmReportTokenServiceI {
@Override @Override
public String getToken(HttpServletRequest request) { public String getToken(HttpServletRequest request) {
return TokenUtils.getTokenByRequest(request); try {
return TokenUtils.getTokenByRequest(request);
} catch (Exception e) {
return null;
}
} }
@Override @Override

View File

@ -15,7 +15,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 jakarta.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Date; import java.util.Date;

View File

@ -2,8 +2,8 @@ package org.jeecg.modules.cas.controller;
import java.util.List; import java.util.List;
import jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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

@ -21,8 +21,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 jakarta.mail.MessagingException; import javax.mail.MessagingException;
import jakarta.mail.internet.MimeMessage; import javax.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 jakarta.annotation.Resource; import javax.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 jakarta.websocket.*; import javax.websocket.*;
import jakarta.websocket.server.PathParam; import javax.websocket.server.PathParam;
import jakarta.websocket.server.ServerEndpoint; import javax.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

@ -1,9 +1,9 @@
package org.jeecg.modules.monitor.actuator; package org.jeecg.modules.monitor.actuator;
import org.jeecg.modules.monitor.actuator.httptrace.CustomInMemoryHttpTraceRepository; import org.jeecg.modules.monitor.actuator.httptrace.CustomInMemoryHttpTraceRepository;
import org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesProperties; import org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceProperties;
import org.springframework.boot.actuate.web.exchanges.HttpExchangeRepository; import org.springframework.boot.actuate.trace.http.HttpTraceRepository;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@ -18,8 +18,8 @@ import org.springframework.context.annotation.Configuration;
* @Date: 2024/5/13 17:20 * @Date: 2024/5/13 17:20
*/ */
@Configuration @Configuration
@EnableConfigurationProperties(HttpExchangesProperties.class) @EnableConfigurationProperties(HttpTraceProperties.class)
@AutoConfigureBefore(HttpExchangesAutoConfiguration.class) @AutoConfigureBefore(HttpTraceAutoConfiguration.class)
public class CustomActuatorConfig { public class CustomActuatorConfig {
/** /**
@ -30,7 +30,7 @@ public class CustomActuatorConfig {
*/ */
@Bean @Bean
@ConditionalOnProperty(prefix = "management.trace.http", name = "enabled", matchIfMissing = true) @ConditionalOnProperty(prefix = "management.trace.http", name = "enabled", matchIfMissing = true)
@ConditionalOnMissingBean(HttpExchangeRepository.class) @ConditionalOnMissingBean(HttpTraceRepository.class)
public CustomInMemoryHttpTraceRepository traceRepository() { public CustomInMemoryHttpTraceRepository traceRepository() {
return new CustomInMemoryHttpTraceRepository(); return new CustomInMemoryHttpTraceRepository();
} }

View File

@ -4,7 +4,7 @@ import lombok.Getter;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.Selector; import org.springframework.boot.actuate.endpoint.annotation.Selector;
import org.springframework.boot.actuate.web.exchanges.HttpExchange; import org.springframework.boot.actuate.trace.http.HttpTrace;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.Assert; import org.springframework.util.Assert;
@ -29,14 +29,14 @@ public class CustomHttpTraceEndpoint{
@ReadOperation @ReadOperation
public HttpTraceDescriptor traces(@Selector(match = ALL_REMAINING) String query) { public HttpTraceDescriptor traces(@Selector(match = ALL_REMAINING) String query) {
return new HttpTraceDescriptor(this.repository.findAll(query)); return new CustomHttpTraceEndpoint.HttpTraceDescriptor(this.repository.findAll(query));
} }
@Getter @Getter
public static final class HttpTraceDescriptor { public static final class HttpTraceDescriptor {
private final List<HttpExchange> traces; private final List<HttpTrace> traces;
private HttpTraceDescriptor(List<HttpExchange> traces) { private HttpTraceDescriptor(List<HttpTrace> traces) {
this.traces = traces; this.traces = traces;
} }

View File

@ -1,7 +1,7 @@
package org.jeecg.modules.monitor.actuator.httptrace; package org.jeecg.modules.monitor.actuator.httptrace;
import org.springframework.boot.actuate.web.exchanges.HttpExchange; import org.springframework.boot.actuate.trace.http.HttpTrace;
import org.springframework.boot.actuate.web.exchanges.InMemoryHttpExchangeRepository; import org.springframework.boot.actuate.trace.http.InMemoryHttpTraceRepository;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -12,17 +12,17 @@ import java.util.stream.Stream;
* @Author: chenrui * @Author: chenrui
* @Date: 2024/5/13 17:02 * @Date: 2024/5/13 17:02
*/ */
public class CustomInMemoryHttpTraceRepository extends InMemoryHttpExchangeRepository { public class CustomInMemoryHttpTraceRepository extends InMemoryHttpTraceRepository {
@Override @Override
public List<HttpExchange> findAll() { public List<HttpTrace> findAll() {
return super.findAll(); return super.findAll();
} }
public List<HttpExchange> findAll(String query) { public List<HttpTrace> findAll(String query) {
List<HttpExchange> allTrace = super.findAll(); List<HttpTrace> allTrace = super.findAll();
if (null != allTrace && !allTrace.isEmpty()) { if (null != allTrace && !allTrace.isEmpty()) {
Stream<HttpExchange> stream = allTrace.stream(); Stream<HttpTrace> stream = allTrace.stream();
String[] params = query.split(","); String[] params = query.split(",");
stream = filter(params, stream); stream = filter(params, stream);
stream = sort(params, stream); stream = sort(params, stream);
@ -31,7 +31,7 @@ public class CustomInMemoryHttpTraceRepository extends InMemoryHttpExchangeRepos
return allTrace; return allTrace;
} }
private Stream<HttpExchange> sort(String[] params, Stream<HttpExchange> stream) { private Stream<HttpTrace> sort(String[] params, Stream<HttpTrace> stream) {
if (params.length < 2) { if (params.length < 2) {
return stream; return stream;
} }
@ -56,7 +56,7 @@ public class CustomInMemoryHttpTraceRepository extends InMemoryHttpExchangeRepos
}); });
} }
private static Stream<HttpExchange> filter(String[] params, Stream<HttpExchange> stream) { private static Stream<HttpTrace> filter(String[] params, Stream<HttpTrace> stream) {
if (params.length == 0) { if (params.length == 0) {
return stream; return stream;
} }

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 jakarta.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import javax.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

@ -2,7 +2,7 @@ package org.jeecg.modules.monitor.service.impl;
import java.util.*; import java.util.*;
import jakarta.annotation.Resource; import javax.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

@ -0,0 +1,112 @@
package org.jeecg.modules.openapi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.openapi.entity.OpenApiAuth;
import org.jeecg.modules.openapi.generator.AKSKGenerator;
import org.jeecg.modules.openapi.service.OpenApiAuthService;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
/**
* @date 2024/12/10 9:54
*/
@RestController
@RequestMapping("/openapi/auth")
public class OpenApiAuthController extends JeecgController<OpenApiAuth, OpenApiAuthService> {
/**
* 分页列表查询
*
* @param openApiAuth
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/list")
public Result<?> queryPageList(OpenApiAuth openApiAuth, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<OpenApiAuth> queryWrapper = QueryGenerator.initQueryWrapper(openApiAuth, req.getParameterMap());
Page<OpenApiAuth> page = new Page<>(pageNo, pageSize);
IPage<OpenApiAuth> pageList = service.page(page, queryWrapper);
return Result.ok(pageList);
}
/**
* 添加
*
* @param openApiAuth
* @return
*/
@PostMapping(value = "/add")
public Result<?> add(@RequestBody OpenApiAuth openApiAuth) {
service.save(openApiAuth);
return Result.ok("添加成功!");
}
/**
* 编辑
*
* @param openApiAuth
* @return
*/
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody OpenApiAuth openApiAuth) {
service.updateById(openApiAuth);
return Result.ok("修改成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
service.removeById(id);
return Result.ok("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.ok("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
OpenApiAuth openApiAuth = service.getById(id);
return Result.ok(openApiAuth);
}
/**
* 生成AKSK
* @return
*/
@GetMapping("genAKSK")
public Result<String[]> genAKSK() {
return Result.ok(AKSKGenerator.genAKSKPair());
}
}

View File

@ -0,0 +1,386 @@
package org.jeecg.modules.openapi.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.modules.openapi.entity.OpenApi;
import org.jeecg.modules.openapi.entity.OpenApiAuth;
import org.jeecg.modules.openapi.entity.OpenApiHeader;
import org.jeecg.modules.openapi.entity.OpenApiParam;
import org.jeecg.modules.openapi.generator.PathGenerator;
import org.jeecg.modules.openapi.service.OpenApiAuthService;
import org.jeecg.modules.openapi.service.OpenApiHeaderService;
import org.jeecg.modules.openapi.service.OpenApiParamService;
import org.jeecg.modules.openapi.service.OpenApiService;
import org.jeecg.modules.openapi.swagger.*;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
* @date 2024/12/10 9:11
*/
@RestController
@RequestMapping("/openapi")
public class OpenApiController extends JeecgController<OpenApi, OpenApiService> {
@Autowired
private RestTemplate restTemplate;
@Autowired
private OpenApiParamService openApiParamService;
@Autowired
private OpenApiHeaderService openApiHeaderService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private OpenApiAuthService openApiAuthService;
/**
* 分页列表查询
*
* @param openApi
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/list")
public Result<?> queryPageList(OpenApi openApi, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<OpenApi> queryWrapper = QueryGenerator.initQueryWrapper(openApi, req.getParameterMap());
Page<OpenApi> page = new Page<>(pageNo, pageSize);
IPage<OpenApi> pageList = service.page(page, queryWrapper);
for (OpenApi api : pageList.getRecords()) {
api.setParams(openApiParamService.findByApiId(api.getId()));
api.setHeaders(openApiHeaderService.findByApiId(api.getId()));
}
return Result.ok(pageList);
}
/**
* 添加
*
* @param openApi
* @return
*/
@PostMapping(value = "/add")
public Result<?> add(@RequestBody OpenApi openApi) {
if (service.save(openApi)) {
if (!CollectionUtils.isEmpty(openApi.getHeaders())) {
openApiHeaderService.saveBatch(openApi.getHeaders());
}
if (!CollectionUtils.isEmpty(openApi.getParams())) {
openApiParamService.saveBatch(openApi.getParams());
}
}
return Result.ok("添加成功!");
}
/**
* 编辑
*
* @param openApi
* @return
*/
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody OpenApi openApi) {
if (service.updateById(openApi)) {
openApiHeaderService.deleteByApiId(openApi.getId());
openApiParamService.deleteByApiId(openApi.getId());
if (!CollectionUtils.isEmpty(openApi.getHeaders())) {
openApiHeaderService.saveBatch(openApi.getHeaders());
}
if (!CollectionUtils.isEmpty(openApi.getParams())) {
openApiParamService.saveBatch(openApi.getParams());
}
}
return Result.ok("修改成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
service.removeById(id);
return Result.ok("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.ok("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
OpenApi OpenApi = service.getById(id);
return Result.ok(OpenApi);
}
/**
* 接口调用
* @param path
* @return
*/
@RequestMapping(value = "/call/{path}", method = {RequestMethod.GET,RequestMethod.POST})
public Result<?> call(@PathVariable String path, @RequestBody(required = false) String json, HttpServletRequest request) {
OpenApi openApi = service.findByPath(path);
if (Objects.isNull(openApi)) {
Map<String, Object> result = new HashMap<>();
result.put("code", 404);
result.put("data", null);
return Result.error("失败", result);
}
List<OpenApiHeader> headers = openApiHeaderService.findByApiId(openApi.getId());
String url = openApi.getOriginUrl();
String method = openApi.getRequestMethod();
HttpHeaders httpHeaders = new HttpHeaders();
for (OpenApiHeader header : headers) {
httpHeaders.put(header.getHeaderKey(), Lists.newArrayList(request.getHeader(header.getHeaderKey())));
}
String appkey = request.getHeader("appkey");
OpenApiAuth openApiAuth = openApiAuthService.getByAppkey(appkey);
SysUser systemUser = sysUserService.getById(openApiAuth.getSystemUserId());
String token = JwtUtil.sign(systemUser.getUsername(), systemUser.getPassword());
httpHeaders.put("X-Access-Token", Lists.newArrayList(token));
HttpEntity<String> httpEntity = new HttpEntity<>(json, httpHeaders);
return restTemplate.exchange(url, HttpMethod.resolve(method), httpEntity, Result.class, request.getParameterMap()).getBody();
}
@GetMapping("/json")
public SwaggerModel swaggerModel() {
SwaggerModel swaggerModel = new SwaggerModel();
swaggerModel.setSwagger("2.0");
swaggerModel.setInfo(swaggerInfo());
swaggerModel.setHost("jeecg.com");
swaggerModel.setBasePath("/jeecg-boot");
swaggerModel.setSchemes(Lists.newArrayList("http", "https"));
SwaggerTag swaggerTag = new SwaggerTag();
swaggerTag.setName("openapi");
swaggerModel.setTags(Lists.newArrayList(swaggerTag));
pathsAndDefinitions(swaggerModel);
return swaggerModel;
}
private void pathsAndDefinitions(SwaggerModel swaggerModel) {
Map<String, Map<String, SwaggerOperation>> paths = new HashMap<>();
Map<String, SwaggerDefinition> definitions = new HashMap<>();
List<OpenApi> openapis = service.list();
for (OpenApi openApi : openapis) {
Map<String, SwaggerOperation> operations = new HashMap<>();
SwaggerOperation operation = new SwaggerOperation();
operation.setTags(Lists.newArrayList("openapi"));
operation.setSummary(openApi.getName());
operation.setDescription(openApi.getName());
operation.setOperationId(openApi.getRequestUrl()+"Using"+openApi.getRequestMethod());
operation.setProduces(Lists.newArrayList("application/json"));
parameters(operation, openApi);
// body入参
if (StringUtils.hasText(openApi.getBody())) {
SwaggerDefinition definition = new SwaggerDefinition();
definition.setType("object");
Map<String, SwaggerDefinitionProperties> definitionProperties = new HashMap<>();
definition.setProperties(definitionProperties);
JSONObject jsonObject = JSONObject.parseObject(openApi.getBody());
for (Map.Entry<String, Object> properties : jsonObject.entrySet()) {
SwaggerDefinitionProperties swaggerDefinitionProperties = new SwaggerDefinitionProperties();
swaggerDefinitionProperties.setType("string");
swaggerDefinitionProperties.setDescription(properties.getValue()+"");
definitionProperties.put(properties.getKey(), swaggerDefinitionProperties);
}
// body的definition构建完成
definitions.put(openApi.getRequestUrl()+"Using"+openApi.getRequestMethod()+"body", definition);
SwaggerOperationParameter bodyParameter = new SwaggerOperationParameter();
bodyParameter.setDescription(openApi.getName() + " body");
bodyParameter.setIn("body");
bodyParameter.setName(openApi.getName() + " body");
bodyParameter.setRequired(true);
Map<String, String> bodySchema = new HashMap<>();
bodySchema.put("$ref", "#/definitions/" + openApi.getRequestUrl()+"Using"+openApi.getRequestMethod()+"body");
bodyParameter.setSchema(bodySchema);
// 构建参数构建完成
operation.getParameters().add(bodyParameter);
}
// 响应
Map<String, SwaggerOperationResponse> responses = new HashMap<>();
SwaggerOperationResponse resp200 = new SwaggerOperationResponse();
resp200.setDescription("OK");
Map<String, String> respSchema = new HashMap<>();
respSchema.put("$ref", "#/definitions/OpenApiResult");
resp200.setSchema(respSchema);
responses.put("200", resp200);
Map<String, String> emptySchema = new HashMap<>();
SwaggerOperationResponse resp201 = new SwaggerOperationResponse();
resp201.setDescription("Created");
resp201.setSchema(emptySchema);
responses.put("201", resp201);
SwaggerOperationResponse resp401 = new SwaggerOperationResponse();
resp401.setDescription("Unauthorized");
resp401.setSchema(emptySchema);
responses.put("401", resp401);
SwaggerOperationResponse resp403 = new SwaggerOperationResponse();
resp403.setDescription("Forbidden");
resp403.setSchema(emptySchema);
responses.put("403", resp403);
SwaggerOperationResponse resp404 = new SwaggerOperationResponse();
resp404.setDescription("Not Found");
resp404.setSchema(emptySchema);
responses.put("404", resp404);
// 构建响应definition
SwaggerDefinition respDefinition = new SwaggerDefinition();
respDefinition.setType("object");
Map<String, SwaggerDefinitionProperties> definitionProperties = new HashMap<>();
respDefinition.setProperties(definitionProperties);
SwaggerDefinitionProperties codeProperties = new SwaggerDefinitionProperties();
codeProperties.setType("integer");
codeProperties.setDescription("返回代码");
definitionProperties.put("code", codeProperties);
SwaggerDefinitionProperties messageProperties = new SwaggerDefinitionProperties();
messageProperties.setType("string");
messageProperties.setDescription("返回处理消息");
definitionProperties.put("message", messageProperties);
SwaggerDefinitionProperties resultProperties = new SwaggerDefinitionProperties();
resultProperties.setType("object");
resultProperties.setDescription("返回数据对象");
definitionProperties.put("result", resultProperties);
SwaggerDefinitionProperties successProperties = new SwaggerDefinitionProperties();
successProperties.setType("boolean");
successProperties.setDescription("成功标志");
definitionProperties.put("success", successProperties);
SwaggerDefinitionProperties timestampProperties = new SwaggerDefinitionProperties();
timestampProperties.setType("integer");
timestampProperties.setDescription("时间戳");
definitionProperties.put("timestamp", timestampProperties);
definitions.put("OpenApiResult", respDefinition);
operation.setResponses(responses);
operations.put(openApi.getRequestMethod().toLowerCase(), operation);
paths.put("/openapi/call/"+openApi.getRequestUrl(), operations);
}
swaggerModel.setDefinitions(definitions);
swaggerModel.setPaths(paths);
}
private void parameters(SwaggerOperation operation, OpenApi openApi) {
List<SwaggerOperationParameter> parameters = new ArrayList<>();
for (OpenApiParam openApiParam : openApiParamService.findByApiId(openApi.getId())) {
SwaggerOperationParameter parameter = new SwaggerOperationParameter();
parameter.setIn("path");
parameter.setName(openApiParam.getParamKey());
parameter.setRequired(openApiParam.getRequired() == 1);
parameter.setDescription(openApiParam.getNote());
parameters.add(parameter);
}
for (OpenApiHeader openApiHeader : openApiHeaderService.findByApiId(openApi.getId())) {
SwaggerOperationParameter parameter = new SwaggerOperationParameter();
parameter.setIn("header");
parameter.setName(openApiHeader.getHeaderKey());
parameter.setRequired(openApiHeader.getRequired() == 1);
parameter.setDescription(openApiHeader.getNote());
parameters.add(parameter);
}
operation.setParameters(parameters);
}
private SwaggerInfo swaggerInfo() {
SwaggerInfo info = new SwaggerInfo();
info.setDescription("OpenAPI 接口列表");
info.setVersion("3.7.1");
info.setTitle("OpenAPI 接口列表");
info.setTermsOfService("https://jeecg.com");
SwaggerInfoContact contact = new SwaggerInfoContact();
contact.setName("jeecg@qq.com");
info.setContact(contact);
SwaggerInfoLicense license = new SwaggerInfoLicense();
license.setName("Apache 2.0");
license.setUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
info.setLicense(license);
return info;
}
/**
* 生成接口路径
* @return
*/
@GetMapping("genPath")
public Result<String> genPath() {
Result<String> r = new Result<String>();
r.setSuccess(true);
r.setCode(CommonConstant.SC_OK_200);
r.setResult(PathGenerator.genPath());
return r;
}
}

View File

@ -0,0 +1,26 @@
package org.jeecg.modules.openapi.controller;
import org.jeecg.common.api.vo.Result;
import org.jeecg.config.shiro.IgnoreAuth;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
/**
* @date 2024/12/20 14:04
*/
@RestController
@RequestMapping("/openapi/demo")
public class OpenApiIndexController {
@GetMapping("index")
@IgnoreAuth
public Result<Map<String, String>> index() {
Map<String, String> result = new HashMap<>();
result.put("first", "Hello World");
return Result.ok(result);
}
}

View File

@ -0,0 +1,20 @@
package org.jeecg.modules.openapi.controller;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.openapi.entity.OpenApiPermission;
import org.jeecg.modules.openapi.service.OpenApiPermissionService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/openapi/permission")
public class OpenApiPermissionController extends JeecgController<OpenApiPermission, OpenApiPermissionService> {
@PostMapping("add")
public Result add(@RequestBody OpenApiPermission openApiPermission) {
return Result.ok(service.save(openApiPermission));
}
}

View File

@ -0,0 +1,102 @@
package org.jeecg.modules.openapi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.openapi.entity.OpenApiRecord;
import org.jeecg.modules.openapi.service.OpenApiRecordService;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
/**
* @date 2024/12/10 9:57
*/
@RestController
@RequestMapping("/openapi/record")
public class OpenApiRecordController extends JeecgController<OpenApiRecord, OpenApiRecordService> {
/**
* 分页列表查询
*
* @param openApiRecord
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/list")
public Result<?> queryPageList(OpenApiRecord openApiRecord, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<OpenApiRecord> queryWrapper = QueryGenerator.initQueryWrapper(openApiRecord, req.getParameterMap());
Page<OpenApiRecord> page = new Page<>(pageNo, pageSize);
IPage<OpenApiRecord> pageList = service.page(page, queryWrapper);
return Result.ok(pageList);
}
/**
* 添加
*
* @param openApiRecord
* @return
*/
@PostMapping(value = "/add")
public Result<?> add(@RequestBody OpenApiRecord openApiRecord) {
service.save(openApiRecord);
return Result.ok("添加成功!");
}
/**
* 编辑
*
* @param openApiRecord
* @return
*/
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody OpenApiRecord openApiRecord) {
service.updateById(openApiRecord);
return Result.ok("修改成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
service.removeById(id);
return Result.ok("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.ok("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
OpenApiRecord openApiRecord = service.getById(id);
return Result.ok(openApiRecord);
}
}

View File

@ -0,0 +1,103 @@
package org.jeecg.modules.openapi.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 接口表
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OpenApi implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
private String id;
/**
* 接口名称
*/
private String name;
/**
* 请求方式如POST、GET
*/
private String requestMethod;
/**
* 对外开放的相对接口路径
*/
private String requestUrl;
/**
* IP 黑名单
*/
private String blackList;
/**
* 请求头列表
*/
@TableField(exist = false)
private List<OpenApiHeader> headers;
/**
* 请求参数列表
*/
@TableField(exist = false)
private List<OpenApiParam> params;
/**
* 目前仅支持json
*/
private String body;
/**
* 原始接口路径
*/
private String originUrl;
/**
* 状态(1正常 2废弃
*/
private Integer status;
/**
* 删除状态0正常1已删除
*/
@TableLogic
private Integer delFlag;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
}

View File

@ -0,0 +1,68 @@
package org.jeecg.modules.openapi.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* 权限表
* @date 2024/12/10 9:38
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OpenApiAuth implements Serializable {
private static final long serialVersionUID = -5933153354153738498L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
private String id;
/**
* 受权名称
*/
private String name;
/**
* access key
*/
private String ak;
/**
* secret key
*/
private String sk;
/**
* 系统用户ID
*/
private String systemUserId;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
}

View File

@ -0,0 +1,51 @@
package org.jeecg.modules.openapi.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 请求头表
* @date 2024/12/10 14:37
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OpenApiHeader implements Serializable {
private static final long serialVersionUID = 5032708503120184683L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
private String id;
/**
* 接口ID
*/
private String apiId;
/**
* key
*/
private String headerKey;
/**
* 是否必填(0:否1是)
*/
private Integer required;
/**
* 默认值
*/
private String defaultValue;
/**
* 说明
*/
private String note;
}

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