Compare commits

..

510 Commits

Author SHA1 Message Date
thinkgem
119ceae9fe update jdbc driver 2025-05-27 23:36:36 +08:00
thinkgem
f7381ab736 5.12.0 2025-05-26 10:19:07 +08:00
thinkgem
5a830b7307 新增用户界面的时区切换 2025-05-26 09:42:50 +08:00
thinkgem
b5bde1e58c JsonMapper日期类型转换代码优化 2025-05-24 18:42:19 +08:00
thinkgem
a35d4654f5 新增 LocaleUtils 本地化语言和时区对象管理工具类 2025-05-24 18:41:41 +08:00
thinkgem
4634055b43 DateUtils.parseDate 多格式字符串解析性能优化,并支持时区 2025-05-24 18:41:02 +08:00
thinkgem
b4629aa465 更新语言包 2025-05-24 18:36:24 +08:00
thinkgem
4b6cdce814 beetl 日期格式化,使用性能更好的 DataUtils 管理 2025-05-24 18:35:24 +08:00
thinkgem
c478f2a969 代码优化 2025-05-24 16:59:16 +08:00
thinkgem
c7d317c1da JsonMapper 使用 DateUtils 解析日期,以支持更多的格式;优化 JsonFormat 注解非日期类型的自定义 2025-05-19 10:44:20 +08:00
thinkgem
8f6fd6000f 移除 web.json.defaultDateFormat 参数,使用 DateUtils 解析,以支持更多的格式 2025-05-19 10:41:10 +08:00
thinkgem
8f1dbaf3bd DateUtils 增加 yyyy-MM-dd'T'HH:mm:ss'Z' 格式解析 2025-05-19 10:38:43 +08:00
thinkgem
a414489ea9 默认包含达梦和人大金仓驱动,减少咨询,由于个别jdbc驱动体积比较大,可按需移除依赖 2025-05-12 11:09:40 +08:00
thinkgem
dc23dbcd6d 当已知异常信息包含更多异常的时候,将异常信息打印到日志中 2025-05-09 17:49:23 +08:00
thinkgem
62294446bd fileAllowSuffixes add .ofd 2025-05-09 14:29:14 +08:00
thinkgem
d7433b3c45 顶部消息框优化 2025-05-08 09:51:58 +08:00
thinkgem
f88e432403 next 2025-05-08 09:50:49 +08:00
thinkgem
3d99759a06 表单界面优化 2025-05-07 14:55:06 +08:00
thinkgem
7601d4d530 增加参数 mybatis.orderBySqlFilter 仅对内部参数设置生效,UI传输的数据仍然必须经过过滤。 2025-05-07 12:19:23 +08:00
thinkgem
59996a2a5b 一级菜单美化,圆角展示选中背景色 2025-05-06 15:08:32 +08:00
thinkgem
a35b7fd143 切换主题时,刷新当前页,不跳转到首页 2025-05-06 15:06:05 +08:00
thinkgem
ad28115fb3 update DaoMapperTest.java 2025-04-29 15:43:04 +08:00
thinkgem
9a816b18c2 移动端代码生成模板增强 2025-04-27 22:16:12 +08:00
thinkgem
f3d283ae4e 移动端模板补充日期时间组件生成 2025-04-27 15:39:11 +08:00
thinkgem
3abf83ff63 修正移动端模板的一些问题,textarea v-model 重复问题;maxlength 为 0 问题;列表 query 参数不对问题 2025-04-27 14:23:47 +08:00
thinkgem
9fedbcaa64 增加 按多个角色查询用户接口 user.roleCodes 2025-04-25 18:47:42 +08:00
thinkgem
bd059ab63e 当选择控件未设置查询列的时候没有生成office接口问题 2025-04-25 18:46:39 +08:00
thinkgem
053f1ee499 5.11.1 2025-04-23 09:41:48 +08:00
thinkgem
4fa4ade638 健壮性增强 2025-04-21 13:40:08 +08:00
thinkgem
1ae24c82c0 删除用不到的文件 2025-04-21 13:38:33 +08:00
thinkgem
4b16fcf58a 界面优化 2025-04-19 09:58:30 +08:00
thinkgem
5f18c9635d 整理初始化数据库脚本菜单,扩展模块移到扩展菜单里。 2025-04-18 15:38:55 +08:00
thinkgem
8b58259c97 update Dockerfile 2025-04-17 16:15:44 +08:00
thinkgem
ce47d7f341 update docker-build.sh 2025-04-17 14:00:41 +08:00
thinkgem
6ad05b6037 调整属性文件加载顺序,classpath:application.yml 优先于 classpath:config/application.yml(升级注意) 2025-04-17 09:07:44 +08:00
thinkgem
645f6f68fc update h2 2025-04-17 09:06:37 +08:00
thinkgem
1a92a275cd 代码优化 2025-04-17 09:05:49 +08:00
thinkgem
33c1865bf1 优化界面 2025-04-15 12:42:09 +08:00
thinkgem
5e67bd380b 表格操作列图标更新、默认按钮美化、表格设置按钮更新 2025-04-14 12:59:22 +08:00
thinkgem
77f245cbd7 弹窗消息透明度修改为0.9 2025-04-14 12:55:23 +08:00
thinkgem
95f68ac197 新增 Markdown 编辑器,文件上传接口 2025-04-09 15:07:40 +08:00
thinkgem
dc348365ce update PropertiesUtils 2025-04-07 18:39:28 +08:00
thinkgem
8c7a50f679 remove SchemeHttpsConfig 2025-04-07 18:38:36 +08:00
thinkgem
a8fb860bc1 支持 dataSourceNames 免配置,自动读取 jdbc 的属性来加载多数据源 2025-04-07 18:37:15 +08:00
thinkgem
737219388c 代码生成模板中增加重启流程操作 2025-04-07 12:04:57 +08:00
thinkgem
f01b6e7818 webp格式上传,默认参数少个点 2025-04-07 11:53:51 +08:00
thinkgem
ec95efccbc 启用岗位角色权限权限后,给予操作提示 2025-04-04 17:18:50 +08:00
thinkgem
5ffcba1c4e 增加参数:登录后激活当前用户所在的主部门,默认为不激活即混合权限 2025-04-04 10:49:04 +08:00
thinkgem
78c10ba2be 优化 DataScope 数据权限,移除 apiMode 参数,增加 apiMode 方法;
优化 DataScope 数据权限,增加 debug、joinMode、ruleSql 方法,方便动态调用
优化 扩展查询 SQL 实现,使用 sqlMap().getColumn().addExtSql 替代 extColumnKeys;
优化 扩展查询 SQL 实现,使用 sqlMap().getTable().addExtSql 替代 extFormKeys;
优化 扩展查询 SQL 实现,使用 sqlMap().getWhere().addExtSql 替代 extWhereKeys;
新增 扩展更新 SQL 语句,sqlMap().getUpdate().addExtColumnSql 和 addExtWhereSql
2025-04-02 16:38:23 +08:00
thinkgem
e28f4c9d12 优化 SqlMap 性能,增加 update 和 insert 生成参数接口,方便在 Mapper 中直接引用。 2025-04-01 11:57:26 +08:00
thinkgem
f4adf804a3 update title 2025-03-31 11:27:49 +08:00
thinkgem
95b08d24cf 优化树表性能,左树右表联动时,减少一次查询 2025-03-31 09:42:17 +08:00
thinkgem
198e76110b 查询条件如区域、公司、配置、机构、岗位、栏目、站点、分类等显示编码使用 like 查询,等其它功能查询细节优化 2025-03-30 15:04:53 +08:00
thinkgem
c5cbb22621 优化树表管理代码生成模板,左树右表代码生成模板 2025-03-29 22:22:30 +08:00
thinkgem
c2fc3e5c96 /test/testTree/list to /test/testTree/index 2025-03-29 22:08:09 +08:00
thinkgem
00b53ba722 EncodeUtils增加手机号和邮箱的掩码处理方法 2025-03-29 22:07:18 +08:00
thinkgem
17d6d9a822 testTree增加index,左树快捷选择 2025-03-29 22:04:29 +08:00
thinkgem
0465f35d4c 支持机构子节点数据的机构负责人和电话的模糊查询 2025-03-29 11:15:58 +08:00
thinkgem
a2b19c4b17 更正机构导出模板的显示标题 2025-03-29 11:14:24 +08:00
thinkgem
99321f4943 公司和部门管理列表,根据代码模糊查询时,可以查出子节点 2025-03-28 10:20:19 +08:00
thinkgem
a4c3476693 优化外部调用接口调用测试类 2025-03-27 14:15:36 +08:00
thinkgem
415dc88a79 EncodeUtils.encodeUrl 忽略字符编码传递空值,默认 UTF-8 2025-03-27 14:14:24 +08:00
thinkgem
eaad1b6e51 next version 2025-03-27 09:00:06 +08:00
thinkgem
97e318725a 5.11.0 2025-03-24 14:42:12 +08:00
thinkgem
48801a5596 新增 sys.office.notAllowDeleteIfUserExists 和 sys.company.notAllowDeleteIfUserExists 参数,增加删除机构和公司数据的时候校验是否有用户 2025-03-24 14:03:51 +08:00
thinkgem
d127c2dc32 清理组织和公司下的用户缓存,包含子机构 2025-03-24 14:02:54 +08:00
thinkgem
4befea3e6f update productVersion 2025-03-24 13:59:26 +08:00
thinkgem
96a07e886d update 2025-03-22 18:52:01 +08:00
thinkgem
2f2b508225 网站优化一些基础样式 2025-03-22 18:48:57 +08:00
thinkgem
fbac25ef38 文章按权重排序修复 2025-03-22 18:48:12 +08:00
thinkgem
3aff37f35a add job init remarks 2025-03-17 15:41:47 +08:00
thinkgem
a1beed5b5e 属性获取工具,支持从系统环境变量中获取参数 2025-03-11 15:23:02 +08:00
thinkgem
fee4848ae2 update README.md 2025-03-11 15:22:26 +08:00
thinkgem
84d59dea96 jeesite-*.yml模块配置文件,增加IDEA提示助手 2025-03-08 10:11:37 +08:00
thinkgem
688797ae40 update 2025-03-04 13:03:34 +08:00
thinkgem
0132eb2a9e 修正安全管理器限制的本地调用 2025-03-04 09:51:14 +08:00
thinkgem
7eeae69a63 账号找回密码增加租户参数 2025-03-02 21:03:15 +08:00
thinkgem
6a83a0f8f2 登录界面租户框调整到上面 2025-02-28 16:55:15 +08:00
thinkgem
9c5dd7d7bb update config 2025-02-28 13:35:11 +08:00
thinkgem
14d772cf6d 个人中心代码优化 2025-02-26 14:21:31 +08:00
thinkgem
ee6715de0a next 2025-02-24 09:24:54 +08:00
thinkgem
52f3b0d2bf 新增字段权限接口,过滤 select 返回值,update 和 insert 字段值 2025-02-21 15:52:13 +08:00
thinkgem
f27dc31fb8 增加更严格的权限控制,对单条数据进行数据权限过滤 2025-02-21 15:47:17 +08:00
thinkgem
74b806ca1b AppComment合并更新状态方法 2025-02-21 15:45:05 +08:00
thinkgem
29f3c6894c 优化 编辑公司时,清理公司下的用户缓存 2025-02-20 17:50:06 +08:00
thinkgem
f9bcba6994 优化 编辑机构时,清理机构下的用户缓存 2025-02-20 17:49:44 +08:00
thinkgem
ed40654d6a 新增 findUserListByCompanyCodes 方法,根据公司编码获取用户编码和名称 2025-02-20 17:49:06 +08:00
thinkgem
208ba4a86e fileupload bizType参数为空时,readonly不生效问题 2025-02-20 17:47:42 +08:00
thinkgem
a88eca25ac update README.md 2025-02-17 10:49:20 +08:00
thinkgem
5191b82b0c 点击右上角【Star】收藏本软件 ^_^ 2025-02-17 10:49:08 +08:00
thinkgem
63e654977e 5.10.1 2025-02-15 21:16:53 +08:00
thinkgem
fed9b0b96c 自定义数据权限分配树,默认展开等级设为1 2025-02-15 16:41:18 +08:00
thinkgem
f049d83c5a 登录后不指定默认当前部门编号 2025-02-15 16:40:34 +08:00
thinkgem
8eab281a67 更新 visual 类名 2025-02-14 22:04:04 +08:00
thinkgem
6a985081b6 新增 条件规则数据权限、自定义SQL数据权限,暂存 2025-02-12 18:39:55 +08:00
thinkgem
af83d8fb2d 优化 二级管理员参数提示信息 2025-02-12 18:17:35 +08:00
thinkgem
46a1b57f63 remove aria-hidden="true" 2025-02-12 18:15:50 +08:00
thinkgem
5a3a04c987 新增 按菜单进行数据权限授权,后端通过addFilterByPermission方法调用权限。 2025-02-11 14:28:47 +08:00
thinkgem
728de01676 新增 user.dataScopeJoinMode 参数,默认关闭 JOIN 模式的数据权限,如有需要可打开此参数 2025-02-11 12:52:06 +08:00
thinkgem
ac699f9057 新增 列名 columnName 正则表达式的安全过滤 2025-02-11 12:46:41 +08:00
thinkgem
97b299a113 update 2025-02-11 12:43:57 +08:00
thinkgem
1b32b7700a 增加默认值 2025-02-07 20:44:16 +08:00
thinkgem
8b54a7c0e8 更新配置文件 2025-02-07 17:22:39 +08:00
thinkgem
b1b29715b8 代码优化 EmpUtils 增加 getCompanyCodes、getCompanyParentCodess 方法 2025-02-07 17:11:33 +08:00
thinkgem
477c5dcfbf 将 router.push 替换为 useGo 增加代码健壮性 2025-02-07 16:03:27 +08:00
thinkgem
761901e61d add ObjectUtilsTest.java 2025-02-05 21:10:28 +08:00
thinkgem
6de3df8c76 修正String转Long丢失精度问题 2025-02-05 21:09:53 +08:00
thinkgem
a790e357c7 新增 切换部门功能、多部门岗位权限 2025-02-01 16:22:34 +08:00
thinkgem
fa8d88285f 优化 查询当前员工关联的岗位信息和附属机构信息接口 2025-01-28 11:46:57 +08:00
thinkgem
2aa8472072 新增 获取当前用户岗位列表 EmpUtils.getEmployeePostList 缓存接口 2025-01-28 11:45:31 +08:00
thinkgem
83a8ed16d2 新增 岗位查询角色接口新增 postCode_in 查询条件 2025-01-28 11:44:10 +08:00
thinkgem
a7b458af90 丰富 EmployeeOffice 返回结果 2025-01-28 11:43:21 +08:00
thinkgem
4e6f27a2ab 新增 form:treeselect 组件 fieldNames 属性,自定义数据源的字段名 2025-01-28 11:41:17 +08:00
thinkgem
4287437d2e 从LoginController分离出SwitchController类 2025-01-27 23:43:11 +08:00
thinkgem
c86d16320f 修正 sqlserver 分页时,缺少 order by 的问题 2025-01-21 15:37:38 +08:00
thinkgem
30e725d256 优化 切换当前身份时,自动对应身份的桌面地址 2025-01-20 17:31:25 +08:00
thinkgem
dea24e73ec 新增 RSA 非对称加密工具 2025-01-16 17:36:02 +08:00
thinkgem
a5ae486f52 update README.md 2025-01-16 17:27:08 +08:00
thinkgem
34d55bfc4e format code 2025-01-14 10:37:46 +08:00
thinkgem
f591f4c07a update MsgPushTest 2025-01-13 15:09:47 +08:00
thinkgem
620b871368 update README.md 2025-01-10 14:00:31 +08:00
thinkgem
3d68d9f660 upgrade h2 to 2.2.224 2025-01-08 17:04:04 +08:00
thinkgem
696e6a97b1 update useless code 2025-01-08 17:02:48 +08:00
thinkgem
587ad5caef update README.md 2025-01-06 11:22:20 +08:00
thinkgem
d7d6bea8fe mybatis 3.5.16 2025-01-06 10:26:00 +08:00
thinkgem
2509d3cf2f next version 2025-01-06 09:58:43 +08:00
thinkgem
bb8a9e1054 update area data 2025-01-01 19:44:25 +08:00
thinkgem
55ad21e228 5.10.0 2025-01-01 11:05:38 +08:00
thinkgem
6b29c8c937 5.10.0 2024-12-31 21:04:15 +08:00
thinkgem
cf32922387 update import icon 2024-12-31 21:04:15 +08:00
thinkgem
5e87d44a3c 2025 2024-12-30 14:56:56 +08:00
thinkgem
0ef1eca662 update 2024-12-29 16:43:20 +08:00
thinkgem
203e21beed update bin 2024-12-26 11:42:58 +08:00
thinkgem
34b1ba00fd 上传文件必填时,防止表单验证提示输入历史 2024-12-25 16:20:46 +08:00
thinkgem
8e64c2c51b update README.md 2024-12-25 15:50:06 +08:00
thinkgem
62392702a6 update jdbc url 2024-12-25 10:30:26 +08:00
thinkgem
580f5eea55 remove beetl includeJSP 2024-12-23 17:15:54 +08:00
thinkgem
3623824a01 update README.md 2024-12-13 12:59:21 +08:00
thinkgem
b1409e88a1 update README.md 2024-12-12 18:16:41 +08:00
thinkgem
2b25eaa591 增加参考配置,可查看哪些用户的数据,ctrlPermi 更改为 0 后显示 2024-12-11 10:32:19 +08:00
thinkgem
38c8ea825a 细节优化,控制业务范围重命名为业务范围 2024-12-11 10:27:48 +08:00
thinkgem
56be7dd689 移除重复参数 2024-12-11 10:23:03 +08:00
thinkgem
8623b1a497 新增BigDecimalType 2024-12-05 11:12:14 +08:00
thinkgem
1c8a5adcd3 update 2024-12-05 11:12:07 +08:00
thinkgem
8d1bbde93b update version 2024-12-04 14:30:02 +08:00
thinkgem
a9054c7567 使用对象存储时,文件管理的在线预览文件中的下载地址修正 2024-12-04 14:17:22 +08:00
thinkgem
bca5facc4e update 2024-11-26 20:10:15 +08:00
thinkgem
a8d1080cfd update README.md 2024-11-24 20:36:53 +08:00
thinkgem
44ca71d681 5.9.2 2024-11-23 09:56:20 +08:00
thinkgem
6ecd94b954 update 2024-11-21 09:49:23 +08:00
thinkgem
cba1010a45 更新注册提示信息 2024-11-13 17:17:07 +08:00
thinkgem
9f1ebcd8e5 切换系统时,清除当前岗位和角色状态 2024-11-12 10:54:58 +08:00
thinkgem
998c3204a9 设备信息字段 device_info 长度调整为 4000 2024-11-11 17:12:05 +08:00
thinkgem
ac314d9070 登录后重定向地址验证,如果是非法地址,则指定默认的登录成功地址 2024-11-07 17:53:12 +08:00
thinkgem
7826863bb5 update README.md 2024-11-07 16:13:02 +08:00
thinkgem
4c96681055 新建 mini 迷你服务工具,最小化启动项目 2024-11-07 16:07:44 +08:00
thinkgem
7ca01a354a update version 2024-11-07 15:28:00 +08:00
thinkgem
71771421d5 Vue登录界面useCorpModel更改为loginCodeCorpUnique 2024-11-07 15:15:39 +08:00
thinkgem
5f664bd84b 新增 窗口右上角的头像下拉菜单,切换当前用户所属岗位,并联动切换当前菜单权限 2024-11-07 10:26:04 +08:00
thinkgem
5ea41881de 提升登录性能;支持普通用户升级为超管用户。 2024-11-07 10:22:36 +08:00
thinkgem
6e2843869d 优化 MenuDao.xml 接口 findByUserCode 替换为 findByRoleCodes 升级时注意 2024-11-07 10:19:30 +08:00
thinkgem
6a0ebd6c2d 新增 当前用户 user.getRoleList() 支持返回 岗位关联角色数据 2024-11-07 10:19:04 +08:00
thinkgem
48bd4778e6 新增 岗位关联角色(用户->岗位->角色)权限控制,可通过 user.postRolePermi=true 参数开启 2024-11-07 10:17:51 +08:00
thinkgem
d7ada6e4e6 增加岗位切换接口;优化登录菜单权限查询,直接通过当前用户角色查询,减少联表,提升查询效率。 2024-11-07 10:15:20 +08:00
thinkgem
f8a008d88b 优化 增加岗位保存时清理关联的用户缓存 2024-11-07 10:14:37 +08:00
thinkgem
7bfb458981 优化 超级管理员作为普通员工时的角色数据查询,允许修改超级管理员员工信息,不允许停用禁用删除超管 2024-11-07 10:12:46 +08:00
thinkgem
a2ffa1e47a 增加手机端单表代码生成模板 2024-11-05 11:25:53 +08:00
thinkgem
80b397e9e4 quartz 2.4.0.rc3 2024-11-04 18:14:03 +08:00
thinkgem
b008b0c956 修正代码生成时,子表文件生成目录不对问题,vue日期类型不匹配问题 2024-11-04 17:52:19 +08:00
thinkgem
d79339b891 jackson 2.18.1 2024-11-04 17:36:24 +08:00
thinkgem
81acccfe66 优化 mvc 接受字段类型不一致信息显示,方便调试 2024-11-01 19:59:56 +08:00
thinkgem
fe6004d81d 调整代码生成模板目录 2024-11-01 10:44:10 +08:00
thinkgem
e404d2652d 优化表单内表格的行高和边距 2024-10-28 21:27:42 +08:00
thinkgem
827d461437 update 2024-10-25 19:07:25 +08:00
thinkgem
a2da4f095b 5.9.1 2024-10-21 22:34:17 +08:00
thinkgem
302eb47b83 update app name 2024-10-21 14:12:03 +08:00
thinkgem
4fa6225017 logback 1.2.13 2024-10-14 21:16:38 +08:00
thinkgem
68058f948f spring 5.3.39 2024-10-10 20:48:58 +08:00
thinkgem
fc59e3a7aa 编辑表格中被隐藏的旧数据行控件忽略前端校验 2024-10-10 09:03:20 +08:00
thinkgem
d1cd3ad5ad update 2024-10-08 16:34:03 +08:00
thinkgem
213834810c 代码生成模板新增vue子表独立组件的生成 2024-10-08 14:13:37 +08:00
thinkgem
6d381b31da 代码生成支持带减号的工程模块名生成工程和微服务工程 2024-10-08 14:07:22 +08:00
thinkgem
5e55b5f4b3 驼峰命名法工具增加减号替换 2024-10-08 14:04:51 +08:00
thinkgem
e3dc77b75a 增加启动完成提示信息日志 2024-10-08 14:03:15 +08:00
thinkgem
58b22924dd 生成前端路径更改为 Vue 前端路径,仅用于分离端的代码生成路径。 2024-09-27 15:09:40 +08:00
thinkgem
f7cdda05d1 代码生成模板新增classNameSimple参数,不带模块名的类名。子表List字段名不带模块名。 2024-09-27 15:08:29 +08:00
thinkgem
cb52f25931 启动日志中显示 tomcat 版本号 2024-09-24 14:02:29 +08:00
thinkgem
5b9a7c1d2c 新增监控开关参数 服务器监控 state.server 缓存监控 state.cache 数据监控 state.druid 2024-09-23 13:32:53 +08:00
thinkgem
c295b87f35 文件预览列表增加文件名返回参数 2024-09-23 12:02:28 +08:00
thinkgem
d6eecc1c56 update upbw html 2024-09-22 19:28:28 +08:00
thinkgem
9d2a250d72 5.9.0 2024-09-18 09:45:20 +08:00
thinkgem
f0cc98e45b 增加 gen.simpleRequestMapping 默认参数 true 可简洁 url 地址 2024-09-18 09:08:41 +08:00
thinkgem
a8fbf4d2b1 fix 代码生成业务列表选择框i18n路径 2024-09-18 09:07:55 +08:00
thinkgem
2013201f06 数据源管理:新增连接等待时间、连接失败中断默认参数;新增集群支持,单机修改后自动同步到集群其它节点 2024-09-16 22:22:40 +08:00
thinkgem
425c74fab4 update README.md 2024-09-14 13:06:00 +08:00
thinkgem
b9fc0a9f86 update 2024-09-14 12:55:17 +08:00
thinkgem
ca256c1364 update 2024-09-14 12:54:35 +08:00
thinkgem
c484e19448 小屏幕下的菜单按钮布局优化 2024-09-13 10:47:33 +08:00
thinkgem
9275260019 默认显示列表搜索框 2024-09-13 10:46:31 +08:00
thinkgem
9a671d8dfd 默认显示列表搜索框 2024-09-13 10:46:24 +08:00
thinkgem
7b537b4c83 默认显示列表搜索框 2024-09-13 10:46:02 +08:00
thinkgem
223d05b8c1 默认显示列表搜索框 2024-09-13 10:45:55 +08:00
thinkgem
4ca8398f99 new version 2024-09-12 10:13:25 +08:00
thinkgem
cfc8681174 子表增加表单验证提示、代码格式化 2024-09-11 10:15:31 +08:00
thinkgem
9c5bfd9c59 update README.md 2024-08-29 16:23:08 +08:00
thinkgem
3f87f2a024 优化导入 2024-08-29 13:12:17 +08:00
thinkgem
c3a25b98ec update 2024-08-29 10:31:06 +08:00
thinkgem
5c09e3de51 新增支持 Vue 地址路由参数,使用 {param1} 自动替换为 :param1,用法详见 params.vue 2024-08-28 15:09:15 +08:00
thinkgem
91e08cf4df 新增导出Excel数据按钮loading状态 2024-08-27 14:40:41 +08:00
thinkgem
14a38abb6d update 2024-08-26 21:42:57 +08:00
thinkgem
99c778c92d update README.md 2024-08-22 17:40:54 +08:00
thinkgem
e51dd7c73c 优化流程表单模板,支持从表单进入显示审批意见框 2024-08-16 18:44:05 +08:00
thinkgem
67891ce361 update 2024-08-16 16:01:44 +08:00
thinkgem
25a192cd6a update 2024-08-15 19:59:47 +08:00
thinkgem
444463ed5e Merge branch 'refs/heads/v5.temp' into v5.8 2024-08-12 20:06:00 +08:00
thinkgem
77aeb4ac4f 5.8.1 2024-08-12 11:17:15 +08:00
thinkgem
2b122eecd5 优化查询的更多按钮,显示一个双箭头,增加动画效果 2024-08-12 10:21:41 +08:00
thinkgem
6ad196d82d 添加版本提示 2024-08-09 14:18:57 +08:00
thinkgem
b002592f4e 将账号+手机验证码登录,替换为手机号+验证码登录;当一个手机号绑定多个账号的时候,可以让用户选择登录的账号进行登录;新增userService.findListByMobile接口 2024-08-02 20:02:09 +08:00
thinkgem
3f6d1593b6 Excel导入导出支持ExcelFields注解添加到类上 2024-07-28 13:24:14 +08:00
thinkgem
db5f195fff 开放所有系统Controller给您足够的自定义空间 2024-07-26 11:20:50 +08:00
thinkgem
1c539f3796 代码优化 2024-07-26 11:04:34 +08:00
thinkgem
75e5e2765c 添加 webp 格式 2024-07-25 11:53:21 +08:00
thinkgem
fcf5d8a04c 代码优化 2024-07-25 11:36:22 +08:00
thinkgem
9f0d45cad9 新增 web.isDefaultResult 参数,默认全局进行接口结果包装为 { code: 200, msg: "", data: {} | [] };新增 web.resultParamName 和 headerParamName 参数,对个别结果进行包装 2024-07-24 14:59:19 +08:00
thinkgem
28ec083c26 update README.md 2024-07-24 14:54:42 +08:00
thinkgem
4c2d645b0a 新增 SM2Utils、SM3Utils、SM4Utils 国密算法工具类及测试类 2024-07-23 19:44:20 +08:00
thinkgem
eb94eba608 新增 encrypt.defaultKey 参数,适用于 Aes、M3 加密的默认秘钥;新增 encrypt.storeBase64 参数,是否将 Hex 编码改为 Base64 编码存储;新增 encrypt.smAlgorithm 参数,是否使用国密 SM 算法(一键替换 SHA-1 替换为 SM3、AES 替换为 SM4 算法) 2024-07-23 19:43:14 +08:00
thinkgem
bd5d543bf5 新增 encrypt.smAlgorithm 参数,是否使用国密 SM 算法(一键替换 SHA-1 替换为 SM3、AES 替换为 SM4 算法) 2024-07-23 19:42:29 +08:00
thinkgem
739f2d58b7 新增 EncryptTypeHandler、SM4TypeHandler 加密 MyBatis Handler 2024-07-23 19:39:49 +08:00
thinkgem
d62dc0310a 新增 encrypt.defaultKey 参数,适用于 Aes、M3 加密的默认秘钥;新增 encrypt.storeBase64 参数,是否将 Hex 编码改为 Base64 编码存储 2024-07-23 19:39:26 +08:00
thinkgem
f4456ec359 优化 加密算法工具类,增加测试类。 2024-07-23 19:37:47 +08:00
thinkgem
8cdd2fd99c 添加 bcprov 算法类库 2024-07-23 19:37:19 +08:00
thinkgem
7e3a55a578 open beetl <#form:xxx 控件 2024-07-22 15:42:51 +08:00
thinkgem
7ce1f84866 open beetl functions form 2024-07-22 15:39:44 +08:00
thinkgem
ccc3ea6894 open beetl functions menu 2024-07-22 15:39:33 +08:00
thinkgem
b5c100f9a6 open views upgrade.html 2024-07-22 15:38:54 +08:00
thinkgem
cf151678a9 open views tagsview/form 2024-07-22 15:38:28 +08:00
thinkgem
2ba4d16ef1 open views modules/sys 2024-07-22 15:38:06 +08:00
thinkgem
dfbc3284b4 webuploader move to static 2024-07-21 20:27:22 +08:00
thinkgem
9317d0e6bb wdScrollTab move to static 2024-07-21 20:26:48 +08:00
thinkgem
474fee2943 ueditor move to static 2024-07-21 18:33:57 +08:00
thinkgem
5d1fe5236a sys js and css move to static 2024-07-21 18:33:37 +08:00
thinkgem
808175d835 jquery-validation move to static 2024-07-21 18:32:37 +08:00
thinkgem
3ba3aa2b2b jquery-toastr move to static 2024-07-21 18:32:18 +08:00
thinkgem
aba56f7aa2 jquery-timeago move to static 2024-07-21 18:31:51 +08:00
thinkgem
648199245a jquery plugins move to static 2024-07-21 18:30:40 +08:00
thinkgem
893292ed20 jqGrid move to static 2024-07-21 18:28:22 +08:00
thinkgem
68a26fa727 images move to static 2024-07-21 18:17:15 +08:00
thinkgem
d0a2cbfa58 fullcalendar move to static 2024-07-21 18:16:58 +08:00
thinkgem
dffd48c454 echarts move to static 2024-07-21 18:16:43 +08:00
thinkgem
92c41f0cb5 cropper move to static 2024-07-21 18:15:46 +08:00
thinkgem
8e3992767c commonjs move to static 2024-07-21 18:15:23 +08:00
thinkgem
e3c2bb82fd colorpicker move to static 2024-07-21 18:14:53 +08:00
thinkgem
3924575550 ckplayer move to static 2024-07-21 18:10:26 +08:00
thinkgem
826698a809 ace-editor move to static 2024-07-21 18:10:04 +08:00
thinkgem
a0fa0281fa add static module 2024-07-21 17:55:49 +08:00
thinkgem
53bea929c1 add upbw page 2024-07-21 17:46:03 +08:00
thinkgem
2922d90dd9 add jquery layout 2024-07-21 17:45:29 +08:00
thinkgem
0ec8e0b89a add cascadeSelect js 2024-07-21 17:44:35 +08:00
thinkgem
184e7ad554 新增 PwdService 服务类方便自定义重写密码相关实现 2024-07-21 17:43:21 +08:00
thinkgem
49e669c47e 新增cas经典协议兼容模块 2024-07-21 17:42:51 +08:00
thinkgem
4469aad2c8 new version 2024-07-19 08:54:05 +08:00
thinkgem
18831ab95d 增加Excel导入导出测试类,增加模板导出。 2024-07-18 15:52:28 +08:00
thinkgem
bddf67e726 update README.md. 2024-07-17 08:59:09 +08:00
thinkgem
01779973e5 add ckplayer 2024-07-17 08:59:03 +08:00
卓源软件
97ebfe40be update README.md.
Signed-off-by: 卓源软件 <thinkgem@163.com>
2024-07-17 00:14:18 +00:00
thinkgem
4e249c116c 修复UEditor上传视频的首图不显示的问题 2024-07-11 10:22:51 +08:00
thinkgem
d909a2527a update 2024-07-11 09:47:21 +08:00
thinkgem
32a7e1a5f8 format pom.xml 2024-07-07 19:10:28 +08:00
thinkgem
e5d217f5b2 poi version 2024-07-07 12:21:30 +08:00
thinkgem
72b030bcc1 Merge poi version 2024-07-07 12:20:42 +08:00
thinkgem
090b2cd3fc 将 test 独立出模块,方便代码管理 2024-07-06 22:22:06 +08:00
thinkgem
9b4b4affa0 使用 __url 参数统一管理成功跳转地址 2024-07-06 10:23:10 +08:00
thinkgem
09d2af2491 update 2024-07-04 19:23:08 +08:00
thinkgem
e279700113 新增附属部门切换接口,方便获取当前默认部门 2024-07-04 16:45:07 +08:00
thinkgem
b36bdbdd48 5.8.0 2024-07-03 12:53:22 +08:00
thinkgem
02d0992694 5.8.0 2024-07-01 18:51:53 +08:00
thinkgem
75b66fbc29 匿名类添加过滤器名称,防止被重名覆盖 2024-07-01 18:39:08 +08:00
thinkgem
51ea1cebb3 update 2024-07-01 18:37:40 +08:00
thinkgem
f7fc2ff8ad 5.8.0 2024-06-26 11:22:23 +08:00
thinkgem
f8f8469c3a mybatis 3.5.15、jsqlparser 4.7、tools... 2024-06-25 21:48:48 +08:00
thinkgem
50136e09a2 update 2024-06-25 18:34:59 +08:00
thinkgem
66d7ec04dc uploadPath参数增加变量corpCode、userCode、userType、userCache中的key 2024-06-24 11:32:31 +08:00
thinkgem
e714923b47 update sso api success url 2024-06-22 09:06:09 +08:00
thinkgem
456eb9644b 当没有传递参数类型并有方法重载时,需优先获取无参数的方法名 2024-06-20 17:56:37 +08:00
thinkgem
46e0ee7717 更新CMS全文搜索模块安装提示 2024-06-03 10:58:13 +08:00
thinkgem
67041873fc 消息查看增加空值校验 2024-06-03 10:56:53 +08:00
thinkgem
2d298a6fc7 next 2024-05-28 15:03:01 +08:00
thinkgem
d3de1eb957 增加ctxPath参数,当映射根路径不同的时候使用 2024-05-28 14:39:15 +08:00
thinkgem
5c09f28266 update 2024-05-27 15:30:06 +08:00
thinkgem
15947015f8 add dbm module 2024-05-27 15:28:39 +08:00
thinkgem
d46ee0c359 file.uploadPath 增加 {bizType} 变量 2024-05-27 15:24:18 +08:00
thinkgem
11c8c3e0f7 update 2024-05-23 08:51:33 +08:00
thinkgem
afdbef4f26 get cookie add xss 2024-05-20 10:29:34 +08:00
thinkgem
541656c60a 大文件下载 2024-05-17 12:30:56 +08:00
thinkgem
68cfc664ec gen template type fix 2024-05-14 22:26:20 +08:00
thinkgem
ad423b4b9b update README.md 2024-05-14 19:18:28 +08:00
thinkgem
4c9ca4d932 update README.md 2024-05-14 18:47:42 +08:00
thinkgem
d6237f719b 5.7.1 2024-05-13 10:13:08 +08:00
thinkgem
3cd5b2379d 代码优化 2024-05-11 15:28:31 +08:00
thinkgem
ad292502a9 skinName add xssFilter 2024-05-11 15:28:01 +08:00
thinkgem
1ac8085c8c biz_category 2024-05-11 14:24:09 +08:00
thinkgem
df5e557f21 MsgInnerService抽离接口 2024-05-11 14:23:04 +08:00
thinkgem
0484e1f64d 调整配置文件目录 2024-05-11 13:43:39 +08:00
thinkgem
6ac8a82718 update README.md 2024-05-10 22:52:25 +08:00
thinkgem
163a387099 update 2024-05-10 17:41:59 +08:00
thinkgem
7b84892389 update 2024-05-08 16:47:27 +08:00
thinkgem
0d4701c8cc h2数据表增加备注信息 2024-05-08 15:16:16 +08:00
thinkgem
563571ae53 添加达梦和金仓数据库的驱动注释 2024-05-07 13:58:15 +08:00
thinkgem
4575e6c211 字典值dict_value字段存储加长 2024-05-07 13:42:45 +08:00
thinkgem
49464e8bca update 2024-05-07 13:41:28 +08:00
thinkgem
9ccfd534d0 bootstrap css 3.4.1 2024-05-07 13:40:52 +08:00
thinkgem
e68f96f3d6 update 2024-05-02 21:16:56 +08:00
thinkgem
07ba80ec4b update yml help 2024-04-30 17:57:20 +08:00
thinkgem
3671148f56 重命名一些CMS模块字段名,避免有些数据库关键字问题 2024-04-29 14:58:52 +08:00
thinkgem
6e56e515ae 新增业务分类功能维护,作为通用业务分类,替换流程分类 2024-04-27 18:08:56 +08:00
thinkgem
e6257a98c1 add dbm 2024-04-27 11:27:42 +08:00
thinkgem
6a7817137a update 2024-04-27 10:26:44 +08:00
thinkgem
b32ffa3b6a update 2024-04-26 16:14:29 +08:00
thinkgem
95ec1770df 美化表单的子标题缩进一些及其它细节 2024-04-26 08:28:39 +08:00
thinkgem
9573da0309 添加 IdGen.randomShortString() 方法 2024-04-25 23:31:11 +08:00
thinkgem
aedd50c8c2 update 2024-04-25 23:30:32 +08:00
thinkgem
d8d8902e71 修改前后差异数据表格展示表格美化 2024-04-23 15:39:00 +08:00
thinkgem
b4ffcf6f47 update 2024-04-23 15:37:26 +08:00
thinkgem
e3851a1066 bpm:comment 组件增加 showCommWords 参数 2024-04-22 20:54:05 +08:00
thinkgem
47c88e5c6d update 2024-04-21 19:54:25 +08:00
thinkgem
05641a271e 后端验证提示信息优化 2024-04-21 19:53:27 +08:00
thinkgem
657f22da98 前后差异日志分析,排除@id的属性展示,展示界面美化 2024-04-21 19:52:26 +08:00
thinkgem
03ad0954e2 提高日志标题生成的准确率 2024-04-21 19:50:02 +08:00
thinkgem
992e3c0cb7 样式细节优化 2024-04-19 19:04:19 +08:00
thinkgem
c62f575d10 后面显示编号的,去掉括号前的空格 2024-04-19 19:03:45 +08:00
thinkgem
db5778a833 update 排除 char 2024-04-19 19:03:05 +08:00
thinkgem
396e506936 新增一些便捷方法,如果有设定属性值再使用 2024-04-18 21:56:09 +08:00
thinkgem
2029cfc65a 新增能接受异常的 Function 2024-04-18 21:54:24 +08:00
thinkgem
8de5edc40e 增加 连接池 查询超时时间、事务超时时间 参数 2024-04-18 21:46:18 +08:00
thinkgem
37a74e7168 标题子标题优化 2024-04-18 21:22:12 +08:00
thinkgem
29345f8873 validation abc 验证增加字母验证要求 2024-04-18 21:21:00 +08:00
thinkgem
e9da7f1926 liquibase 4.20.0 2024-04-17 12:18:53 +08:00
thinkgem
5cd3b507e4 代码优化 2024-04-17 10:27:15 +08:00
thinkgem
533473b315 update format 2024-04-17 09:05:48 +08:00
thinkgem
9eab7217cc fix crud_cloud_select_vue 2024-04-15 11:15:54 +08:00
thinkgem
553a0d652a 样式美化 2024-04-12 18:02:13 +08:00
thinkgem
4bc6d9e498 公司部门岗位增加代码模糊查询 2024-04-11 15:55:41 +08:00
thinkgem
f1e7e5b8ee update 2024-04-11 15:54:59 +08:00
thinkgem
b99fcbad06 update 2024-04-10 14:16:43 +08:00
thinkgem
d9b626e925 更新apiMode提示 2024-04-09 14:46:47 +08:00
thinkgem
0106d47779 data-params to data-url-params 2024-04-09 08:53:16 +08:00
thinkgem
30e4839da1 自动排序号优化 2024-04-08 10:23:53 +08:00
thinkgem
73d910ad13 update 2024-04-08 10:09:11 +08:00
thinkgem
a407593fc0 new version 2024-04-07 09:26:19 +08:00
thinkgem
c3c377ba94 add testResource config 2024-04-05 16:54:14 +08:00
thinkgem
f130af6d7a 仅侧边栏时加 first-open 2024-04-05 16:53:10 +08:00
thinkgem
ef4d06ff2e update README.md 2024-04-01 12:03:00 +08:00
thinkgem
24d51e416e web-fast 默认使用 vue 前端展示 2024-04-01 12:02:36 +08:00
thinkgem
ed836c2f6a update PageNotFound log level 2024-04-01 11:57:44 +08:00
thinkgem
529d2b8192 代码优化 2024-04-01 11:52:46 +08:00
thinkgem
9c0885b4c9 增加msgview初始菜单地址 2024-04-01 11:52:20 +08:00
thinkgem
7ccbb05b7b 代码优化 2024-04-01 11:51:19 +08:00
thinkgem
53af15f85d 5.7.0 2024-03-28 14:15:33 +08:00
thinkgem
21b15f16e3 更新建表语句 2024-03-28 14:14:34 +08:00
thinkgem
8176853791 vue icon add prefix i- 2024-03-27 11:12:14 +08:00
thinkgem
a56e29d8f7 update import 2024-03-27 11:11:36 +08:00
thinkgem
081505f79c update import 2024-03-26 19:27:48 +08:00
thinkgem
a6adfbc726 新增IP地址黑白名单过滤器及参数配置 2024-03-25 13:57:03 +08:00
thinkgem
e883de354f 更新注释提示 2024-03-25 13:52:46 +08:00
thinkgem
f4909921ac update fonts 2024-03-22 21:45:17 +08:00
thinkgem
0eb09a0dbb 增加根据用户编码查询岗位列表接口 2024-03-22 14:43:02 +08:00
thinkgem
a58a2dcda2 侧边栏增加是否展开第一个菜单开关 2024-03-22 14:42:26 +08:00
thinkgem
1318ce840c format code 2024-03-22 14:40:54 +08:00
thinkgem
0a771a7008 EmployeePostDao 增加根据用户编码查询岗位 sqlMap().loadJoinTableAlias("p,u") 的时候有效 2024-03-22 14:40:15 +08:00
thinkgem
2ea481a417 模块管理增加生成模块的基础路径和模板存储字段,生成模块代码时给于确认提示;微服务下isLoader为true; 2024-03-22 09:16:33 +08:00
thinkgem
07d3eef8ab 修正代码生成模板logback-spring-elk和prod.xml文件名 2024-03-22 09:15:51 +08:00
thinkgem
f3c4a0dbe9 add getPageList(List<T> list, int pageNo, int pageSize) 2024-03-21 15:46:14 +08:00
thinkgem
8f14549fee 分离端调用login和index接口时,同时返回cookie。特殊情况下的iframe的页面会话同步 2024-03-20 14:05:38 +08:00
thinkgem
bccecc8b39 update productVersion 2024-03-20 09:39:05 +08:00
thinkgem
4a8bad7d35 返回响应头增加x-token,通过记住我登录系统时使用。 2024-03-13 13:34:17 +08:00
thinkgem
8ef29563f5 演示模式不允许清理会话和缓存 2024-03-13 13:29:02 +08:00
thinkgem
87b8dc6ec4 返回响应头增加x-token,通过记住我登录系统时使用。 2024-03-13 13:18:36 +08:00
thinkgem
b1f29a9d57 代码生成器config.xml的attrType字典增加attrName,用于选择控件编码和名称获取 2024-03-13 11:35:16 +08:00
thinkgem
33eb95f120 登录超时后不再统计在线人数 2024-03-12 13:20:44 +08:00
thinkgem
4bfe7b2316 缩短Logback日志TRACE_ID的长度 2024-03-12 12:24:24 +08:00
thinkgem
b0350b36d7 完善内部消息保存后的提示消息 2024-03-12 12:23:39 +08:00
thinkgem
9f16332c09 代码生成模板添加公司选择组件v2 2024-03-11 21:24:20 +08:00
thinkgem
419ed4f01b 新增 AesTypeHandler 处理字段数据加密解密或脱敏;新增 JsonTypeHandler 处理字段数据进行 JSON 字符串与 Java 对象 自动互转 2024-03-11 17:02:40 +08:00
thinkgem
69cd032b7e 代码优化 2024-03-11 17:01:20 +08:00
thinkgem
c0aeef4881 代码生成模板添加公司选择组件 2024-03-10 10:44:00 +08:00
thinkgem
e7c6e7e85b add vueFormRoute.xml 2024-03-10 10:42:17 +08:00
thinkgem
7f06df2bed 根据当前用户有的子系统,切换到默认系统下 2024-03-08 13:29:42 +08:00
thinkgem
250788a398 update nacos config 2024-03-04 11:50:43 +08:00
thinkgem
196cf4f10c 更新Docker多CPU平台架构 2024-02-28 10:35:36 +08:00
thinkgem
3b587c661b fix h2db job sql 2024-02-28 10:07:14 +08:00
thinkgem
7eb9484d7e TimeUtils millisecond to ms 2024-02-27 11:30:41 +08:00
thinkgem
c610af7c6b 分页栏居右、布局调整、样式美化 2024-02-23 14:16:28 +08:00
thinkgem
0c7cefb184 next version 2024-02-23 14:05:06 +08:00
thinkgem
19d2399eb2 5.6.1 2024-02-18 16:01:14 +08:00
thinkgem
37b0a120c9 1、修改默认值,oracle 下默认不启用 maxPoolPreparedStatementPerConnectionSize 可根据需要开启;2、将 com.oracle.ojdbc 驱动替换为 com.oracle.database.jdbc 驱动;3、默认将 jtds 驱动替换为 sqlserver 驱动; 2024-02-02 14:03:11 +08:00
thinkgem
5fb6ab0ca6 ueditor黑暗模式下的文字 2024-01-31 12:04:34 +08:00
thinkgem
2ba8b953d3 更新路由表单组件 2024-01-30 16:53:39 +08:00
thinkgem
738fd5c552 form:fileupload组件默认加dataMap属性 2024-01-30 11:40:29 +08:00
thinkgem
745f6e88c0 新增 js.ajaxSubmitForm支持application/json提交表单;新增 js.ajaxSubmitJson 方法 2024-01-30 11:38:39 +08:00
thinkgem
3db837d6d6 代码优化 2024-01-26 14:43:03 +08:00
thinkgem
14054a964f ts type check 2024-01-23 17:53:07 +08:00
thinkgem
14581655d2 code format 2024-01-17 16:17:09 +08:00
thinkgem
f162584d1e 代码优化,方便自定义内嵌的Web服务 2024-01-15 13:44:39 +08:00
thinkgem
e57e8127b5 报表增加请求参数的例子 2024-01-10 13:08:17 +08:00
thinkgem
b7d4efa6a6 update 2024-01-10 13:04:34 +08:00
thinkgem
91a4db4eb8 增加vue无框架页面的组件类型 2024-01-09 16:42:53 +08:00
thinkgem
7ed84e48cf 存储Key增加了默认,个性化时再指定 2024-01-08 15:25:41 +08:00
thinkgem
f068bd9c90 update version 2024-01-08 10:39:18 +08:00
thinkgem
4ae907a023 update 2024-01-05 20:49:46 +08:00
thinkgem
652a242c2b 5.6.0 2024-01-04 12:06:16 +08:00
thinkgem
d242408de2 5.6.0 2024-01-03 16:58:35 +08:00
thinkgem
b8f51011ed 配置类 ShiroConfig 改为 ShiroAutoConfiguration 方便覆写 2024-01-03 08:53:55 +08:00
thinkgem
84913ab783 分号修正 2024-01-03 08:24:38 +08:00
thinkgem
b7bb765193 update 2024 2024-01-02 10:24:19 +08:00
thinkgem
d1b06c45c8 add ConditionalOnMissingBean 2024-01-02 10:23:37 +08:00
thinkgem
19fe2023a6 update 2024-01-02 10:22:57 +08:00
thinkgem
590046d90c select2 i18n fix 2023-12-29 10:56:03 +08:00
thinkgem
00c162ece1 代码优化提示 2023-12-28 09:33:20 +08:00
thinkgem
d5deb38769 优化在线用户列表数值类型的排序 2023-12-27 10:47:44 +08:00
thinkgem
b71165f73c 代码生成模板:新增Vue路由表单、新增Vue弹窗表单、新增仅后端模板 2023-12-24 21:36:09 +08:00
thinkgem
4260accf88 不设置adminPath的时候需要增加oauth2的地址认证排除 2023-12-23 23:01:37 +08:00
thinkgem
353131ab2c 用户管理增加解冻用户功能提示 2023-12-23 23:00:30 +08:00
thinkgem
acb6baa226 细节优化 2023-12-23 22:59:38 +08:00
thinkgem
5b7f7b0860 spring boot 2.7.18、jackson 2.16.0、fastjson 2.0.43、mybatis 3.5.14、shiro 1.13.0 2023-12-13 21:37:09 +08:00
thinkgem
c57238e279 spring.data.elasticsearch.enabled to spring.elasticsearch.enabled 2023-12-13 21:06:42 +08:00
thinkgem
24ea4aaed0 增加一些vue下用的路由 2023-12-12 09:42:56 +08:00
thinkgem
0af1ae18c8 update 2023-12-12 09:41:38 +08:00
thinkgem
e054df919f BpmButton.vue将提交审批信息移动到提交对话框中 2023-12-07 17:20:30 +08:00
thinkgem
a9ca557672 update 2023-12-05 16:30:31 +08:00
thinkgem
5bc76dd23d update 2023-12-05 16:12:42 +08:00
thinkgem
f337faeecc 代码优化 2023-12-03 15:55:22 +08:00
thinkgem
a6d84c59c9 vue兼容优化 2023-12-01 10:40:54 +08:00
thinkgem
b8279ffe64 优化修改密码后的操作 2023-11-28 16:15:16 +08:00
thinkgem
af44331820 优化vue生成模板 2023-11-28 15:46:05 +08:00
thinkgem
00ead34076 BasicTable子表加TextArea组件 2023-11-27 12:23:54 +08:00
thinkgem
9b07e167f7 树表的局部刷新改进,删除、停用、启用、修改父节点的情况下完美体验 2023-11-27 10:11:56 +08:00
thinkgem
0fb15e31d6 next 2023-11-27 09:06:15 +08:00
thinkgem
3e769325f8 Layer弹窗后首先关闭获取焦点,防止回车弹出多个 2023-11-22 11:14:08 +08:00
thinkgem
d555d508c3 5.5.2 2023-11-21 21:47:55 +08:00
thinkgem
11511c14bd 更新h2的库名 2023-11-20 16:01:08 +08:00
thinkgem
2238ca062f 添加自动切换到脚本所在目录 2023-11-20 15:43:41 +08:00
thinkgem
3563f18335 更新docker运行脚本帮助 2023-11-20 15:16:26 +08:00
thinkgem
983ad2faff add db docs xlsx png 2023-11-17 11:17:35 +08:00
thinkgem
f569da908d 增加quartz表ER图和注释 2023-11-16 11:57:02 +08:00
thinkgem
2e0718ba41 增加vue的ListSelect选择框代码生成模板 2023-11-09 11:31:31 +08:00
thinkgem
846bf82375 Byte格式化默认显示两位小数 2023-11-08 11:46:51 +08:00
thinkgem
8cc6f25dd1 添加jdbc.connectTimeou和jdbc.socketTimeout连接池参数 2023-10-30 08:44:44 +08:00
thinkgem
5ff9ca9815 update version 2023-10-26 11:38:15 +08:00
thinkgem
31e6b01b4e 新增一个日志清理接口,可根据需要创建job调用 2023-10-26 11:27:50 +08:00
thinkgem
bc8a6d2db7 新增富文本和头像的对象存储调用 2023-10-23 10:57:27 +08:00
thinkgem
9a13b33dd8 查询和重置增加图标、搜索框布局优化 2023-10-23 10:55:34 +08:00
thinkgem
4bdba535bb 5.5.1 2023-10-16 21:43:00 +08:00
thinkgem
09bf40feee update README.md 2023-10-16 20:06:08 +08:00
thinkgem
5d74d2783f update README.md 2023-10-16 07:00:46 +08:00
thinkgem
807b47dbc4 docker update 2023-10-12 14:50:32 +08:00
thinkgem
456cdaf883 Merge remote-tracking branch 'origin/v5.temp' into v5.temp 2023-10-07 17:14:35 +08:00
thinkgem
d1b588b7d5 spring boot 2.7.16 2023-10-07 15:05:45 +08:00
thinkgem
22a4b0fcf7 update README.md 2023-10-07 10:57:23 +08:00
thinkgem
84407b5785 修改erm默认字体大小,适应多操作系统 2023-10-01 16:52:45 +08:00
thinkgem
f5771c56a4 修改erm默认字体大小,适应多操作系统 2023-09-28 16:54:29 +08:00
thinkgem
a3dee0f70a 优化JsonMapper,增加XSS过滤通用方法 2023-09-27 13:19:22 +08:00
thinkgem
797abcdf87 update README.md 2023-09-19 14:27:28 +08:00
thinkgem
0559c79687 update 2023-09-18 10:59:26 +08:00
thinkgem
f514b86bbc linux下如果有前缀就不增加了 2023-09-18 10:59:10 +08:00
thinkgem
49992195df update script 2023-09-12 10:26:09 +08:00
thinkgem
631225a108 new version 2023-09-11 13:49:25 +08:00
thinkgem
5922951c16 add startup info 2023-08-30 15:32:57 +08:00
thinkgem
5dc1b29a34 snakeyaml 1.33 2023-08-22 17:10:16 +08:00
thinkgem
97252f7d82 5.5.0 2023-08-21 17:09:42 +08:00
thinkgem
efa8d7788a maven ssl 2023-08-21 13:10:53 +08:00
thinkgem
40c5759f59 update area data 2023-08-21 11:07:02 +08:00
thinkgem
13df22605b update 2023-08-21 10:37:54 +08:00
thinkgem
a2644570be update 5.5 2023-08-17 14:26:18 +08:00
thinkgem
da12b2d092 角色增加包含系统参数,切换系统时只需展示当前用户包含的子系统 2023-08-16 16:30:07 +08:00
thinkgem
f5080cd8f5 new version 2023-08-16 10:43:18 +08:00
thinkgem
729801bab5 隐藏表单右上角按钮 2023-08-14 12:40:18 +08:00
thinkgem
0de77acca2 spring boot 2.7.14 2023-08-14 12:37:47 +08:00
thinkgem
7128998483 update README.md 2023-08-09 19:49:08 +08:00
thinkgem
1becabaea3 升级jquery migrate版本,解决ie9下的一些问题修复 2023-08-09 19:38:20 +08:00
thinkgem
23b726e335 downloadByUrl支持post带参数下载文件 2023-08-09 16:45:48 +08:00
thinkgem
6909116d9a 下载文件增加clearParams参数,清理掉不需要添加的请求参数,如:pageNo 2023-08-09 16:42:03 +08:00
thinkgem
12132ab592 html和js语法编写不同的占位符,减少IDE标红提示 2023-08-03 17:22:41 +08:00
thinkgem
920a1a8916 remove web.xml 2023-08-03 11:16:17 +08:00
thinkgem
eaa6646a74 增加缩略图生成设置,前端组件可使用 imageThumbName 使用缩略图 2023-08-02 10:42:02 +08:00
thinkgem
696b7addb9 ImageUtils 生成缩略图,增加目标文件参数,可以不是原文件 2023-08-02 10:39:26 +08:00
thinkgem
43fbbda930 修改弹窗表头高度小一点 2023-08-01 11:28:09 +08:00
thinkgem
727454d2a7 用户列表选择样式优化 2023-08-01 11:27:05 +08:00
thinkgem
33d0693bb1 online 代码优化 2023-08-01 11:24:29 +08:00
thinkgem
1eaff67ffd update 2023-07-31 10:01:41 +08:00
thinkgem
f54126bc07 update build time 2023-07-30 20:13:39 +08:00
thinkgem
fce22831ab update build time 2023-07-30 20:09:04 +08:00
thinkgem
ae17e2c2a4 shiro 1.12.0 2023-07-27 21:43:00 +08:00
thinkgem
db9ff3647a update 2023-07-26 14:57:31 +08:00
thinkgem
e5f5c4cd11 5.4.1 2023-07-24 18:13:47 +08:00
thinkgem
1098757b6a update script 2023-07-21 23:47:28 +08:00
thinkgem
084bfaac92 update version 2023-07-19 19:31:07 +08:00
thinkgem
e7ec4c52e8 国际化完善 2023-07-18 11:55:35 +08:00
thinkgem
02f0e1b300 基础圆角调整 antdv4.0 2023-07-17 12:54:48 +08:00
thinkgem
e7e15fd15e 多语言译文优化 2023-07-17 11:34:38 +08:00
thinkgem
a2d873fee5 将语言名称传递给vue,登录时检测 2023-07-17 10:54:47 +08:00
thinkgem
48a93201e6 update readme 2023-07-11 10:49:47 +08:00
thinkgem
e3e222d7bb update 2023-07-11 10:16:12 +08:00
thinkgem
050aa6e4bf update 2023-07-05 16:23:26 +08:00
thinkgem
a0bfba3abb 权限授权树,如果没有数据的时候可以隐藏 2023-07-05 16:22:55 +08:00
thinkgem
96838f50ad update 2023-07-05 16:21:51 +08:00
thinkgem
0a3c0e4bc8 update 2023-06-28 19:16:44 +08:00
thinkgem
0d24b71fe3 增加参数 web.xssFilterExcludeUri 2023-06-28 19:05:55 +08:00
thinkgem
e658f9e6f6 update 2023-06-28 17:11:18 +08:00
262 changed files with 895 additions and 7668 deletions

View File

@@ -1,25 +1,23 @@
### 是什么问题、该问题是怎么引起的?
1. 这里替换为你的问题
1.
### 重现步骤、期望结果、截图、代码
1. 这里替换为你的操作步骤,期望结果
1.
```
这里贴你的代码块
```
### 实际结果、报错信息、截图
1. 这里替换为你的操作步骤的实际结果
1.
```
这里贴你的错误信息
这里贴错误信息
```
### 环境版本:
- JDK版本1.8、11、17、21
- JDK版本1.8、11、17
- 浏览器版本Chrome xx、Firefox xx、IE xx
- 平台版本JeeSite 4.x.x、5.x.xpom.xml里查看

View File

@@ -2,7 +2,7 @@
<p align="center">
<img alt="JeeSite" src="https://jeesite.com/assets/images/logo.png" width="120" height="120" style="margin-bottom: 10px;">
</p>
<h3 align="center" style="margin:30px 0 30px;font-weight:bold;font-size:30px;">快速开发平台 - Spring Boot 3</h3>
<h3 align="center" style="margin:30px 0 30px;font-weight:bold;font-size:30px;">快速开发平台 - Spring Boot</h3>
<p align="center">
<a href="https://spring.io/projects/spring-boot" target="__blank"><img alt="SpringBoot-V2.7/3.4" src="https://img.shields.io/badge/SpringBoot-V2.7/3.4-blue.svg"></a>
<a href="https://v3.cn.vuejs.org/" target="__blank"><img alt="TypeScript-Vue3" src="https://img.shields.io/badge/TypeScript-Vue3-green.svg"></a>
@@ -70,8 +70,6 @@
* 2021 年终发布 Vue3 的前后分离版本,使得 JeeSite 拥有同一个后台服务 Web 来支撑分离版和全栈版两套前端技术栈。
* 对接常见 AI 大模型OpenAPI、Ollama、DeepSeek等支持检索增强生成 RAG 技术,实现企业知识库智能对话。
* 支持国产化软硬件环境,如国产芯片、操作系统、数据库、中间件、国密算法等。
## 核心优势
@@ -97,17 +95,17 @@
## 技术选型
* 主框架Spring Boot 3.4、Spring Framework 6、Apache Shiro 2、J2Cache
* 持久层Apache MyBatis 3.5、Hibernate Validator 8、Alibaba Druid 1.2
* 分离版Node.js、TypeScript、Vue3、Vite、Ant Design Vue、Vue Vben Admin
* 经典版Beetl 3.10HTML、jQuery 3.7、Bootstrap 3.3、AdminLTE 2.4
* 分离版:支持所有现代浏览器,如:谷歌 Chrome 86+、微软 Edge、火狐、国产浏览器 等
* 经典版:支持 IE10 和以上版本,以及其他所有现代浏览器,如:谷歌、火狐、国产浏览器 等
* 工作流引擎Flowable 7.1、符合 BPMN 规范、在线流程设计器、中国式流程、退回、撤回、自由流
* 技术选型(详细)已支持数据库:<http://jeesite.com/docs/technology/>
* JeeSite Vue 前后分离版<https://gitee.com/thinkgem/jeesite-vue>
* Spring Boot 3.x 版本:<https://gitee.com/thinkgem/jeesite5/tree/v5.springboot3/>
* Spring Boot 2.x 版本:<https://gitee.com/thinkgem/jeesite5/tree/v5.springboot2/>
* 主框架Spring Boot 2.7、Spring Framework 5.3、Apache Shiro 1.12、J2Cache
* 持久层Apache MyBatis 3.5、Hibernate Validator 6.2、Alibaba Druid 1.2
* 视图层Spring MVC 5.3、Beetl 3.10替换JSP、Bootstrap 3.3、AdminLTE 2.4
* 前端组件jQuery 3.7、jqGrid 4.7、layer 3.5、zTree 3.5、jQuery Validation
* 分离前端版Node.js、TypeScript、Vue3、Vite、Ant Design Vue、Vue Vben Admin
* 工作流引擎Flowable 6.6、符合 BPMN 规范、在线流程设计器、中国式流程、退回、撤回、自由流
* Bootstrap 版 支持 IE10 及以上版本及其他所有现代浏览器,如:谷歌、火狐、国产浏览器 等
* Vue3 版 支持现代浏览器,如:谷歌 Chrome 86+、火狐、国产浏览器 等
* 技术选型(详细)<http://jeesite.com/docs/technology/>
* JeeSite Vue 版本:<https://gitee.com/thinkgem/jeesite-vue>
* Spring Boot 3.x 版本:<https://gitee.com/thinkgem/jeesite5/tree/v5.springboot3>
## 更多介绍
@@ -119,7 +117,6 @@
## 生态系统
* AI + RAG + CMS 人工智能助手:<https://jeesite.com/docs/cms-ai>
* 分布式微服务Spring Cloud<https://gitee.com/thinkgem/jeesite-cloud>
* Flowable业务流程引擎BPM<http://jeesite.com/docs/bpm/>
* 多站点内容管理模块CMS<https://jeesite.com/docs/cms/>
@@ -136,25 +133,25 @@
### 在线演示
1. 分离版地址:<https://vue.jeesite.com>
2. 经典版地址:<https://demo.jeesite.com>
1. 全栈版地址:<http://demo.jeesite.com>
2. Vue3分离版地址:<http://vue.jeesite.com>
### 本地运行
1. 环境准备:`JDK 17+``Maven 3.8+`、使用 `MySQL 5.7 or 8.x` 数据库、[其它数据库](https://jeesite.com/docs/technology/#_8、已支持数据库)
2. 下载源码:<https://gitee.com/thinkgem/jeesite5/repository/archive/v5.springboot3.zip> 并解压
3. 打开文件:`/web/src/main/resources/config/application.yml` 配置JDBC连接(建立一个新库)
4. 执行脚本:`/web/bin/init-data.bat(sh)` 初始化数据库(自动往新库里创建表和初始数据)
5. 执行脚本:`/web/bin/run-tomcat.bat(sh)` 启动服务即可
1. 环境准备:`JDK 1.8 or 11、17``Maven 3.6+`、使用 `MySQL 5.7 or 8.0` 数据库、[其它数据库](https://jeesite.com/docs/technology/#_8、已支持数据库)
2. 下载源码:<https://gitee.com/thinkgem/jeesite5/repository/archive/v5.9.zip> 并解压
3. 打开文件:`/web/src/main/resources/config/application.yml` 配置JDBC连接
4. 执行脚本:`/web/bin/init-data.bat` 初始化数据库
5. 执行脚本:`/web/bin/run-tomcat.bat` 启动服务即可
6. 浏览器访问:<http://127.0.0.1:8980/js> 账号 system 密码 admin
7. 部署常见问题:<https://jeesite.com/docs/faq/>
8. 分离端安装:<https://jeesite.com/docs/vue-install-deploy/>
### 快速运行
1. 环境准备:`JDK 17+``Maven 3.8+`、无需准备数据库(使用内嵌 H2 DB、Vue资源包
2. 下载源码:<https://gitee.com/thinkgem/jeesite5/repository/archive/v5.springboot3.zip> 并解压
3. 执行脚本:`/web-fast/bin/run-tomcat.bat(sh)` 启动服务即可(无需手动建库,自动初始化数据库)
1. 环境准备:`JDK 1.8 or 11、17``Maven 3.6+`、无需准备数据库(使用内嵌 H2 DB、Vue资源包
2. 下载源码:<https://gitee.com/thinkgem/jeesite5/repository/archive/v5.9.zip> 并解压
3. 执行脚本:`/web-fast/bin/run-tomcat.bat` 启动服务即可(自动初始化库)
4. Vue分离版本地址<http://127.0.0.1:8980/vue/login>
5. 全栈版本地址:<http://127.0.0.1:8980/a/login>
6. 初始登录账号超级管理员system 密码admin
@@ -162,7 +159,7 @@
### 容器运行
- 拉取 Docker 镜像JeeSite版本不是最新
- 拉取 Docker 镜像(演示使用,JeeSite版本较久
```sh
docker pull thinkgem/jeesite-web
```
@@ -178,8 +175,7 @@ docker run --name jeesite-web -p 8980:8980 -d --restart unless-stopped \
1. 部署运行文档:<https://jeesite.com/docs/install-deploy/>
2. 部署常见问题:<https://jeesite.com/docs/faq/>
3. 分离端运行文档<https://jeesite.com/docs/vue-install-deploy/>
4. 分离端常见问题:<https://jeesite.com/docs/vue-jeesite-vue/>
3. 分离端安装<https://jeesite.com/docs/vue-install-deploy/>
## 技术文章
@@ -188,19 +184,9 @@ docker run --name jeesite-web -p 8980:8980 -d --restart unless-stopped \
* 表结构数据字典:<https://jeesite.com/docs/code-gen/#表结构数据字典>
* 持久层设计:<https://jeesite.com/docs/dao-mybatis/>
* 后端工具:<https://jeesite.com/docs/sys-utils/>
**分离版**
* 源码解析:<https://jeesite.com/docs/vue-crud-view/>
* 表单组件:<https://jeesite.com/docs/vue-basic-form/>
* 表格组件:<https://jeesite.com/docs/vue-basic-table/>
* 常用组件:<https://jeesite.com/docs/vue-comp/>
**经典版**
* 表单组件:<https://jeesite.com/docs/views-beetl/>
* 表格组件:<https://jeesite.com/docs/datagrid/>
* 常用工具:<https://jeesite.com/docs/jeesite-js/>
* js工具:<https://jeesite.com/docs/jeesite-js/>
## 专题文章

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.12.0.springboot3-SNAPSHOT</version>
<version>5.12.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -21,8 +21,8 @@
<!-- Servlet Api -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
@@ -45,12 +45,12 @@
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<!-- Fury serialize -->
<!-- Java serialization -->
<dependency>
<groupId>org.apache.fury</groupId>
<artifactId>fury-core</artifactId>
<version>${fury.version}</version>
<groupId>de.ruedigermoeller</groupId>
<artifactId>fst</artifactId>
<version>${fst.version}</version>
</dependency>
<!-- Jackson json -->
@@ -87,6 +87,13 @@
<version>${snakeyaml.version}</version>
</dependency>
<!-- Apache HTTP -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<!-- Email -->
<dependency>
<groupId>org.apache.commons</groupId>

View File

@@ -15,7 +15,7 @@ import org.apache.commons.text.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

View File

@@ -18,8 +18,8 @@ import java.util.UUID;
*/
public class IdGen {
private static final SecureRandom random = new SecureRandom();
private static final IdWorker idWorker = new IdWorker(-1, -1);
private static SecureRandom random = new SecureRandom();
private static IdWorker idWorker = new IdWorker(-1, -1);
/**
* 生成UUID, 中间无-分割.

View File

@@ -7,9 +7,6 @@ package com.jeesite.common.io;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.lang.StringUtils;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import net.sf.jmimemagic.Magic;
import net.sf.jmimemagic.MagicMatch;
import org.apache.commons.io.IOUtils;
@@ -18,6 +15,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import javax.activation.MimetypesFileTypeMap;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.Enumeration;
import java.util.List;

View File

@@ -37,7 +37,9 @@ public class PropertiesUtils {
// 默认加载的文件可通过继承覆盖若有相同Key优先加载后面的
public static final String[] DEFAULT_CONFIG_FILE = new String[]{
"classpath:config/application.yml", "classpath:application.yml",
"classpath:config/bootstrap.yml", "classpath:bootstrap.yml",
"file:config/application.yml", "file:application.yml",
"file:config/bootstrap.yml", "file:bootstrap.yml",
};
private static final Logger logger = PropertiesUtils.initLogger();

View File

@@ -4,6 +4,7 @@
*/
package com.jeesite.common.io;
import com.alibaba.fastjson.parser.ParserConfig;
import com.jeesite.common.lang.StringUtils;
import org.springframework.boot.env.OriginTrackedMapPropertySource;
import org.springframework.boot.env.PropertiesPropertySourceLoader;
@@ -38,12 +39,12 @@ public class PropertyLoader implements org.springframework.boot.env.PropertySour
List<PropertySource<?>> propertySources = new ArrayList<>();
if (!isLoadJeeSitePropertySource) {
isLoadJeeSitePropertySource = true;
// try {
// // 默认开启 FastJSON 1.x 的,安全模式
// ParserConfig.getGlobalInstance().setSafeMode(true);
// } catch (Throwable ignored) {
// // 兼容 FastJSON 2.x 的调用,忽略异常
// }
try {
// 默认开启 FastJSON 1.x 的,安全模式
ParserConfig.getGlobalInstance().setSafeMode(true);
} catch (Throwable ignored) {
// 兼容 FastJSON 2.x 的调用,忽略异常
}
Properties properties = PropertiesUtils.getInstance().getProperties();
propertySources.add(new OriginTrackedMapPropertySource("jeesite", properties));
} else {

View File

@@ -4,8 +4,8 @@
*/
package com.jeesite.common.lang;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import java.io.PrintWriter;
import java.io.StringWriter;

View File

@@ -4,14 +4,12 @@
*/
package com.jeesite.common.lang;
import com.jeesite.common.io.PropertiesUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.fury.Fury;
import org.apache.fury.ThreadSafeFury;
import org.apache.fury.config.Language;
import org.nustaq.serialization.FSTConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.core.NamedThreadLocal;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -27,24 +25,13 @@ import java.lang.reflect.InvocationTargetException;
public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
private static final Logger logger = LoggerFactory.getLogger(ObjectUtils.class);
/**
* 当前类的实例持有者(静态内部类,延迟加载,懒汉式,线程安全的单例模式)
*/
private static final class Static {
private static final Boolean isJavaSerialize;
private static final ThreadSafeFury fury;
static {
isJavaSerialize = PropertiesUtils.getInstance()
.getPropertyToBoolean("isJavaSerialize", "false");
org.apache.fury.logging.LoggerFactory.useSlf4jLogging(true);
fury = Fury.builder().withLanguage(Language.JAVA)
.withRefTracking(true)
.requireClassRegistration(false)
.buildThreadSafeFury();
}
private static final boolean isJavaSerialize;
static {
String[] ver = StringUtils.split(System.getProperty("java.version"), StringUtils.DOT);
isJavaSerialize = ver.length > 0 && Integer.parseInt(ver[0]) > 1;
}
/**
* 转换为 Double 类型
*/
@@ -199,10 +186,10 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
*/
public static byte[] serialize(Object object) {
try {
if (Static.isJavaSerialize) {
if (isJavaSerialize) {
return ObjectUtils.serializeJava(object);
} else {
return ObjectUtils.serializeFury(object);
}else {
return ObjectUtils.serializeFst(object);
}
} catch (Exception e) {
logger.error("serialize: {}", e.getMessage());
@@ -217,10 +204,10 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
*/
public static Object unserialize(byte[] bytes) {
try {
if (Static.isJavaSerialize) {
if (isJavaSerialize) {
return ObjectUtils.unserializeJava(bytes);
} else {
return ObjectUtils.unserializeFury(bytes);
}else {
return ObjectUtils.unserializeFst(bytes);
}
} catch (Exception e) {
logger.error("unserialize: {}", e.getMessage());
@@ -278,88 +265,51 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
}
return object;
}
private static ThreadLocal<FSTConfiguration> fstConfiguration =
new NamedThreadLocal<FSTConfiguration>("FSTConfiguration") {
@Override
public FSTConfiguration initialValue() {
return FSTConfiguration.createDefaultConfiguration();
}
};
/**
* 序列化对象
* FST 序列化对象
* @param object
* @return
*/
public static byte[] serializeFury(Object object) {
public static byte[] serializeFst(Object object) {
if (object == null){
return null;
}
long beginTime = System.currentTimeMillis();
byte[] bytes = Static.fury.serialize(object);
byte[] bytes = fstConfiguration.get().asByteArray(object);
long totalTime = System.currentTimeMillis() - beginTime;
if (totalTime > 30000){
logger.warn(object.getClass() + " serialize time: " + TimeUtils.formatTime(totalTime));
logger.warn(object.getClass() + " fst serialize time: " + TimeUtils.formatTime(totalTime));
}
return bytes;
}
/**
* 反序列化对象
* FST 反序列化对象
* @param bytes
* @return
*/
public static Object unserializeFury(byte[] bytes) {
public static Object unserializeFst(byte[] bytes) {
if (bytes == null){
return null;
}
long beginTime = System.currentTimeMillis();
Object object = Static.fury.deserialize(bytes);
Object object = fstConfiguration.get().asObject(bytes);
long totalTime = System.currentTimeMillis() - beginTime;
if (totalTime > 30000 && object != null){
logger.warn(object.getClass() + " unserialize time: " + TimeUtils.formatTime(totalTime));
logger.warn(object.getClass() + " fst unserialize time: " + TimeUtils.formatTime(totalTime));
}
return object;
}
// private static ThreadLocal<FSTConfiguration> fstConfiguration =
// new NamedThreadLocal<FSTConfiguration>("FSTConfiguration") {
// @Override
// public FSTConfiguration initialValue() {
// return FSTConfiguration.createDefaultConfiguration();
// }
// };
//
// /**
// * FST 序列化对象
// * @param object
// * @return
// */
// public static byte[] serializeFst(Object object) {
// if (object == null){
// return null;
// }
// long beginTime = System.currentTimeMillis();
// byte[] bytes = fstConfiguration.get().asByteArray(object);
// long totalTime = System.currentTimeMillis() - beginTime;
// if (totalTime > 30000){
// logger.warn(object.getClass() + " fst serialize time: " + TimeUtils.formatTime(totalTime));
// }
// return bytes;
// }
//
// /**
// * FST 反序列化对象
// * @param bytes
// * @return
// */
// public static Object unserializeFst(byte[] bytes) {
// if (bytes == null){
// return null;
// }
// long beginTime = System.currentTimeMillis();
// Object object = fstConfiguration.get().asObject(bytes);
// long totalTime = System.currentTimeMillis() - beginTime;
// if (totalTime > 30000 && object != null){
// logger.warn(object.getClass() + " fst unserialize time: " + TimeUtils.formatTime(totalTime));
// }
// return object;
// }
// private static Pool<Kryo> kryoPool = new Pool<Kryo>(true, false, 8) {
// protected Kryo create() {
// Kryo kryo = new Kryo();

View File

@@ -27,7 +27,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import java.io.IOException;
import java.io.Serial;
import java.lang.reflect.AnnotatedElement;
import java.util.Date;
import java.util.List;
@@ -41,7 +40,6 @@ import java.util.TimeZone;
*/
public class JsonMapper extends ObjectMapper {
@Serial
private static final long serialVersionUID = 1L;
private static final Logger logger = LoggerFactory.getLogger(JsonMapper.class);
@@ -80,10 +78,9 @@ public class JsonMapper extends ObjectMapper {
this.setTimeZone(TimeZone.getTimeZone(PropertiesUtils.getInstance()
.getProperty("lang.defaultTimeZone", "GMT+08:00")));
this.setAnnotationIntrospector(new JacksonAnnotationIntrospector() {
@Serial
private static final long serialVersionUID = 1L;
private static final String[] pattern = new String[] {"yyyy", "MM", "dd", "HH", "mm", "ss", "SSS"};
private static class JeeSiteJsonSerializer extends JsonSerializer<Date> {
private final String[] pattern = new String[] {"yyyy", "MM", "dd", "HH", "mm", "ss", "SSS"};
class JeeSiteJsonSerializer extends JsonSerializer<Date> {
private final String pattern;
private JeeSiteJsonSerializer(String pattern) {
this.pattern = pattern;
@@ -99,7 +96,7 @@ public class JsonMapper extends ObjectMapper {
}
}
}
private static class JeeSiteJsonDeserializer extends JsonDeserializer<Date> {
class JeeSiteJsonDeserializer extends JsonDeserializer<Date> {
private final String pattern;
private JeeSiteJsonDeserializer(String pattern) {
this.pattern = pattern;

View File

@@ -12,7 +12,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import java.io.IOException;
import java.io.Serial;
import java.util.TimeZone;
/**
@@ -22,7 +21,6 @@ import java.util.TimeZone;
*/
public class XmlMapper extends com.fasterxml.jackson.dataformat.xml.XmlMapper{
@Serial
private static final long serialVersionUID = 1L;
private static final Logger logger = LoggerFactory.getLogger(XmlMapper.class);

View File

@@ -4,7 +4,7 @@ import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.io.PropertiesUtils;
import com.jeesite.common.lang.StringUtils;
import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
public class IpUtils {

View File

@@ -6,11 +6,11 @@ package com.jeesite.common.utils;
import com.jeesite.common.io.PropertiesUtils;
import com.jeesite.common.web.http.ServletUtils;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.context.i18n.TimeZoneAwareLocaleContext;
import org.springframework.core.NamedThreadLocal;
import org.springframework.web.servlet.LocaleContextResolver;
import javax.servlet.http.HttpServletRequest;
import java.util.Locale;
import java.util.TimeZone;

View File

@@ -4,15 +4,12 @@
*/
package com.jeesite.common.utils.excel;
import java.io.Serial;
/**
* Excel Exception
* @author ThinkGem
*/
public class ExcelException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
public ExcelException() {

View File

@@ -23,7 +23,7 @@ import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;

View File

@@ -7,9 +7,9 @@ package com.jeesite.common.web;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.io.PropertiesUtils;
import com.jeesite.common.lang.StringUtils;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Cookie工具类

View File

@@ -4,262 +4,218 @@
*/
package com.jeesite.common.web.http;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509ExtendedTrustManager;
import java.io.InputStream;
import java.net.Socket;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.security.SecureRandom;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.ssl.SSLContextBuilder;
import org.apache.http.util.EntityUtils;
import com.jeesite.common.codec.EncodeUtils;
/**
* HTTP 客户端工具类支持HTTPS
* HTTP客户端工具类支持HTTPS
* @author ThinkGem
* @version 2025-03-26
* @version 2017-3-27
*/
public class HttpClientUtils {
private final static Logger logger = LoggerFactory.getLogger(HttpClientUtils.class);
private static final HttpClient client = createHttpClient(60);
/**
* HTTP 的 GET 请求
* http的get请求
* @param url
*/
public static String get(String url) {
return get(url, null, null);
}
/**
* HTTP 的 GET 请求,传递 Map 格式参数
*/
public static String get(String url, Map<String, String> dataMap) {
return get(url, dataMap, EncodeUtils.UTF_8);
return get(url, EncodeUtils.UTF_8);
}
/**
* HTTP 的 GET 请求,传递 Map 格式参数,支持指定编码
* http的get请求
* @param url
*/
public static String get(String url, Map<String, String> dataMap, String charset) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(buildUrl(url, dataMap, charset)))
.GET()
.build();
return executeRequest(request);
public static String get(String url, String charset) {
HttpGet httpGet = new HttpGet(url);
return executeRequest(httpGet, charset);
}
/**
* HTTP 的 GET 请求,增加 ajax 请求头
* http的get请求增加异步请求头参数
* @param url
*/
public static String ajaxGet(String url) {
return ajaxGet(url, null, null);
return ajaxGet(url, EncodeUtils.UTF_8);
}
/**
* HTTP 的 GET 请求,增加 ajax 请求头,传递 Map 格式参数
* http的get请求增加异步请求头参数
* @param url
*/
public static String ajaxGet(String url, Map<String, String> dataMap) {
return ajaxGet(url, dataMap, EncodeUtils.UTF_8);
public static String ajaxGet(String url, String charset) {
HttpGet httpGet = new HttpGet(url);
httpGet.setHeader("X-Requested-With", "XMLHttpRequest");
return executeRequest(httpGet, charset);
}
/**
* HTTP 的 GET 请求,增加 ajax 请求头,传递 Map 格式参数,支持指定编码
*/
public static String ajaxGet(String url, Map<String, String> dataMap, String charset) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(buildUrl(url, dataMap, charset)))
.header("X-Requested-With", "XMLHttpRequest")
.GET()
.build();
return executeRequest(request);
}
/**
* 构建表单数据Map 转换 params支持指定编码
*/
private static String buildUrl(String url, Map<String, String> dataMap, String charset) {
url = StringUtils.substringBefore(url, "#");
if (dataMap == null) {
return url;
}
StringBuilder sb = new StringBuilder(url);
if (!url.contains("?")) {
sb.append("?");
} else if (!url.endsWith("&")) {
sb.append("&");
}
return sb + buildFormData(dataMap, charset);
}
/**
* HTTP 的 POST 请求,传递 Map 格式参数
* http的post请求传递map格式参数
*/
public static String post(String url, Map<String, String> dataMap) {
return post(url, dataMap, EncodeUtils.UTF_8);
}
/**
* HTTP 的 POST 请求,传递 Map 格式参数,支持指定编码
* http的post请求,传递map格式参数
*/
public static String post(String url, Map<String, String> dataMap, String charset) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/x-www-form-urlencoded")
.POST(HttpRequest.BodyPublishers.ofString(buildFormData(dataMap, charset)))
.build();
return executeRequest(request);
HttpPost httpPost = new HttpPost(url);
try {
if (dataMap != null){
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
for (Map.Entry<String, String> entry : dataMap.entrySet()) {
nvps.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
}
UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nvps, charset);
formEntity.setContentEncoding(charset);
httpPost.setEntity(formEntity);
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return executeRequest(httpPost, charset);
}
/**
* HTTP 的 POST 请求,增加 ajax 请求头,传递 Map 格式参数
* http的post请求增加异步请求头参数,传递map格式参数
*/
public static String ajaxPost(String url, Map<String, String> dataMap) {
return ajaxPost(url, dataMap, EncodeUtils.UTF_8);
}
/**
* HTTP 的 POST 请求,增加 ajax 请求头,传递 Map 格式参数,支持指定编码
* http的post请求增加异步请求头参数,传递map格式参数
*/
public static String ajaxPost(String url, Map<String, String> dataMap, String charset) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("X-Requested-With", "XMLHttpRequest")
.header("Content-Type", "application/x-www-form-urlencoded")
.POST(HttpRequest.BodyPublishers.ofString(buildFormData(dataMap, charset)))
.build();
return executeRequest(request);
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("X-Requested-With", "XMLHttpRequest");
try {
if (dataMap != null){
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
for (Map.Entry<String, String> entry : dataMap.entrySet()) {
nvps.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
}
UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nvps, charset);
formEntity.setContentEncoding(charset);
httpPost.setEntity(formEntity);
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return executeRequest(httpPost, charset);
}
/**
* 构建表单数据Map 转换 params支持指定编码
*/
private static String buildFormData(Map<String, String> dataMap, String charset) {
return dataMap.entrySet().stream()
.map(entry -> entry.getKey() + "="
+ EncodeUtils.encodeUrl(entry.getValue(), charset))
.reduce((a, b) -> a + "&" + b)
.orElse(StringUtils.EMPTY);
}
/**
* HTTP 的 POST 请求,使用 json 请求头,传递 json 格式参数
* http的post请求增加异步请求头参数传递json格式参数
*/
public static String ajaxPostJson(String url, String jsonString) {
return ajaxPostJson(url, jsonString, EncodeUtils.UTF_8);
}
/**
* HTTP 的 POST 请求,使用 json 请求头,传递 json 格式参数,支持指定编码
* http的post请求增加异步请求头参数传递json格式参数
*/
public static String ajaxPostJson(String url, String jsonString, String charset) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("X-Requested-With", "XMLHttpRequest")
.header("Content-Type", "application/json; charset="
+ (StringUtils.isNotBlank(charset) ? charset : EncodeUtils.UTF_8))
.POST(HttpRequest.BodyPublishers.ofString(jsonString))
.build();
return executeRequest(request);
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("X-Requested-With", "XMLHttpRequest");
// try {
StringEntity stringEntity = new StringEntity(jsonString, charset);// 解决中文乱码问题
stringEntity.setContentEncoding(charset);
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// }
return executeRequest(httpPost, charset);
}
/**
* 执行一个 http 请求,传递 HttpRequest 参数
* 执行一个http请求传递HttpGet或HttpPost参数
*/
public static String executeRequest(HttpRequest request) {
public static String executeRequest(HttpUriRequest httpRequest) {
return executeRequest(httpRequest, EncodeUtils.UTF_8);
}
/**
* 执行一个http请求传递HttpGet或HttpPost参数
*/
public static String executeRequest(HttpUriRequest httpRequest, String charset) {
CloseableHttpClient httpclient;
if ("https".equals(httpRequest.getURI().getScheme())){
httpclient = createSSLInsecureClient();
}else{
httpclient = HttpClients.createDefault();
}
String result = "";
try {
return client.send(request, HttpResponse.BodyHandlers.ofString()).body();
} catch (Exception e) {
throw new RuntimeException(e);
}
try {
CloseableHttpResponse response = httpclient.execute(httpRequest);
HttpEntity entity = null;
try {
entity = response.getEntity();
result = EntityUtils.toString(entity, charset);
} finally {
EntityUtils.consume(entity);
response.close();
}
} finally {
httpclient.close();
}
}catch(IOException ex){
ex.printStackTrace();
}
return result;
}
/**
* HTTP 的 GET 请求,返回文件流
* 创建 SSL连接
*/
public static InputStream getInputStream(String url) {
return getInputStream(url, null);
}
/**
* HTTP 的 GET 请求,传递 Map 格式参数,返回文件流
*/
public static InputStream getInputStream(String url, Map<String, String> dataMap) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(buildUrl(url, dataMap, EncodeUtils.UTF_8)))
.GET()
.build();
return executeRequestInputStream(request);
}
/**
* 执行一个 http 请求,传递 HttpRequest 参数,返回文件流
*/
public static InputStream executeRequestInputStream(HttpRequest request) {
public static CloseableHttpClient createSSLInsecureClient() {
try {
HttpResponse<InputStream> response = client.send(request, HttpResponse.BodyHandlers.ofInputStream());
if (response.statusCode() == 200) {
return response.body();
} else {
logger.info("URL: {} statusCode: {}", request.uri().toString(), response.statusCode());
return null;
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static HttpClient createHttpClient(long seconds) {
HttpClient client;
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, new TrustManager[]{new UnsafeX509ExtendedTrustManager()}, new SecureRandom());
client = HttpClient.newBuilder()
.sslContext(sslContext)
.connectTimeout(Duration.ofSeconds(seconds))
.build();
} catch (Exception e) {
logger.info(e.getMessage(), e);
client = HttpClient.newHttpClient();
}
return client;
}
private static final class UnsafeX509ExtendedTrustManager extends X509ExtendedTrustManager {
private static final X509Certificate[] EMPTY_CERTIFICATES = new X509Certificate[0];
@Override
public void checkClientTrusted(X509Certificate[] certificates, String authType) {
}
@Override
public void checkClientTrusted(X509Certificate[] certificates, String authType, Socket socket) {
}
@Override
public void checkClientTrusted(X509Certificate[] certificates, String authType, SSLEngine sslEngine) {
}
@Override
public void checkServerTrusted(X509Certificate[] certificates, String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] certificates, String authType, Socket socket) {
}
@Override
public void checkServerTrusted(X509Certificate[] certificates, String authType, SSLEngine sslEngine) {
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return EMPTY_CERTIFICATES;
SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(new TrustStrategy() {
@Override
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
return true;
}
}).build();
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
});
return HttpClients.custom().setSSLSocketFactory(sslsf).build();
} catch (GeneralSecurityException ex) {
throw new RuntimeException(ex);
}
}

View File

@@ -5,8 +5,8 @@
package com.jeesite.common.web.http;
import com.jeesite.common.io.PropertiesUtils;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 统一包装结果输出类:{ code: 200, msg: "", data: {} | [] }

View File

@@ -12,15 +12,15 @@ import com.jeesite.common.lang.ExceptionUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.mapper.JsonMapper;
import com.jeesite.common.mapper.XmlMapper;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.Validate;
import org.springframework.http.MediaType;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.Map.Entry;

View File

@@ -4,7 +4,7 @@
*/
package com.jeesite.common.web.http;
import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import eu.bitwalker.useragentutils.Browser;
import eu.bitwalker.useragentutils.DeviceType;

View File

@@ -1,32 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.test.web.http;
import com.jeesite.common.mapper.JsonMapper;
import com.jeesite.common.web.http.HttpClientUtils;
import java.util.HashMap;
import java.util.Map;
/**
* HTTP客户端测试工具类支持HTTPS
* @author ThinkGem
* @version 2017-3-27
*/
public class HttpClientUtilsTest {
public static void main(String[] args) {
String url = "https://vue.jeesite.com/js/a/sys/corpAdmin/treeData";
Map<String, String> dataMap = new HashMap<>();
dataMap.put("isShowCode", "true");
dataMap.put("param1", "你好");
System.out.println(HttpClientUtils.get(url, dataMap));
System.out.println(HttpClientUtils.ajaxGet(url, dataMap));
System.out.println(HttpClientUtils.post(url, dataMap));
System.out.println(HttpClientUtils.ajaxPost(url, dataMap));
System.out.println(HttpClientUtils.ajaxPostJson(url, JsonMapper.toJson(dataMap)));
}
}

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.12.0.springboot3-SNAPSHOT</version>
<version>5.12.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

View File

@@ -9,10 +9,9 @@ import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serial;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;
/**
@@ -37,7 +36,6 @@ import java.util.Date;
)
public class AppComment extends DataEntity<AppComment> {
@Serial
private static final long serialVersionUID = 1L;
private String category; // 问题分类
private String content; // 问题和意见

View File

@@ -4,10 +4,9 @@
*/
package com.jeesite.modules.app.entity;
import java.io.Serial;
import java.util.Date;
import jakarta.validation.constraints.Size;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.DataEntity;
@@ -35,7 +34,6 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
)
public class AppUpgrade extends DataEntity<AppUpgrade> {
@Serial
private static final long serialVersionUID = 1L;
private String appCode; // 应用编号
private String upTitle; // 升级标题

View File

@@ -9,8 +9,6 @@ import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.app.entity.AppComment;
import com.jeesite.modules.app.service.AppCommentService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@@ -22,6 +20,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
/**

View File

@@ -4,8 +4,8 @@
*/
package com.jeesite.modules.app.web;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -160,7 +160,7 @@
</div>
<% } %>
<script>
$('#inputForm').validate({
$("#inputForm").validate({
submitHandler: function(form){
js.ajaxSubmitForm($(form), function(data){
js.showMessage(data.message);

View File

@@ -132,7 +132,7 @@
</div>
<% } %>
<script>
$('#inputForm').validate({
$("#inputForm").validate({
submitHandler: function(form){
js.ajaxSubmitForm($(form), function(data){
js.showMessage(data.message);

View File

@@ -1,173 +0,0 @@
## 模块简介
本模块基于 Spring AI 和 JeeSite 内容管理系统CMS并结合了检索增强生成Retrieval-Augmented Generation, RAG技术
和先进的人工智能算法AI打造了一个强大的企业级知识管理和智能对话平台。该模块专为企业设计旨在通过高效的知识获取和精准的对话能力
提升企业的信息管理效率和员工的工作效能。
检索增强生成 RAG 技术使系统能够自动从海量的企业文档中检索最相关的信息,并将其融入到生成的回答中,确保每一次查询都
能获得最新且准确的结果。这种检索与生成相结合的方式,不仅提高了信息检索的准确性,还增强了回答的上下文关联性,
特别适合处理复杂的企业知识库。
此外该模块支持在线大模型和本地部署的大模型Ollama、DeepSeek、通义千问理论上支持所有 OpenAPI 标准接口的 AI 提供商。
并能无缝集成多种嵌入式 AI 模型的向量数据库,如 Chroma、PGVector、Elasticsearch、Milvus 等,实现高效的数据存储、检索及分析。
无论是大规模数据集还是高度专业化的领域知识JeeSite CMS + RAG + AI 都能提供定制化解决方案,满足企业多样化的业务需求和技术要求。
企业可以轻松管理和访问复杂的信息资源,促进内部知识共享和创新,从而在竞争激烈的市场环境中保持领先地位。
优势:本模块结构清晰,代码简洁易懂,不管是正式项目、或是学习 AI 技术、都能轻松应对读懂源代码。
## 在线演示
* 地址:<https://vue.jeesite.com/cms/chat/index>
## 源码下载
* 后端:<https://gitee.com/thinkgem/jeesite5/tree/v5.springboot3/modules/cms-ai>
* 前端:<https://gitee.com/thinkgem/jeesite-vue/tree/main/packages/cms>
## AI 模型配置
支持的 AI 模型列表:<https://docs.spring.io/spring-ai/reference/1.0/api/index.html>
* 线上模型:理论上支持所有 [OpenAPI](https://help.aliyun.com/zh/model-studio/developer-reference/use-qwen-by-calling-api) 标准接口的 AI 提供商。
* 本地模型:使用 [Ollama](https://ollama.com) 安装方法,本文不多赘述,网上有很多安装资料。
* 模型类型包括:聊天对话模型和嵌入式向量库模型,需注意 dimensions 维度参数,要和模型要求的匹配。
具体配置项详见 [jeesite-cms-ai.yml](https://gitee.com/thinkgem/jeesite5/blob/v5.springboot3/modules/cms-ai/src/main/resources/config/jeesite-cms-ai.yml) 文件,有注释。
## 向量数据库配置
支持的向量库列表:<https://docs.spring.io/spring-ai/reference/1.0/api/vectordbs.html>
* Chroma
* PGVector
* Elasticsearch
* Milvus
* ...
具体配置项详见 [jeesite-cms-ai.yml](https://gitee.com/thinkgem/jeesite5/blob/v5.springboot3/modules/cms-ai/src/main/resources/config/jeesite-cms-ai.yml) 文件,有注释。
### 安装 Chroma
```sh
docker run -it --rm --name chroma -p 8000:8000 ghcr.io/chroma-core/chroma:1.0.0
```
### 安装 PGVector
```sh
docker run -d --name pgvector -p 5433:5432 -e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres pgvector/pgvector:pg17
```
* 进入容器
```sql
docker exec -it pgvector psql -U postgres
```
* 建库语句
```sql
CREATE DATABASE "jeesite-ai";
-- 激活数据库
\connect "jeesite-ai";
-- 建立数据表和索引
CREATE EXTENSION IF NOT EXISTS vector;
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- 使用 all-minilm 模型时创建
DROP TABLE IF EXISTS vector_store_384;
CREATE TABLE IF NOT EXISTS vector_store_384 (
id varchar(64) DEFAULT uuid_generate_v4() PRIMARY KEY,
content text,
metadata json,
embedding vector(384)
);
CREATE INDEX ON vector_store_384 USING HNSW (embedding vector_cosine_ops);
-- 使用 nomic-embed-text 模型时创建
DROP TABLE IF EXISTS vector_store_786;
CREATE TABLE IF NOT EXISTS vector_store_786 (
id varchar(64) DEFAULT uuid_generate_v4() PRIMARY KEY,
content text,
metadata json,
embedding vector(768)
);
CREATE INDEX ON vector_store_786 USING HNSW (embedding vector_cosine_ops);
-- 使用 bge-m3 模型时创建
DROP TABLE IF EXISTS vector_store_1024;
CREATE TABLE IF NOT EXISTS vector_store_1024 (
id varchar(64) DEFAULT uuid_generate_v4() PRIMARY KEY,
content text,
metadata json,
embedding vector(1024)
);
CREATE INDEX ON vector_store_1024 USING HNSW (embedding vector_cosine_ops);
```
## 创建 AI 菜单
系统管理 -> 系统设置 -> 菜单管理 -> 新增
* 菜单名称AI 助手
* 菜单地址:/cms/chat/index
## 支持工具调用 Tool Calling
工具调用 Tool Calling也称 Function Calling是人工智能应用程序中的常见模式允许模型与一组 API 或工具交互,从而增强其功能。
实例代码,详见 [CmsAiTools.java](https://gitee.com/thinkgem/jeesite5/blob/v5.springboot3/modules/cms-ai/src/main/java/com/jeesite/modules/cms/ai/tools/CmsAiTools.java) 让 AI 调用你的 java 实现你的业务联动。
## 支持结构化输出
对于依赖可靠解析输出值的下游应用程序来说LLM 产生结构化输出的能力很重要。开发人员希望将 AI 模型的结果快速转换为数据类型,如 JSON、XML 或 Java 类,这些类可以传递给其他应用程序函数和方法。
pom.xml 中注释掉 `<artifactId>spring-ai-starter-model-openai</artifactId>`
打开注释 `<artifactId>spring-ai-starter-model-ollama</artifactId>`
启用 `Ollama` 本地模型进行测试,地址如下:
* 文本格式输出
- 源码位置CmsAiChatService.chatText(message)
- 访问地址:<http://127.0.0.1:8980/js/a/cms/chat/text?message=你好>
- 输出结果:`你好!有什么问题或需要帮助的吗?`
* JSON 类型输出
- 源码位置CmsAiChatService.chatJson(message)
- 访问地址:<http://127.0.0.1:8980/js/a/cms/chat/json?message=张三>
- 输出结果:`{"sex":"男","name":"张三","age":"17"}`
* 结合 Tool Calling 结构化输出
- 开启参数:`spring.ai.tool-calls: true`
- 源码位置CmsAiChatService.chatJson(message)
- 访问地址:<http://127.0.0.1:8980/js/a/cms/chat/json?message=打开客厅的灯>
- 输出结果:`{"message":"客厅房间里的灯被打开","roomName":"客厅","on":true}`
* Java 对象类型输出:
- 源码位置CmsAiChatService.chatArea(message)
- 访问地址:<http://127.0.0.1:8980/js/a/cms/chat/entity?message=北京>
- 输出结果:`[{"id":"110000","pageNo":1,"pageSize":10,"orderBy":"","isNewRecord":false,"dataMap":{},"status":"0","createBy":"system","createDate":"2025-01-01 19:25","updateBy":"system","updateDate":"2025-01-01 19:25","remarks":"","lastUpdateDateTime":1677843300000,"parentCodes":"0,","treeSort":110000,"treeSorts":"0000110000,","treeLeaf":"0","treeLevel":0,"treeNames":"北京市","childList":[{"id":"110100","pageNo":1,"pageSize":10,"orderBy":"","isNewRecord":false,"dataMap":{},"status":"0","createBy":"system","createDate":"2025-01-01 19:25","updateBy":"system","updateDate":"2025-01-01 19:25","remarks":"","lastUpdateDateTime":1677843300000,"parentCodes":"0,110000,","treeSort":110100,"treeSorts":"0000110000,0000110100,","treeLeaf":"0","treeLevel":1,"treeNames":"北京城区","childList":[{"id":"110101","isNewRecord":false,"areaCode":"110101","areaName":"东城区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110102","isNewRecord":false,"areaCode":"110102","areaName":"西城区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110105","isNewRecord":false,"areaCode":"110105","areaName":"朝阳区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110106","isNewRecord":false,"areaCode":"110106","areaName":"丰台区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110107","isNewRecord":false,"areaCode":"110107","areaName":"石景山区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110108","isNewRecord":false,"areaCode":"110108","areaName":"海淀区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110109","isNewRecord":false,"areaCode":"110109","areaName":"门头沟区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110111","isNewRecord":false,"areaCode":"110111","areaName":"房山区","areaType":"3","isRoot":true,"isTreeLeaf":false}],"isQueryChildren":true,"areaCode":"110100","areaName":"北京城区","areaType":"2","isRoot":false,"parentCode":"110000","isTreeLeaf":false,"parentName":"北京市"}],"isQueryChildren":true,"areaCode":"110000","areaName":"北京市","areaType":"1","isRoot":true,"isTreeLeaf":false}]`
## 授权协议声明
1. 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款。
2. 不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
3. 在使用本软件时,由于它集成了众多第三方开源软件,请共同遵守这些开源软件的使用许可条款规定。
4. 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议、版权声明和其他原作者
规定需要包含的说明(请尊重原作者的著作权,不要删除或修改文件中的`Copyright``@author`信息)
更不要,全局替换源代码中的 jeesite 或 ThinkGem 等字样,否则你将违反本协议条款承担责任。
5. 您若套用本软件的一些代码或功能参考,请保留源文件中的版权和作者,需要在您的软件介绍明显位置
说明出处,举例:本软件基于 JeeSite 快速开发平台并附带链接http://jeesite.com
6. 任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
7. 如果你对本软件有改进,希望可以贡献给我们,共同进步。
8. 本项目已申请软件著作权,请尊重开源,感谢阅读。
9. 无用户数限制,无在线人数限制,放心使用。
## 技术支持与服务
* 本软件免费,我们也提供了相应的收费服务,因为:
* 没有资金的支撑就很难得到发展,特别是一个好的产品,如果 JeeSite 帮助了您,请为我们点赞。支持我们,您可以获得更多回馈,我们会把公益事业做的更好,开放更多资源,回报社区和社会。请给我们一些动力吧,在此非常感谢已支持我们的朋友!
* **联系我们**:请访问技术支持与服务页面:<http://s.jeesite.com>

View File

@@ -1,22 +0,0 @@
@echo off
rem /**
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
rem * No deletion without permission, or be held responsible to law.
rem *
rem * Author: ThinkGem@163.com
rem */
echo.
echo [<5B><>Ϣ] <20><><EFBFBD>𹤳̵<F0B9A4B3>Maven<65><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
echo.
%~d0
cd %~dp0
call mvn -v
echo.
cd ..
call mvn clean deploy -Dmaven.test.skip=true -Pdeploy
cd bin
pause

View File

@@ -1,18 +0,0 @@
#!/bin/sh
# /**
# * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
# * No deletion without permission, or be held responsible to law.
# *
# * Author: ThinkGem@163.com
# */
echo ""
echo "[信息] 部署工程到Maven服务器。"
echo ""
mvn -v
echo ""
cd ..
mvn clean deploy -Dmaven.test.skip=true -Pdeploy
cd bin

View File

@@ -1,22 +0,0 @@
@echo off
rem /**
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
rem * No deletion without permission, or be held responsible to law.
rem *
rem * Author: ThinkGem@163.com
rem */
echo.
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD>jar<61><72><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
echo.
%~d0
cd %~dp0
call mvn -v
echo.
cd ..
call mvn clean install -Dmaven.test.skip=true -Ppackage
cd bin
pause

View File

@@ -1,18 +0,0 @@
#!/bin/sh
# /**
# * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
# * No deletion without permission, or be held responsible to law.
# *
# * Author: ThinkGem@163.com
# */
echo ""
echo "[信息] 打包安装工程生成jar包文件。"
echo ""
mvn -v
echo ""
cd ..
mvn clean install -Dmaven.test.skip=true -Ppackage
cd bin

File diff suppressed because it is too large Load Diff

View File

@@ -1,150 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.12.0.springboot3-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<artifactId>jeesite-module-cms-ai</artifactId>
<packaging>jar</packaging>
<name>JeeSite Module CMS+RAG+AI</name>
<url>http://jeesite.com</url>
<inceptionYear>2013-Now</inceptionYear>
<properties>
<spring-ai.version>1.0.0-RC1</spring-ai.version>
</properties>
<dependencies>
<dependency>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-module-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-module-cms</artifactId>
<version>${project.parent.version}</version>
</dependency>
<!-- 在线大模型 -->
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-model-openai</artifactId>
</dependency>
<!-- 本地大模型
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-model-ollama</artifactId>
</dependency> -->
<!-- 向量数据库 -->
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-advisors-vector-store</artifactId>
</dependency>
<!-- Chroma 向量数据库 -->
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-vector-store-chroma</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
</dependency>
<!-- PG 向量数据库
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-vector-store-pgvector</artifactId>
</dependency> -->
<!-- ES 向量数据库
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-vector-store-elasticsearch</artifactId>
</dependency> -->
<!-- Milvus 向量数据库
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-vector-store-milvus</artifactId>
<exclusions>
<exclusion>
<artifactId>slf4j-reload4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<classifier>osx-aarch_64</classifier>
</dependency> -->
<!-- HTML 转 Markdown -->
<dependency>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-html2md-converter</artifactId>
<version>0.64.8</version>
</dependency>
<!-- Office、zip 等文件内容解析 -->
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers-standard-package</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.27.1</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-bom</artifactId>
<version>${spring-ai.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<developers>
<developer>
<id>thinkgem</id>
<name>WangZhen</name>
<email>thinkgem at 163.com</email>
<roles><role>Project lead</role></roles>
<timezone>+8</timezone>
</developer>
</developers>
<organization>
<name>JeeSite</name>
<url>http://jeesite.com</url>
</organization>
</project>

View File

@@ -1,74 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.cms.ai.config;
import com.jeesite.common.datasource.DataSourceHolder;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.modules.cms.ai.properties.CmsAiProperties;
import com.jeesite.modules.cms.ai.service.CacheChatMemoryRepository;
import com.jeesite.modules.cms.ai.tools.CmsAiTools;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.ai.chat.memory.MessageWindowChatMemory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.core.JdbcTemplate;
/**
* AI 聊天配置类
* @author ThinkGem
*/
@Configuration
@EnableConfigurationProperties(CmsAiProperties.class)
public class CmsAiChatConfig {
/**
* 聊天对话客户端
* @author ThinkGem
*/
@Bean
public ChatClient chatClient(ChatClient.Builder builder, CmsAiProperties properties) {
if (StringUtils.isNotBlank(properties.getDefaultSystem())) {
builder.defaultSystem(properties.getDefaultSystem());
}
if (properties.getToolCalls()) {
builder.defaultTools(new CmsAiTools());
}
return builder.build();
}
/**
* 聊天对话数据存储
* @author ThinkGem
*/
@Bean
public ChatMemory chatMemory(CacheChatMemoryRepository cacheChatMemoryRepository) {
return MessageWindowChatMemory.builder()
.chatMemoryRepository(cacheChatMemoryRepository)
.maxMessages(1024)
.build();
}
// @Bean
// public BatchingStrategy batchingStrategy() {
// return new TokenCountBatchingStrategy(EncodingType.CL100K_BASE, Integer.MAX_VALUE, 0.1);
// }
/**
* PG向量库数据源
* @author ThinkGem
*/
@Bean
@Primary
@ConditionalOnProperty(name = "jdbc.ds_pgvector.type")
public JdbcTemplate pgVectorStoreJdbcTemplate() {
return DataSourceHolder.getRoutingDataSource()
.getJdbcTemplate("ds_pgvector");
}
}

View File

@@ -1,36 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.cms.ai.config;
import com.jeesite.common.config.Global;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* MVC 异步任务池定义
* @author ThinkGem
*/
@Configuration
public class CmsAiWebMvcConfig implements WebMvcConfigurer {
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
configurer.setTaskExecutor(webMvcAsyncTaskExecutor());
}
@Bean
public ThreadPoolTaskExecutor webMvcAsyncTaskExecutor() {
ThreadPoolTaskExecutor bean = new ThreadPoolTaskExecutor();
bean.setCorePoolSize(Global.getPropertyToInteger("web.taskPool.corePoolSize", "8"));
bean.setMaxPoolSize(Global.getPropertyToInteger("web.taskPool.maxPoolSize", "20"));
bean.setKeepAliveSeconds(Global.getPropertyToInteger("web.taskPool.keepAliveSeconds", "60"));
bean.setQueueCapacity(Global.getPropertyToInteger("web.taskPool.queueCapacity", String.valueOf(Integer.MAX_VALUE)));
bean.setThreadNamePrefix("web-async-");
return bean;
}
}

View File

@@ -1,129 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.cms.ai.config;
import com.jeesite.common.mapper.JsonMapper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.web.reactive.function.client.WebClientCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.DataBufferUtils;
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
import org.springframework.http.HttpHeaders;
import org.springframework.web.reactive.function.client.ClientResponse;
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* 推理模型OpenAI兼容处理
* @author ThinkGem
*/
@Configuration
public class WebClientThinkConfig {
private final Logger logger = LoggerFactory.getLogger(WebClientThinkConfig.class);
@Bean
@ConditionalOnMissingBean
public WebClientCustomizer webClientCustomizerThink() {
return webClientBuilder -> {
ExchangeFilterFunction requestFilter = ExchangeFilterFunction.ofRequestProcessor(clientRequest -> {
logger.trace("Request url: {}: {}", clientRequest.method(), clientRequest.url());
return Mono.just(clientRequest);
});
ExchangeFilterFunction responseFilter = ExchangeFilterFunction.ofResponseProcessor(clientResponse -> {
logger.trace("Response status: {}", clientResponse.statusCode());
AtomicBoolean thinkingFlag = new AtomicBoolean(false);
Flux<DataBuffer> modifiedBody = clientResponse.bodyToFlux(DataBuffer.class)
.map(buf -> {
byte[] bytes = new byte[buf.readableByteCount()];
buf.read(bytes);
DataBufferUtils.release(buf);
return new String(bytes, StandardCharsets.UTF_8);
})
.flatMap(eventString -> {
logger.trace("Original response: ==> {}", eventString);
List<String> lines = new ArrayList<>();
String[] list = eventString.split("\\n", -1);
for (String line : list) {
if (!line.startsWith("data: ")) {
lines.add(line);
continue;
}
String jsonPart = line.substring("data: ".length()).trim();
if (!(StringUtils.startsWith(jsonPart, "{")
&& StringUtils.endsWith(jsonPart, "}")
&& !"data: [DONE]".equals(line))) {
lines.add(line);
continue;
}
Map<String, Object> map = JsonMapper.fromJson(jsonPart, Map.class);
if (map == null) {
lines.add(line);
continue;
}
// 修改内容字段
List<Object> choices = (List<Object>)map.get("choices");
if (choices == null) {
lines.add(line);
continue;
}
for (Object o : choices) {
Map<String, Object> choice = (Map<String, Object>) o;
if (choice == null) {
continue;
}
Map<String, Object> delta = (Map<String, Object>) choice.get("delta");
if (delta == null) {
continue;
}
String reasoningContent = (String) delta.get("reasoning_content");
String content = (String) delta.get("content");
if (StringUtils.isNotEmpty(reasoningContent) && StringUtils.isEmpty(content)) {
if (!thinkingFlag.get()) {
thinkingFlag.set(true);
delta.put("content", "<think>\n" + reasoningContent);
} else {
delta.put("content", reasoningContent);
}
} else {
if (thinkingFlag.get()) {
thinkingFlag.set(false);
delta.put("content", "</think>\n" + (content == null ? "" : content));
}
}
}
// 重新生成事件字符串
lines.add("data: " + JsonMapper.toJson(map));
}
String finalLine = StringUtils.join(lines, "\n");
logger.trace("Modified response: ==> {}", finalLine);
return Mono.just(finalLine);
})
.map(str -> {
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
return new DefaultDataBufferFactory().wrap(bytes);
});
ClientResponse modifiedResponse = ClientResponse.from(clientResponse)
.headers(headers -> headers.remove(HttpHeaders.CONTENT_LENGTH))
.body(modifiedBody)
.build();
return Mono.just(modifiedResponse);
});
webClientBuilder.filter(requestFilter).filter(responseFilter);
};
}
}

View File

@@ -1,46 +0,0 @@
package com.jeesite.modules.cms.ai.properties;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties("spring.ai")
public class CmsAiProperties {
/**
* 是否启用 Tool calling 工具调用
*/
private Boolean toolCalls = false;
/**
* 默认系统提示词
*/
private String defaultSystem = "";
/**
* 默认问题模板格式
*/
private String defaultPromptTemplate = "";
public Boolean getToolCalls() {
return toolCalls;
}
public void setToolCalls(Boolean toolCalls) {
this.toolCalls = toolCalls;
}
public String getDefaultSystem() {
return defaultSystem;
}
public void setDefaultSystem(String defaultSystem) {
this.defaultSystem = defaultSystem;
}
public String getDefaultPromptTemplate() {
return defaultPromptTemplate;
}
public void setDefaultPromptTemplate(String defaultPromptTemplate) {
this.defaultPromptTemplate = defaultPromptTemplate;
}
}

View File

@@ -1,220 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.cms.ai.service;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.config.Global;
import com.jeesite.common.io.IOUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.lang.TimeUtils;
import com.jeesite.common.utils.PageUtils;
import com.jeesite.common.web.http.HttpClientUtils;
import com.jeesite.common.web.http.ServletUtils;
import com.jeesite.modules.cms.entity.Article;
import com.jeesite.modules.cms.service.ArticleVectorStore;
import com.jeesite.modules.cms.utils.CmsUtils;
import com.vladsch.flexmark.html.renderer.LinkType;
import com.vladsch.flexmark.html.renderer.ResolvedLink;
import com.vladsch.flexmark.html2md.converter.FlexmarkHtmlConverter;
import com.vladsch.flexmark.html2md.converter.HtmlLinkResolver;
import com.vladsch.flexmark.html2md.converter.HtmlLinkResolverFactory;
import com.vladsch.flexmark.html2md.converter.HtmlNodeConverterContext;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.tika.Tika;
import org.apache.tika.config.TikaConfig;
import org.apache.tika.exception.TikaException;
import org.apache.tika.io.TikaInputStream;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.mime.MediaType;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.document.Document;
import org.springframework.ai.transformer.splitter.TokenTextSplitter;
import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.ai.vectorstore.filter.FilterExpressionBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* CMS 文章向量库存储
* @author ThinkGem
*/
@Service
@ConditionalOnBean(VectorStore.class)
public class ArticleVectorStoreImpl implements ArticleVectorStore {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private VectorStore vectorStore;
/**
* 保存文章到向量库
* @author ThinkGem
*/
@Override
public void save(Article article) {
Map<String, Object> metadata = MapUtils.newHashMap();
metadata.put("id", article.getId());
metadata.put("siteCode", article.getCategory().getSite().getSiteCode());
metadata.put("categoryCode", article.getCategory().getCategoryCode());
metadata.put("categoryName", article.getCategory().getCategoryName());
metadata.put("title", article.getTitle());
metadata.put("href", article.getHref());
metadata.put("keywords", article.getKeywords());
metadata.put("description", article.getDescription());
metadata.put("url", article.getUrl());
metadata.put("status", article.getStatus());
metadata.put("createBy", article.getCreateBy());
metadata.put("createDate", article.getCreateDate());
metadata.put("updateBy", article.getUpdateBy());
metadata.put("updateDate", article.getUpdateDate());
List<String> attachmentList = ListUtils.newArrayList();
String content = article.getTitle() + ", " + article.getKeywords() + ", "
+ article.getDescription() + ", " + FlexmarkHtmlConverter.builder()
.linkResolverFactory(getHtmlLinkResolverFactory(attachmentList)).build()
.convert(article.getArticleData().getContent())
+ ", attachment: " + attachmentList;
List<Document> documents = List.of(new Document(article.getId(), content, metadata));
List<Document> splitDocuments = new TokenTextSplitter().apply(documents);
this.delete(article); // 删除原数据
ListUtils.pageList(splitDocuments, 10, params -> {
vectorStore.add((List<Document>)params[0]); // 增加新数据
return null;
});
}
/**
* 解析文章中的连接并提取内容
* @author ThinkGem
*/
private @NotNull HtmlLinkResolverFactory getHtmlLinkResolverFactory(List<String> attachmentList) {
HttpServletRequest request = ServletUtils.getRequest();
return new HtmlLinkResolverFactory() {
@Override
public @NotNull Set<Class<?>> getAfterDependents() {
return Set.of();
}
@Override
public @NotNull Set<Class<?>> getBeforeDependents() {
return Set.of();
}
@Override
public boolean affectsGlobalScope() {
return false;
}
@Override
public HtmlLinkResolver apply(HtmlNodeConverterContext htmlNodeConverterContext) {
return (node, context, resolvedLink) -> {
if ("a".equalsIgnoreCase(node.nodeName())) {
String href = node.attributes().get("href"); String url = href;
if (StringUtils.contains(url, "://")) {
// 只提取系统允许跳转的附件内容外部网站内容不进行提取shiro.allowRedirects 参数设置范围
if (ServletUtils.isAllowRedirects(request, url)) {
try (InputStream is = HttpClientUtils.getInputStream(url, null)) {
if (is != null) {
String text = getDocumentText(is);
attachmentList.add(url + text);
}
} catch (IOException | TikaException e) {
logger.error(e.getMessage(), e);
}
}
} else {
String ctxPath = Global.getCtxPath();
if (StringUtils.isNotBlank(ctxPath) && StringUtils.startsWith(url, ctxPath)){
url = url.substring(ctxPath.length());
}
try (InputStream is = IOUtils.getFileInputStream(Global.getUserfilesBaseDir(url))){
if (is != null) {
String text = getDocumentText(is);
attachmentList.add(url + text);
}
} catch (IOException | TikaException e) {
logger.error(e.getMessage(), e);
}
}
return new ResolvedLink(LinkType.LINK, href);
}
return resolvedLink;
};
}
/**
* 获取文章附件中的内容
* @author ThinkGem
*/
private static @NotNull String getDocumentText(InputStream is) throws IOException, TikaException {
TikaConfig config = TikaConfig.getDefaultConfig();
Tika tika = new Tika(config);
Metadata metadata = new Metadata();
TikaInputStream stream = TikaInputStream.get(is);
MediaType mimetype = tika.getDetector().detect(stream, metadata);
if (mimetype != null && StringUtils.equals(mimetype.getType(), "text")) {
String text = IOUtils.toString(stream, StandardCharsets.UTF_8);
if (StringUtils.isNotBlank(text)) {
return FlexmarkHtmlConverter.builder().build().convert(text);
} else {
return text;
}
}
String content = tika.parseToString(stream, metadata);
return content.lines()
.map(String::strip).filter(line -> !line.isEmpty())
.reduce((a, b) -> a + System.lineSeparator() + b)
.orElse(StringUtils.EMPTY);
}
};
}
/**
* 删除向量库文章
* @author ThinkGem
*/
@Override
public void delete(Article article) {
if (StringUtils.isNotBlank(article.getId())) {
vectorStore.delete(new FilterExpressionBuilder().eq("id", article.getId()).build());
}
}
/**
* 重建向量库文章
* @author ThinkGem
*/
public String rebuild(Article article) {
logger.debug("开始重建向量库。 siteCode: {}, categoryCode: {}",
article.getCategory().getSite().getSiteCode(),
article.getCategory().getCategoryCode());
long start = System.currentTimeMillis();
try{
article.setIsQueryArticleData(true); // 查询文章内容
PageUtils.findList(article, null, e -> {
List<Article> list = CmsUtils.getArticleService().findList((Article) e);
if (!list.isEmpty()) {
list.forEach(this::save);
return true;
}
return false;
});
}catch(Exception ex){
logger.error("重建向量库失败", ex);
return "重建向量库失败:" + ex.getMessage();
}
String message = "重建向量库完成! 用时" + TimeUtils.formatTime(System.currentTimeMillis() - start) + "";
logger.debug(message);
return message;
}
}

View File

@@ -1,44 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.cms.ai.service;
import com.jeesite.common.cache.CacheUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.ai.chat.memory.ChatMemoryRepository;
import org.springframework.ai.chat.messages.Message;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* AI 对话消息存储
* @author ThinkGem
*/
@Service
public class CacheChatMemoryRepository implements ChatMemoryRepository {
private static final String CMS_CHAT_MSG_CACHE = "cmsChatMsgCache";
@Override
public @NotNull List<String> findConversationIds() {
return CacheUtils.getCache(CMS_CHAT_MSG_CACHE).keys().stream().map(Object::toString).toList();
}
@Override
public @NotNull List<Message> findByConversationId(@NotNull String conversationId) {
List<Message> all = CacheUtils.get(CMS_CHAT_MSG_CACHE, conversationId);
return all != null ? all : List.of();
}
@Override
public void saveAll(@NotNull String conversationId, @NotNull List<Message> messages) {
CacheUtils.put(CMS_CHAT_MSG_CACHE, conversationId, messages);
}
@Override
public void deleteByConversationId(@NotNull String conversationId) {
CacheUtils.remove(CMS_CHAT_MSG_CACHE, conversationId);
}
}

View File

@@ -1,258 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.cms.ai.service;
import com.jeesite.common.cache.CacheUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.idgen.IdGen;
import com.jeesite.common.lang.DateUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.mapper.JsonMapper;
import com.jeesite.common.service.BaseService;
import com.jeesite.modules.cms.ai.properties.CmsAiProperties;
import com.jeesite.modules.sys.entity.Area;
import com.jeesite.modules.sys.utils.AreaUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.MessageChatMemoryAdvisor;
import org.springframework.ai.chat.client.advisor.vectorstore.QuestionAnswerAdvisor;
import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.ai.chat.messages.AssistantMessage;
import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.SystemMessage;
import org.springframework.ai.chat.messages.UserMessage;
import org.springframework.ai.chat.model.ChatResponse;
import org.springframework.ai.chat.model.Generation;
import org.springframework.ai.chat.prompt.PromptTemplate;
import org.springframework.ai.converter.AbstractMessageOutputConverter;
import org.springframework.ai.converter.BeanOutputConverter;
import org.springframework.ai.converter.MapOutputConverter;
import org.springframework.ai.vectorstore.SearchRequest;
import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.messaging.converter.MappingJackson2MessageConverter;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import reactor.core.publisher.Flux;
import reactor.core.publisher.SignalType;
import java.util.List;
import java.util.Map;
/**
* AI 聊天服务类
* @author ThinkGem
*/
@Service
public class CmsAiChatService extends BaseService {
private static final String CMS_CHAT_CACHE = "cmsChatCache";
private static final String[] USER_MESSAGE_SEARCH = new String[]{"{", "}"};
private static final String[] USER_MESSAGE_REPLACE = new String[]{"\\{", "\\}"};
@Autowired
private ChatClient chatClient;
@Autowired
private ChatMemory chatMemory;
@Autowired(required = false)
private VectorStore vectorStore;
@Autowired
private CmsAiProperties properties;
/**
* 获取聊天对话消息
* @author ThinkGem
*/
public List<Message> getChatMessage(String conversationId) {
if (StringUtils.isBlank(conversationId)) {
return List.of();
}
return chatMemory.get(conversationId);
}
private static String getChatCacheKey() {
String key = UserUtils.getUser().getId();
if (StringUtils.isBlank(key)) {
key = UserUtils.getSession().getId().toString();
}
return key;
}
public Map<String, Map<String, Object>> getChatCacheMap() {
Map<String, Map<String, Object>> cache = CacheUtils.get(CMS_CHAT_CACHE, getChatCacheKey());
if (cache == null) {
cache = MapUtils.newHashMap();
}
return cache;
}
/**
* 新建或更新聊天对话
* @author ThinkGem
*/
public Map<String, Object> saveChatConversation(String conversationId, String title) {
if (StringUtils.isBlank(conversationId)) {
conversationId = IdGen.nextId();
}
if (StringUtils.isBlank(title)) {
title = "新对话 " + DateUtils.getTime();
}
Map<String, Object> map = MapUtils.newHashMap();
map.put("id", conversationId);
map.put("title", title);
Map<String, Map<String, Object>> cache = getChatCacheMap();
cache.put(conversationId, map);
CacheUtils.put(CMS_CHAT_CACHE, getChatCacheKey(), cache);
return map;
}
/**
* 删除聊天对话
* @author ThinkGem
*/
public void deleteChatConversation(String conversationId) {
Map<String, Map<String, Object>> cache = getChatCacheMap();
cache.remove(conversationId);
CacheUtils.put(CMS_CHAT_CACHE, getChatCacheKey(), cache);
chatMemory.clear(conversationId);
}
/**
* 聊天对话,流输出
* @author ThinkGem
*/
public Flux<ChatResponse> chatStream(String conversationId, String message, HttpServletRequest request) {
ChatClient.ChatClientRequestSpec spec = chatClient.prompt()
.messages(new UserMessage(StringUtils.replaceEach(message, USER_MESSAGE_SEARCH, USER_MESSAGE_REPLACE)))
.advisors(MessageChatMemoryAdvisor.builder(chatMemory)
.conversationId(conversationId)
.build());
if (vectorStore != null) {
spec.advisors(QuestionAnswerAdvisor.builder(vectorStore)
.searchRequest(SearchRequest.builder().similarityThreshold(0.6F).topK(6).build())
.promptTemplate(new PromptTemplate(properties.getDefaultPromptTemplate()))
.build());
}
return spec.stream()
.chatResponse()
.doOnNext(response -> {
if (response.getResult() != null && StringUtils.isNotBlank(response.getResult().getOutput().getText())) {
AssistantMessage assistantMessage = (AssistantMessage)request.getAttribute("assistantMessage");
AssistantMessage currAssistantMessage = response.getResult().getOutput();
if (assistantMessage == null) {
request.setAttribute("assistantMessage", currAssistantMessage);
} else {
request.setAttribute("assistantMessage", new AssistantMessage(
assistantMessage.getText() + currAssistantMessage.getText(),
currAssistantMessage.getMetadata()));
}
}
})
.doFinally((signalType) -> {
if (signalType != SignalType.ON_COMPLETE) {
AssistantMessage assistantMessage = (AssistantMessage)request.getAttribute("assistantMessage");
if (assistantMessage != null) {
chatMemory.add(conversationId, assistantMessage);
} else if (signalType == SignalType.CANCEL) {
chatMemory.add(conversationId, new AssistantMessage(text("暂无消息,你已主动停止响应。")));
}
}
})
.onErrorResume(error -> {
String errorMessage = error.getMessage();
if (error instanceof WebClientResponseException webClientError) {
errorMessage = webClientError.getResponseBodyAsString();
}
AssistantMessage assistantMessage = new AssistantMessage(errorMessage);
chatMemory.add(conversationId, assistantMessage);
logger.error("Error message: {}", errorMessage);
return Flux.just(ChatResponse.builder()
.generations(List.of(new Generation(assistantMessage)))
.build());
});
}
/**
* 聊天对话,文本输出
* @author ThinkGem
*/
public String chatText(String message) {
return chatClient.prompt()
.messages(
new UserMessage(StringUtils.replaceEach(message, USER_MESSAGE_SEARCH, USER_MESSAGE_REPLACE))
)
.call()
.content();
}
/**
* 聊天对话结构化输出Map
* @author ThinkGem
*/
public Map<String, Object> chatJson(String message) {
return chatClient.prompt()
.messages(
new SystemMessage("""
[ {name:'张三', sex:'男', age:'17'}, {name:'李四', sex:'女', age:'18'} ],返回 json。
"""),
new UserMessage(StringUtils.replaceEach(message, USER_MESSAGE_SEARCH, USER_MESSAGE_REPLACE))
)
.call()
.responseEntity(
new AbstractMessageOutputConverter<Map<String, Object>>(
new MappingJackson2MessageConverter(JsonMapper.getInstance())
) {
final MapOutputConverter mapOutputConverter = new MapOutputConverter();
@Override
public Map<String, Object> convert(String source) {
return mapOutputConverter.convert(source);
}
@Override
public String getFormat() {
return mapOutputConverter.getFormat();
}
}
)
.getEntity();
}
/**
* 聊天对话结构化输出Area
* @author ThinkGem
*/
public List<Area> chatArea(String message) {
List<Area> list = AreaUtils.getAreaAllList();
if (list.size() > 10) list = list.subList(0, 10);
ChatClient.ChatClientRequestSpec spec = chatClient.prompt()
.messages(
new SystemMessage(JsonMapper.toJson(list)),
new UserMessage(StringUtils.replaceEach(message, USER_MESSAGE_SEARCH, USER_MESSAGE_REPLACE))
);
if (vectorStore != null) {
spec.advisors(QuestionAnswerAdvisor.builder(vectorStore)
.searchRequest(SearchRequest.builder().similarityThreshold(0.6F).topK(6).build())
.promptTemplate(new PromptTemplate(properties.getDefaultPromptTemplate()))
.build());
}
return spec.call()
.responseEntity(new BeanOutputConverter<>(new ParameterizedTypeReference<List<Area>>() {},
JsonMapper.getInstance()))
.getEntity();
}
// public static void main(String[] args) {
// String s = """
// [{"id":"110000","isNewRecord":false,"createBy":"system","createDate":"2025-01-01T19:25:11Z","updateBy":"system","updateDate":"2025-01-01 19:25","childList":[{"id":"110100","isNewRecord":false,"createBy":"system","createDate":"2025-01-01 19:25","updateBy":"system","updateDate":"2025-01-01 19:25","childList":[{"id":"110101","isNewRecord":false,"areaCode":"110101","areaName":"东城区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110102","isNewRecord":false,"areaCode":"110102","areaName":"西城区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110105","isNewRecord":false,"areaCode":"110105","areaName":"朝阳区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110106","isNewRecord":false,"areaCode":"110106","areaName":"丰台区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110107","isNewRecord":false,"areaCode":"110107","areaName":"石景山区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110108","isNewRecord":false,"areaCode":"110108","areaName":"海淀区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110109","isNewRecord":false,"areaCode":"110109","areaName":"门头沟区","areaType":"3","isRoot":true,"isTreeLeaf":false},{"id":"110111","isNewRecord":false,"areaCode":"110111","areaName":"房山区","areaType":"3","isRoot":true,"isTreeLeaf":false}],"areaCode":"110100","areaName":"北京城区","areaType":"2","isRoot":true,"isTreeLeaf":false}],"areaCode":"110000","areaName":"北京市","areaType":"1","isRoot":true,"isTreeLeaf":false}]
// """;
// JsonMapper jsonMapper = JsonMapper.getInstance();
// ParameterizedTypeReference<List<Area>> p = new ParameterizedTypeReference<List<Area>>() {};
// List<Area> entity = jsonMapper.fromJsonString(s, jsonMapper.constructType(p.getType()));
// System.out.println(entity);
// String json = jsonMapper.toJsonString(entity);
// System.out.println(json);
// }
}

View File

@@ -1,46 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.cms.ai.tools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import java.time.LocalDateTime;
/**
* AI 工具调用、Tool calling需选择支持 Tools 的模型)
* @author ThinkGem
*/
public class CmsAiTools {
private final Logger logger = LoggerFactory.getLogger(CmsAiTools.class);
/**
* 未联网搜索的时候,可获取到服务器时间
*/
@Tool(description = "当前时间,当前日期,几点了")
public String getCurrentDateTime() {
String dateTime = "当前日期时间:" + LocalDateTime.now();
logger.info(dateTime + " ============== ");
return dateTime;
}
/**
* 你可以询问:打开客厅的灯,关闭卧室的灯(需创建新对话)
*/
@Tool(description = "房间里的灯打开或关闭")
public String turnLight(@ToolParam(description = "房间") String roomName, @ToolParam(description = "开关") boolean on) {
String message = roomName + " 房间里的灯被 " + (on ? "打开" : "关闭");
logger.info(message + " ============== ");
return String.format("""
message: %s
roomName: %s
on: %s
""",
roomName, on, message);
}
}

View File

@@ -1,118 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.cms.ai.web;
import com.jeesite.common.config.Global;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.cms.ai.service.CmsAiChatService;
import com.jeesite.modules.sys.entity.Area;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.model.ChatResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* AI 聊天控制器类
* @author ThinkGem
*/
@RestController
@RequestMapping("${adminPath}/cms/chat")
public class CmsAiChatController extends BaseController {
@Autowired
private CmsAiChatService cmsAiChatService;
/**
* 获取聊天对话消息
* @author ThinkGem
*/
@RequestMapping("/message")
public List<Message> message(String id) {
return cmsAiChatService.getChatMessage(id);
}
/**
* 聊天对话列表
* @author ThinkGem
*/
@RequestMapping("/list")
public Collection<Map<String, Object>> list() {
return cmsAiChatService.getChatCacheMap().values().stream()
.sorted(Comparator.comparing(map -> (String) map.get("id"),
Comparator.reverseOrder())).collect(Collectors.toList());
}
/**
* 新建或更新聊天对话
* @author ThinkGem
*/
@RequestMapping("/save")
public String save(String id, String title) {
Map<String, Object> map = cmsAiChatService.saveChatConversation(id, title);
return renderResult(Global.TRUE, "保存成功", map);
}
/**
* 删除聊天对话
* @author ThinkGem
*/
@RequestMapping("/delete")
public String delete(@RequestParam String id) {
cmsAiChatService.deleteChatConversation(id);
return renderResult(Global.TRUE, "删除成功", id);
}
/**
* 聊天对话,流输出
* @author ThinkGem
* http://127.0.0.1:8980/js/a/cms/chat/stream?id=1&message=你好
*/
@RequestMapping(value = "/stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<ChatResponse> stream(@RequestParam String id, @RequestParam String message, HttpServletRequest request) {
return cmsAiChatService.chatStream(id, message, request);
}
/**
* 聊天对话,文本输出
* @author ThinkGem
* http://127.0.0.1:8980/js/a/cms/chat/text?message=你好
*/
@RequestMapping(value = "/text")
public String text(@RequestParam String message) {
return cmsAiChatService.chatText(message);
}
/**
* 聊天对话,结构化输出
* @author ThinkGem
* http://127.0.0.1:8980/js/a/cms/chat/json?message=张三
*/
@RequestMapping(value = "/json")
public Map<String, Object> json(@RequestParam String message) {
return cmsAiChatService.chatJson(message);
}
/**
* 聊天对话,结构化输出
* @author ThinkGem
* http://127.0.0.1:8980/js/a/cms/chat/entity?message=北京
*/
@RequestMapping(value = "/entity")
public List<Area> entity(@RequestParam String message) {
return cmsAiChatService.chatArea(message);
}
}

View File

@@ -1,12 +0,0 @@
## 重要提示Tip
## 请勿在该配置文件中添加其它任何配置(添加也不会生效)。
## 该文件,仅仅是为了让 jeesite-cms-ai.yml 文件,
## 在 IDEA 中有一个自动完成及帮助提示,并无其它用意。
## 参数配置请在 jeesite-cms-ai.yml 文件中添加。
spring:
config:
import:
- classpath:config/jeesite-cms-ai.yml

View File

@@ -1,181 +0,0 @@
# 温馨提示不建议直接修改此文件为了平台升级方便建议将需要修改的参数值复制到application.yml里进行覆盖该参数值。
spring:
ai:
# 在线大模型【请在 pom.xml 中打开 openai 的注释,并注释上其它模型】
openai:
# 硅基流动
base-url: https://api.siliconflow.cn
api-key: ${SFLOW_APP_KEY}
# 聊天对话模型
chat:
options:
model: deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
max-tokens: 1024
temperature: 0.6
top-p: 0.9
frequency-penalty: 0
# 向量库知识库模型(注意:不同的模型维度不同)
embedding:
options:
model: BAAI/bge-m3
dimensions: 512
# # 模力方舟
# base-url: https://ai.gitee.com
# api-key: ${GITEE_APP_KEY}
# # 聊天对话模型
# chat:
# options:
# model: DeepSeek-R1-Distill-Qwen-14B
# max-tokens: 1024
# temperature: 0.6
# top-p: 0.9
# frequency-penalty: 0
# #logprobs: true
# # 向量库知识库模型(注意:不同的模型维度不同)
# embedding:
# options:
# model: bge-large-zh-v1.5
# dimensions: 512
# # 阿里百炼
# base-url: https://dashscope.aliyuncs.com/compatible-mode
# api-key: ${BAILIAN_APP_KEY}
# # 聊天对话模型
# chat:
# options:
# model: deepseek-r1-distill-llama-8b
# max-tokens: 1024
# temperature: 0.6
# top-p: 0.9
# frequency-penalty: 0
# #logprobs: true
# # 向量库知识库模型(注意:不同的模型维度不同)
# embedding:
# options:
# model: text-embedding-v3
# dimensions: 1024
# 本地大模型配置【请在 pom.xml 中打开 ollama 的注释,并注释上其它模型】
ollama:
base-url: http://localhost:11434
# 聊天对话模型
chat:
options:
model: qwen2.5
#model: deepseek-r1:7b
max-tokens: 1024
temperature: 0.6
top-p: 0.7
frequency-penalty: 0
# 向量库知识库模型(注意:不同的模型维度不同)
embedding:
# 维度 dimensions 设置为 384
#model: all-minilm:33m
# 维度 dimensions 设置为 768
#model: nomic-embed-text
# 维度 dimensions 设置为 1024
model: bge-m3
# 向量数据库配置
vectorstore:
# Chroma 向量数据库【请在 pom.xml 中打开 chroma 的注释,并注释上其它向量库】
chroma:
client:
host: http://testserver
port: 8000
initialize-schema: true
collection-name: vector_store
# collection-name: vector_store_1024
# Postgresql 向量数据库PG 连接配置,见下文,需要手动建表)【请在 pom.xml 中打开 pgvector 的注释,并注释上其它向量库】
pgvector:
id-type: TEXT
index-type: HNSW
distance-type: COSINE_DISTANCE
initialize-schema: false
#table-name: vector_store_384
#dimensions: 384
#table-name: vector_store_786
#dimensions: 768
table-name: vector_store_1024
dimensions: 1024
max-document-batch-size: 10000
# ES 向量数据库ES 连接配置,见下文)【请在 pom.xml 中打开 elasticsearch 的注释,并注释上其它向量库】
elasticsearch:
index-name: vector-index
initialize-schema: true
dimensions: 1024
similarity: cosine
# Milvus 向量数据库【请在 pom.xml 中打开 milvus 的注释,并注释上其它向量库】
milvus:
client:
host: "localhost"
port: 19530
username: "root"
password: "milvus"
initialize-schema: true
database-name: "default"
collection-name: "vector_store"
embedding-dimension: 384
index-type: HNSW
metric-type: COSINE
# 是否启用工具调用【例子详见 CmsAiTools.java 】
tool-calls: false
# 默认系统提示词
default-system: |
## 人物设定
你是我的知识库AI助手请耐心真诚地回复我提出的相关问题。
你需要遵循以下原则,与我进行友善而有价值的沟通。
## 表达方式:
1. 使用简体中文回答我的问题。
2. 可以用少量表情,避免过多表情。
# 默认问题回答模板
default-prompt-template: |
{question_answer_context}
在提供上下文和历史信息的基础上,优先回答最后一条用户的问题。
# ========= Postgresql 向量数据库数据源 =========
#jdbc:
# ds_pgvector:
# type: postgresql
# driver: org.postgresql.Driver
# url: jdbc:postgresql://127.0.0.1:5433/jeesite-ai
# username: postgres
# password: postgres
# testSql: SELECT 1
# pool:
# init: 0
# minIdle: 0
# breakAfterAcquireFailure: true
# ========= ES 向量数据库连接配置 =========
#spring.elasticsearch:
# socket-timeout: 120s
# connection-timeout: 120s
# uris: http://127.0.0.1:9200
# username: elastic
# password: elastic
# 对话消息存缓存,可自定义存数据库
j2cache:
caffeine:
region:
# 对话消息的超期时间,默认 30天根据需要可以设置更久。
cmsChatCache: 100000, 30d
cmsChatMsgCache: 100000, 30d
#logging:
# level:
# org.springframework: debug

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.12.0.springboot3-SNAPSHOT</version>
<version>5.12.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

View File

@@ -13,11 +13,9 @@ import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.cms.utils.CmsUtils;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.io.Serial;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
@@ -68,7 +66,6 @@ import java.util.Date;
public class Article extends DataEntity<Article> {
public static final String DEFAULT_TEMPLATE = "viewArticle"; // 默认文章内容模板
@Serial
private static final long serialVersionUID = 1L;
private Category category; // 栏目编码

View File

@@ -4,15 +4,13 @@
*/
package com.jeesite.modules.cms.entity;
import jakarta.validation.constraints.Size;
import javax.validation.constraints.Size;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.entity.Extend;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import java.io.Serial;
/**
* 文章详情表Entity
* @author 长春叭哥、ThinkGem
@@ -28,7 +26,6 @@ import java.io.Serial;
)
public class ArticleData extends DataEntity<ArticleData> {
@Serial
private static final long serialVersionUID = 1L;
private String content; // 文章内容
private String relation; // 相关文章

View File

@@ -8,8 +8,6 @@ import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import java.io.Serial;
/**
* 文章推荐位Entity
* @author 长春叭哥、ThinkGem
@@ -22,7 +20,6 @@ import java.io.Serial;
)
public class ArticlePosid extends DataEntity<ArticlePosid> {
@Serial
private static final long serialVersionUID = 1L;
private String articleId; // 内容编号
private String postid; // 推荐位置1轮播图 2首页推荐 3栏目页面

View File

@@ -8,8 +8,6 @@ import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import java.io.Serial;
/**
* 文章与标签关系Entity
* @author 长春叭哥、ThinkGem
@@ -22,7 +20,6 @@ import java.io.Serial;
)
public class ArticleTag extends DataEntity<ArticleTag> {
@Serial
private static final long serialVersionUID = 1L;
private String articleId; // 内容编号
private String tagName; // 标签名称

View File

@@ -14,10 +14,8 @@ import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.cms.utils.CmsUtils;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serial;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;
/**
@@ -61,7 +59,6 @@ public class Category extends TreeEntity<Category> {
public static final String SHOW_MODES_CENTENT_LIST = "2"; // 首栏目内容列表
public static final String SHOW_MODES_FIRST_CONTENT = "3"; // 简介类栏目,栏目第一条内容
@Serial
private static final long serialVersionUID = 1L;
private String categoryCode; // 栏目编码
private String categoryName; // 栏目名称

View File

@@ -4,13 +4,12 @@
*/
package com.jeesite.modules.cms.entity;
import java.io.Serial;
import java.util.Date;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.BaseEntity;
@@ -44,7 +43,6 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
)
public class Comment extends DataEntity<Comment> {
@Serial
private static final long serialVersionUID = 1L;
private Category category;// 分类编号

View File

@@ -6,7 +6,6 @@ package com.jeesite.modules.cms.entity;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;
@@ -24,7 +23,6 @@ import com.jeesite.common.lang.ExceptionUtils;
*/
public class FileTemplete implements Comparable<FileTemplete>, Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Resource resource;
private String fileName;

View File

@@ -4,14 +4,12 @@
*/
package com.jeesite.modules.cms.entity;
import jakarta.validation.constraints.Size;
import javax.validation.constraints.Size;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import java.io.Serial;
/**
* 内容举报表Entity
* @author 长春叭哥、ThinkGem
@@ -28,7 +26,6 @@ import java.io.Serial;
)
public class Report extends DataEntity<Report> {
@Serial
private static final long serialVersionUID = 1L;
private String reportSource; // 举报来源1文章、2评论
private String reportContent; // 举报内容(文章标题 评论内容)

View File

@@ -14,10 +14,8 @@ import com.jeesite.modules.cms.utils.CmsUtils;
import com.jeesite.modules.sys.utils.CorpUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serial;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;
/**
@@ -55,7 +53,6 @@ public class Site extends DataEntity<Site> {
*/
public static final String DEFAULT_TEMPLATE = "index";
@Serial
private static final long serialVersionUID = 1L;
private String siteCode; // 站点编码
private String siteName; // 站点名称

View File

@@ -4,14 +4,12 @@
*/
package com.jeesite.modules.cms.entity;
import jakarta.validation.constraints.NotNull;
import javax.validation.constraints.NotNull;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import java.io.Serial;
/**
* 内容标签Entity
* @author 长春叭哥、ThinkGem
@@ -24,7 +22,6 @@ import java.io.Serial;
)
public class Tag extends DataEntity<Tag> {
@Serial
private static final long serialVersionUID = 1L;
private String tagName; // 标签名称
private Integer clicknum; // 点击次数

View File

@@ -4,10 +4,9 @@
*/
package com.jeesite.modules.cms.entity;
import java.io.Serial;
import java.util.Date;
import jakarta.validation.constraints.Size;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.BaseEntity;
@@ -58,7 +57,6 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
)
public class VisitLog extends DataEntity<VisitLog> {
@Serial
private static final long serialVersionUID = 1L;
private String requestUrl; // 请求的URL地址
private String requestUrlHost; // 受访域名

View File

@@ -44,8 +44,6 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
@Autowired(required = false)
private ArticleIndexService articleIndexService;
@Autowired(required = false)
private ArticleVectorStore articleVectorStore;
@Autowired(required = false)
private PageCacheService pageCacheService;
private static final ExecutorService updateExpiredWeightThreadPool = new ThreadPoolExecutor(5, 20,
@@ -168,10 +166,6 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
if (articleIndexService != null && Article.STATUS_NORMAL.equals(article.getStatus())) {
articleIndexService.save(article);
}
// 保存文章到向量数据库
if (articleVectorStore != null && Article.STATUS_NORMAL.equals(article.getStatus())) {
articleVectorStore.save(article);
}
// 清理首页、栏目和文章页面缓存
if (pageCacheService != null) {
pageCacheService.clearCache(article);
@@ -194,14 +188,6 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
articleIndexService.delete(article);
}
}
// 保存文章到向量数据库
if (articleVectorStore != null) {
if (Article.STATUS_NORMAL.equals(article.getStatus())) {
articleVectorStore.save(article);
} else {
articleVectorStore.delete(article);
}
}
// 清理首页、栏目和文章页面缓存
if (pageCacheService != null) {
pageCacheService.clearCache(article);
@@ -235,10 +221,6 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
if (articleIndexService != null) {
articleIndexService.delete(article);
}
// 保存文章到向量数据库
if (articleVectorStore != null) {
articleVectorStore.delete(article);
}
// 清理首页、栏目和文章页面缓存
if (pageCacheService != null) {
pageCacheService.clearCache(article);

View File

@@ -1,36 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.cms.service;
import com.jeesite.common.entity.Page;
import com.jeesite.modules.cms.entity.Article;
import java.util.Map;
/**
* 文章向量存储服务类
* @author ThinkGem
*/
public interface ArticleVectorStore {
/**
* 保存索引
* @author ThinkGem
*/
void save(Article article);
/**
* 删除索引
* @author ThinkGem
*/
void delete(Article article);
/**
* 重建向量库
* @author ThinkGem
*/
String rebuild(Article article);
}

View File

@@ -27,8 +27,6 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
@Autowired(required = false)
private ArticleIndexService articleIndexService;
@Autowired(required = false)
private ArticleVectorStore articleVectorStore;
@Autowired(required = false)
private PageCacheService pageCacheService;
/**
@@ -127,15 +125,4 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
return articleIndexService.rebuild(new Article(category));
}
/**
* 重建向量数据库
* @author ThinkGem
*/
public String rebuildVectorStore(Category category) {
if (articleVectorStore == null) {
return text("您好,系统未配置向量数据库");
}
return articleVectorStore.rebuild(new Article(category));
}
}

View File

@@ -27,8 +27,6 @@ public class SiteService extends CrudService<SiteDao, Site> {
@Autowired(required = false)
private ArticleIndexService articleIndexService;
@Autowired(required = false)
private ArticleVectorStore articleVectorStore;
@Autowired(required = false)
private PageCacheService pageCacheService;
/**
@@ -122,16 +120,5 @@ public class SiteService extends CrudService<SiteDao, Site> {
}
return articleIndexService.rebuild(new Article(new Category(site)));
}
/**
* 重建向量数据库
* @author ThinkGem
*/
public String rebuildVectorStore(Site site) {
if (articleVectorStore == null) {
return text("您好,系统未配置向量数据库");
}
return articleVectorStore.rebuild(new Article(new Category(site)));
}
}

View File

@@ -20,7 +20,7 @@ import com.jeesite.modules.cms.service.CategoryService;
import com.jeesite.modules.cms.service.SiteService;
import org.springframework.ui.Model;
import jakarta.servlet.ServletContext;
import javax.servlet.ServletContext;
import java.util.Collections;
import java.util.List;
import java.util.Map;

View File

@@ -27,8 +27,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

View File

@@ -17,7 +17,6 @@ import com.jeesite.modules.cms.service.CategoryService;
import com.jeesite.modules.cms.service.FileTempleteService;
import com.jeesite.modules.cms.utils.CmsUtils;
import com.jeesite.modules.sys.utils.DictUtils;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +28,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -270,17 +270,6 @@ public class CategoryController extends BaseController {
return renderResult(Global.TRUE, categoryService.rebuildIndex(category));
}
/**
* 重建向量数据库
* @author ThinkGem
*/
@RequiresPermissions("cms:category:rebuildVectorStore")
@ResponseBody
@RequestMapping(value = "rebuildVectorStore")
public String rebuildVectorStore(Category category) {
return renderResult(Global.TRUE, categoryService.rebuildVectorStore(category));
}
/**
* 获取树结构数据
* @param excludeCode 排除的Code

View File

@@ -4,8 +4,8 @@
*/
package com.jeesite.modules.cms.web;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -4,8 +4,8 @@
*/
package com.jeesite.modules.cms.web;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -8,12 +8,12 @@ import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.common.web.CookieUtils;
import com.jeesite.modules.cms.entity.Site;
import com.jeesite.modules.cms.service.FileTempleteService;
import com.jeesite.modules.cms.service.SiteService;
import com.jeesite.modules.sys.utils.CorpUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -24,6 +24,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
@@ -142,17 +144,6 @@ public class SiteController extends BaseController {
public String rebuildIndex(Site site) {
return renderResult(Global.TRUE, siteService.rebuildIndex(site));
}
/**
* 重建向量数据库
* @author ThinkGem
*/
@RequiresPermissions("cms:site:rebuildVectorStore")
@ResponseBody
@RequestMapping(value = "rebuildVectorStore")
public String rebuildVectorStore(Site site) {
return renderResult(Global.TRUE, siteService.rebuildVectorStore(site));
}
/**
* 选择站点

View File

@@ -21,8 +21,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;

View File

@@ -6,8 +6,8 @@ package com.jeesite.modules.cmsfront.web;
import java.util.Map;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

View File

@@ -20,7 +20,5 @@ j2cache:
#spring:
# elasticsearch:
# enabled: true
# uris: http://127.0.0.1:9200
# uris: http://Win11:9200
# connection-timeout: 120s
# username: elastic
# password: elastic

View File

@@ -9,7 +9,7 @@
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
<a href="${ctxFront}/index" target="_blank" class="btn btn-default" title="${text('访问站点')}"><i class="fa fa-globe"></i> ${text('访问网站')}</a>
<% if(hasPermi('cms:article:edit')){ %>
<a href="javascript:" onclick="$(this).data('href', '${ctx}/cms/article/form?category.categoryCode='+$('#categoryCode').val())" class="btn btn-primary btnTool" title="${text('新增文章')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<a href="${ctx}/cms/article/form" onclick="$(this).data('href', this.href+'?category.categoryCode='+$('#categoryCode').val())" class="btn btn-primary btnTool" title="${text('新增文章')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<% } %>
</div>
</div>

View File

@@ -173,7 +173,7 @@
</div>
<% } %>
<script>
$('#inputForm').validate({
$("#inputForm").validate({
submitHandler: function(form){
js.ajaxSubmitForm($(form), function(data){
js.showMessage(data.message);

View File

@@ -107,7 +107,7 @@
</div>
<% } %>
<script>
$('#inputForm').validate({
$("#inputForm").validate({
submitHandler: function(form){
js.ajaxSubmitForm($(form), function(data){
js.showMessage(data.message);

View File

@@ -351,7 +351,7 @@
</div>
<% } %>
<script>
$('#inputForm').validate({
$("#inputForm").validate({
submitHandler: function(form){
js.ajaxSubmitForm($(form), function(data){
js.showMessage(data.message);

View File

@@ -25,7 +25,7 @@ if (message != ''){
function page(n,s){
$("#pageNo").val(n);
$("#pageSize").val(s);
$('#searchForm').submit();
$("#searchForm").submit();
return false;
}
function sel(th, val){

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.12.0.springboot3-SNAPSHOT</version>
<version>5.12.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -129,26 +129,12 @@
<version>${project.parent.version}</version>
</dependency>
<!-- JTA 事务(当 spring.jta.enabled 为 true 的时候开启,不使用 jta 的时候不要引入该依赖)
<dependency>
<groupId>com.atomikos</groupId>
<artifactId>transactions-spring-boot3-starter</artifactId>
<version>${atomikos.version}</version>
</dependency> -->
<!-- ELK 日志收集 -->
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>${logstash-logback.version}</version>
</dependency>
<!-- 热部署工具 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>

View File

@@ -17,7 +17,6 @@ import com.jeesite.common.shiro.session.SessionDAO;
import com.jeesite.common.shiro.session.SessionManager;
import com.jeesite.common.shiro.web.ShiroFilterFactoryBean;
import com.jeesite.common.shiro.web.WebSecurityManager;
import jakarta.servlet.Filter;
import org.apache.shiro.cache.CacheManager;
import org.apache.shiro.realm.Realm;
import org.apache.shiro.realm.ldap.JndiLdapContextFactory;
@@ -35,6 +34,7 @@ import org.springframework.context.annotation.DependsOn;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import javax.servlet.Filter;
import java.util.Collection;
import java.util.Map;

View File

@@ -4,7 +4,6 @@
*/
package com.jeesite.common.shiro.authc;
import java.io.Serial;
import java.util.Map;
/**
@@ -14,7 +13,6 @@ import java.util.Map;
*/
public class LdapToken extends FormToken {
@Serial
private static final long serialVersionUID = 1L;
public LdapToken() {

View File

@@ -16,10 +16,10 @@ import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.util.WebUtils;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* CAS过滤器

View File

@@ -20,10 +20,6 @@ import com.jeesite.common.web.CookieUtils;
import com.jeesite.common.web.http.ServletUtils;
import com.jeesite.modules.sys.entity.*;
import com.jeesite.modules.sys.utils.*;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.IncorrectCredentialsException;
@@ -37,6 +33,10 @@ import org.apache.shiro.web.util.WebUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

View File

@@ -8,9 +8,9 @@ import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils;
import org.apache.shiro.web.filter.AccessControlFilter;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
/**
* 内部系统访问过滤器

View File

@@ -6,8 +6,8 @@ package com.jeesite.common.shiro.filter;
import java.util.Map;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.apache.shiro.authc.AuthenticationToken;

View File

@@ -4,10 +4,10 @@
*/
package com.jeesite.common.shiro.filter;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.session.SessionException;

View File

@@ -9,15 +9,15 @@ import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.http.ServletUtils;
import com.jeesite.common.web.http.wrapper.GetHttpServletRequestWrapper;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.UnauthorizedException;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.util.WebUtils;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**

View File

@@ -4,9 +4,8 @@
*/
package com.jeesite.common.shiro.filter;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;
/**

View File

@@ -6,10 +6,10 @@ package com.jeesite.common.shiro.filter;
import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**

View File

@@ -15,7 +15,6 @@ import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.service.UserService;
import com.jeesite.modules.sys.utils.LogUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
@@ -23,6 +22,8 @@ import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import javax.servlet.http.HttpServletRequest;
/**
* 系统认证授权实现类
* @author ThinkGem

View File

@@ -30,8 +30,8 @@ import org.jasig.cas.client.validation.TicketValidationException;
import org.jasig.cas.client.validation.TicketValidator;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.ValidationException;
import javax.servlet.http.HttpServletRequest;
import javax.validation.ValidationException;
import java.util.Map;
/**

View File

@@ -4,17 +4,11 @@
*/
package com.jeesite.common.shiro.realm;
import com.jeesite.common.shiro.authc.FormToken;
import com.jeesite.common.shiro.authc.LdapToken;
import com.jeesite.common.utils.SpringUtils;
import com.jeesite.common.web.http.ServletUtils;
import com.jeesite.modules.sys.entity.Log;
import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.service.EmpUserService;
import com.jeesite.modules.sys.service.UserService;
import com.jeesite.modules.sys.utils.LogUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import jakarta.servlet.http.HttpServletRequest;
import javax.naming.AuthenticationNotSupportedException;
import javax.naming.NamingException;
import javax.naming.ldap.LdapContext;
import javax.servlet.http.HttpServletRequest;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
@@ -27,13 +21,20 @@ import org.apache.shiro.realm.ldap.LdapContextFactory;
import org.apache.shiro.realm.ldap.LdapUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import javax.naming.AuthenticationNotSupportedException;
import javax.naming.NamingException;
import javax.naming.ldap.LdapContext;
import com.jeesite.common.shiro.authc.FormToken;
import com.jeesite.common.shiro.authc.LdapToken;
import com.jeesite.common.utils.SpringUtils;
import com.jeesite.common.web.http.ServletUtils;
import com.jeesite.modules.sys.entity.Log;
import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.service.EmpUserService;
import com.jeesite.modules.sys.service.UserService;
import com.jeesite.modules.sys.utils.LogUtils;
import com.jeesite.modules.sys.utils.UserUtils;
/**
* 系统认证授权实现类

View File

@@ -8,7 +8,7 @@ import com.jeesite.common.ueditor.define.State;
import com.jeesite.common.ueditor.hunter.FileManager;
import com.jeesite.common.ueditor.hunter.ImageHunter;
import com.jeesite.common.ueditor.upload.Uploader;
import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

View File

@@ -5,7 +5,7 @@ import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;

View File

@@ -6,9 +6,9 @@ import com.jeesite.common.ueditor.define.AppInfo;
import com.jeesite.common.ueditor.define.BaseState;
import com.jeesite.common.ueditor.define.MultiState;
import com.jeesite.common.ueditor.define.State;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.io.FileUtils;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.Arrays;
import java.util.Collection;

View File

@@ -1,5 +1,12 @@
package com.jeesite.common.ueditor.hunter;
import com.jeesite.common.config.Global;
import com.jeesite.common.ueditor.PathFormat;
import com.jeesite.common.ueditor.define.*;
import com.jeesite.common.ueditor.upload.StorageManager;
import org.apache.commons.io.IOUtils;
import javax.servlet.http.HttpServletRequest;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.URL;
@@ -8,19 +15,6 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.jeesite.common.config.Global;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.io.IOUtils;
import com.jeesite.common.ueditor.PathFormat;
import com.jeesite.common.ueditor.define.AppInfo;
import com.jeesite.common.ueditor.define.BaseState;
import com.jeesite.common.ueditor.define.MIMEType;
import com.jeesite.common.ueditor.define.MultiState;
import com.jeesite.common.ueditor.define.State;
import com.jeesite.common.ueditor.upload.StorageManager;
/**
* 图片抓取器
*

View File

@@ -6,9 +6,9 @@ import com.jeesite.common.ueditor.define.AppInfo;
import com.jeesite.common.ueditor.define.BaseState;
import com.jeesite.common.ueditor.define.FileType;
import com.jeesite.common.ueditor.define.State;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.codec.binary.Base64;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
public final class Base64Uploader {

View File

@@ -6,10 +6,10 @@ import com.jeesite.common.io.FileUtils;
import com.jeesite.common.media.VideoUtils;
import com.jeesite.common.ueditor.PathFormat;
import com.jeesite.common.ueditor.define.*;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;

View File

@@ -2,7 +2,7 @@ package com.jeesite.common.ueditor.upload;
import java.util.Map;
import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import com.jeesite.common.ueditor.define.State;

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