diff --git a/Dockerfile b/Dockerfile
index e34a3706947de6bd88442a94f3119c4e0617e4bd..e6f9ba72ce4a39837765dc6ec8ed8e93574855f2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,14 +2,20 @@
FROM registry.cn-beijing.aliyuncs.com/xxm1995/java8
# 作者信息
-MAINTAINER xxm1995@outlook.com
+MAINTAINER bootx
# 时区设置
ENV TZ=Asia/Shanghai
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-# jvm启动参数, 启动内存256M,最大内存1G,使用G1垃圾回收器, 同时读取外置日志配置
-ENV JAVA_OPTS="-Xms256m -Xmx1G -XX:+UseG1GC -Djava.security.egd=file:/dev/./urandom -Dlogging.config=./logback-spring.xml"
+# 启动命令
+ENV JAVA_COMM="-Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8"
+# 启动选项配置
+ENV JAVA_OPTS=""
+# Agent配置
+ENV JAVA_AGENT=""
+# 参数配置
+ENV JAVA_ARGS=""
# 工作目录
WORKDIR /
@@ -21,5 +27,5 @@ EXPOSE 9999
ADD bootx-start/target/bootx-start.jar bootx-start.jar
# 执行启动命令
-CMD java $JAVA_OPTS -jar bootx-start.jar
+CMD java -jar $JAVA_OPTS $JAVA_AGENT $JAVA_COMM bootx-start.jar $JAVA_ARGS
diff --git a/README.md b/README.md
index 8823950b9994e04cedde4881959d8e387007b8fc..ceede72a847a270ec280e52cff2b938816e4e57e 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-# Bootx-Platform (v1.3.3-园博园)
+# Bootx-Platform (v1.3.4-园博园)
-
+
@@ -11,14 +11,10 @@
## 🙏🙏🙏 求star呀,走过路过留个star吧,非常非常感谢。🙏🙏🙏
## 🍈项目介绍
-> 目前Bootx-Platform的开发重点是,将核心中的业务代码剥离出子项目,作为单独系统使用,
-保持脚手架核心的精简,同时对不同的业务模块也可以专门优化和适配,使其加易用和强大。
-
-基于Spring Boot框架打造,针对单体式应用进行专门设计,提供整套服务模块,努力为打造全方位企业级开发解决方案,
+> 基于Spring Boot框架打造,针对单体式应用进行专门设计,提供整套服务模块,努力为打造全方位企业级开发解决方案,
致力将开源版打造成超越商业版后台管理框架的项目。
- 单体版本使用Spring Boot相关技术栈
-- vue2使用 [ANTD PRO VUE](https://pro.antdv.com/) 作为脚手架
- vue3使用 [Vben-Admin](https://vvbin.cn/doc-next/) 作为脚手架
- 可视化大屏使用 [Go-VIew](https://gitee.com/dromara/go-view) 作为基础框架
- 移动端使用 [Taro](https://taro.jd.com/)、[NutUI](https://nutui.jd.com/) vue3+TS为技术栈。
@@ -30,19 +26,7 @@
- bpm-plus:协同办公系统 [Gitee地址](https://gitee.com/bootx/bpm-plus)
- mybatis-table-modify:数据表结构管理 [Gitee地址](https://gitee.com/bootx/mybatis-table-modify)
-## 项目Maven坐标
-> 项目各模块都已经发布到maven中央仓库中,进行二开时可以对不进行更改的模块,使用Maven方式进行引入,方便后续进行版本升级
-
-例子:
-```xml
-
- cn.bootx.platform
- service.iam
- ${latest.version}
-
-```
-
-## 📚文档
+## 📚资料和文档
- 系统演示地址:[管理平台(vue3)](http://v3.platform.bootx.cn/)、[可视化大屏](http://visualization.platform.bootx.cn/)
- 前端项目地址:[前端项目(vue3)](https://gitee.com/bootx/bootx-platform-vue3)、[可视化大屏](https://gitee.com/bootx/bootx-platform-visualization)、[前端项目(vue2只维护不再更新)](https://gitee.com/bootx/bootx-platform-ui)
@@ -51,6 +35,10 @@
- 项目文档:[项目文档(GITEE)](https://bootx.gitee.io/)、[项目文档(备用)](https://doc.bootx.cn/)
- 更新日志:[更新日志](./_doc/ChangeLog.md)
+> 功能更新计划: [任务池](./_doc/Task.md)
+>
+> 历史更新记录: [更新日志](./_doc/ChangeLog.md)
+
## 🛠️功能亮点
低代码可视化平台,基于`GoView`开发,可以通过托拉拽来生成常用的大屏,可以适用于需要快速开发各种数据看板的场景。
@@ -73,11 +61,25 @@
- 集成Flowable+Bpmn.js工作流全家桶,方便OA相关功能的开发
- 基于GoView打造低代码可视化大屏平台,快速生成各种数据展板和大屏
-## 🥂 Quick Start
-Spring Boot后端: [后端启动流程](https://bootx.gitee.io/doc/overview/config/项目启动.html#后端启动)
+## 🧭 项目Maven坐标
+> 项目各模块都已经发布到maven中央仓库中,进行二开时可以对不进行更改的模块,使用Maven方式进行引入,方便后续进行版本升级
+
+例子:
+```xml
+
+ cn.bootx.platform
+ service.iam
+ ${latest.version}
+
+```
+
+## 🥂 Quick Start
-Vue3后端: [Vue3前端启动流程](https://bootx.gitee.io/doc/overview/config/%E9%A1%B9%E7%9B%AE%E5%90%AF%E5%8A%A8.html#环境准备-1)
+- Spring Boot后端: [后端启动流程](https://bootx.gitee.io/doc/overview/config/项目启动.html#后端启动)
+- Vue3后端: [Vue3前端启动流程](https://bootx.gitee.io/doc/overview/config/%E9%A1%B9%E7%9B%AE%E5%90%AF%E5%8A%A8.html#环境准备-1)
+- 可视化大屏: [可视化大屏启动流程]()
+- 小程序移动端: [小程序启动流程]()
## 🥞项目模块结构
```lua
diff --git a/_config/sql/bootx-platform.sql b/_config/sql/bootx-platform.sql
index 73508a3a144b2f1dec6bc2b891b99798b0afa980..a165f5406a5d76760679c49d78008a5a4b0becbe 100644
--- a/_config/sql/bootx-platform.sql
+++ b/_config/sql/bootx-platform.sql
@@ -6,7 +6,7 @@
Target Server Type : MySQL
File Encoding : 65001
- Date: 08/08/2023 15:09:13
+ Date: 27/08/2023 13:46:57
*/
SET NAMES utf8mb4;
@@ -3012,6 +3012,29 @@ INSERT INTO `base_area` VALUES ('659009', '昆玉市', '6590');
INSERT INTO `base_area` VALUES ('659010', '胡杨河市', '6590');
INSERT INTO `base_area` VALUES ('659011', '新星市', '6590');
+-- ----------------------------
+-- Table structure for base_china_word
+-- ----------------------------
+DROP TABLE IF EXISTS `base_china_word`;
+CREATE TABLE `base_china_word` (
+ `id` bigint(20) NOT NULL COMMENT '主键',
+ `word` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '敏感词',
+ `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '分类',
+ `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '描述',
+ `enable` bit(1) NULL DEFAULT NULL COMMENT '是否启用',
+ `creator` bigint(20) NULL DEFAULT NULL COMMENT '创建者ID',
+ `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+ `last_modifier` bigint(20) NULL DEFAULT NULL COMMENT '最后修者ID',
+ `last_modified_time` datetime NULL DEFAULT NULL COMMENT '最后修改时间',
+ `version` int(11) NOT NULL COMMENT '乐观锁',
+ `white` bit(1) NULL DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '敏感词' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of base_china_word
+-- ----------------------------
+
-- ----------------------------
-- Table structure for base_city
-- ----------------------------
@@ -3407,7 +3430,9 @@ INSERT INTO `base_dict` VALUES (1561003021674987520, 'SiteMessageReceive', '消
INSERT INTO `base_dict` VALUES (1561003189111603200, 'SiteMessageState', '消息发布状态', b'1', '站内信', '站内信消息发布状态', 1399985191002447872, '2022-08-20 22:52:17', 1399985191002447872, '2022-08-20 22:52:17', 0, 0);
INSERT INTO `base_dict` VALUES (1589527951317389312, 'DataScopePerm', '数据范围权限', b'1', '系统属性', '数据范围权限', 1414143554414059520, '2022-11-07 15:59:30', 1399985191002447872, '2022-12-09 22:09:25', 0, 3);
INSERT INTO `base_dict` VALUES (1633393287952257024, 'DatabaseType', '数据库类型', b'1', '开发', '数据库类型', 1414143554414059520, '2023-03-08 17:04:41', 1414143554414059520, '2023-03-08 17:04:41', 0, 0);
-INSERT INTO `base_dict` VALUES (1688742690398617600, 'smsChannel', '短信渠道商', b'1', '消息服务', '短信渠道商', 1414143554414059520, '2023-08-08 10:43:27', 1414143554414059520, '2023-08-08 10:43:27', 0, 0);
+INSERT INTO `base_dict` VALUES (1688742690398617600, 'SmsChannel', '短信渠道商', b'1', '消息服务', '短信渠道商', 1414143554414059520, '2023-08-08 10:43:27', 1414143554414059520, '2023-08-12 20:24:03', 0, 1);
+INSERT INTO `base_dict` VALUES (1690338321769918464, 'GeneralTemplateUseType', '通用模板类型', b'1', '系统属性', '通用模板类型', 1414143554414059520, '2023-08-12 20:23:56', 1414143554414059520, '2023-08-12 20:24:22', 0, 1);
+INSERT INTO `base_dict` VALUES (1690338545284378624, 'GeneralTemplateState', '通用模板状态', b'1', '系统属性', '通用模板状态', 1414143554414059520, '2023-08-12 20:24:49', 1414143554414059520, '2023-08-12 20:24:49', 0, 0);
-- ----------------------------
-- Table structure for base_dict_item
@@ -3495,16 +3520,20 @@ INSERT INTO `base_dict_item` VALUES (1589528423956729856, 1589527951317389312, '
INSERT INTO `base_dict_item` VALUES (1633403429028536320, 1633393287952257024, 'DatabaseType', 'mysql', 'MySQL', b'1', 1.00, '', 1414143554414059520, '2023-03-08 17:44:59', 1414143554414059520, '2023-03-08 17:44:59', 0, 0);
INSERT INTO `base_dict_item` VALUES (1633403459470794752, 1633393287952257024, 'DatabaseType', 'oracle', 'Oracle', b'1', 2.00, '', 1414143554414059520, '2023-03-08 17:45:07', 1414143554414059520, '2023-03-08 17:45:07', 0, 0);
INSERT INTO `base_dict_item` VALUES (1633403498695925760, 1633393287952257024, 'DatabaseType', 'mssql', 'SQLServer', b'1', 3.00, '', 1414143554414059520, '2023-03-08 17:45:16', 1414143554414059520, '2023-03-08 17:45:16', 0, 0);
-INSERT INTO `base_dict_item` VALUES (1688742732891111424, 1688742690398617600, 'smsChannel', 'alibaba', '阿里云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:43:38', 1414143554414059520, '2023-08-08 10:43:38', 0, 0);
-INSERT INTO `base_dict_item` VALUES (1688742768479780864, 1688742690398617600, 'smsChannel', 'huawei', '华为云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:43:46', 1414143554414059520, '2023-08-08 10:43:46', 0, 0);
-INSERT INTO `base_dict_item` VALUES (1688742808027873280, 1688742690398617600, 'smsChannel', 'yunpian', '云片', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:43:55', 1414143554414059520, '2023-08-08 10:43:56', 0, 0);
-INSERT INTO `base_dict_item` VALUES (1688742840626003968, 1688742690398617600, 'smsChannel', 'tencent', '腾讯云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:03', 1414143554414059520, '2023-08-08 10:44:03', 0, 0);
-INSERT INTO `base_dict_item` VALUES (1688742872506908672, 1688742690398617600, 'smsChannel', 'uni_sms', '合一短信', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:11', 1414143554414059520, '2023-08-08 10:44:11', 0, 0);
-INSERT INTO `base_dict_item` VALUES (1688742905553829888, 1688742690398617600, 'smsChannel', 'jd_cloud', '京东云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:19', 1414143554414059520, '2023-08-08 10:44:19', 0, 0);
-INSERT INTO `base_dict_item` VALUES (1688742954715267072, 1688742690398617600, 'smsChannel', 'cloopen', '容联云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:30', 1414143554414059520, '2023-08-08 10:44:30', 0, 0);
-INSERT INTO `base_dict_item` VALUES (1688742990446542848, 1688742690398617600, 'smsChannel', 'emay', '亿美软通', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:39', 1414143554414059520, '2023-08-08 10:44:39', 0, 0);
-INSERT INTO `base_dict_item` VALUES (1688743032297308160, 1688742690398617600, 'smsChannel', 'ctyun', '天翼云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:49', 1414143554414059520, '2023-08-08 10:44:49', 0, 0);
-INSERT INTO `base_dict_item` VALUES (1688743065205817344, 1688742690398617600, 'smsChannel', 'netease', '网易云信', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:57', 1414143554414059520, '2023-08-08 10:44:57', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1688742732891111424, 1688742690398617600, 'SmsChannel', 'alibaba', '阿里云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:43:38', 1414143554414059520, '2023-08-08 10:43:38', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1688742768479780864, 1688742690398617600, 'SmsChannel', 'huawei', '华为云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:43:46', 1414143554414059520, '2023-08-08 10:43:46', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1688742808027873280, 1688742690398617600, 'SmsChannel', 'yunpian', '云片', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:43:55', 1414143554414059520, '2023-08-08 10:43:56', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1688742840626003968, 1688742690398617600, 'SmsChannel', 'tencent', '腾讯云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:03', 1414143554414059520, '2023-08-08 10:44:03', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1688742872506908672, 1688742690398617600, 'SmsChannel', 'uni_sms', '合一短信', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:11', 1414143554414059520, '2023-08-08 10:44:11', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1688742905553829888, 1688742690398617600, 'SmsChannel', 'jd_cloud', '京东云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:19', 1414143554414059520, '2023-08-08 10:44:19', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1688742954715267072, 1688742690398617600, 'SmsChannel', 'cloopen', '容联云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:30', 1414143554414059520, '2023-08-08 10:44:30', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1688742990446542848, 1688742690398617600, 'SmsChannel', 'emay', '亿美软通', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:39', 1414143554414059520, '2023-08-08 10:44:39', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1688743032297308160, 1688742690398617600, 'SmsChannel', 'ctyun', '天翼云', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:49', 1414143554414059520, '2023-08-08 10:44:49', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1688743065205817344, 1688742690398617600, 'SmsChannel', 'netease', '网易云信', b'1', 0.00, '', 1414143554414059520, '2023-08-08 10:44:57', 1414143554414059520, '2023-08-08 10:44:57', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1690338619024437248, 1690338321769918464, 'GeneralTemplateUseType', 'import', '导入', b'1', 0.00, '', 1414143554414059520, '2023-08-12 20:25:06', 1414143554414059520, '2023-08-12 20:25:06', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1690338653442895872, 1690338321769918464, 'GeneralTemplateUseType', 'export', '导出', b'1', 0.00, '', 1414143554414059520, '2023-08-12 20:25:15', 1414143554414059520, '2023-08-12 20:25:15', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1690338707129987072, 1690338545284378624, 'GeneralTemplateState', 'enable', '启用', b'1', 0.00, '', 1414143554414059520, '2023-08-12 20:25:27', 1414143554414059520, '2023-08-12 20:25:27', 0, 0);
+INSERT INTO `base_dict_item` VALUES (1690338748032839680, 1690338545284378624, 'GeneralTemplateState', 'disable', '停用', b'1', 0.00, '', 1414143554414059520, '2023-08-12 20:25:37', 1414143554414059520, '2023-08-12 20:25:37', 0, 0);
-- ----------------------------
-- Table structure for base_dynamic_data_source
@@ -3560,6 +3589,33 @@ CREATE TABLE `base_dynamic_form` (
INSERT INTO `base_dynamic_form` VALUES (1552656018381422592, '测试表单', 'test', '{\"list\":[{\"type\":\"input\",\"label\":\"输入框\",\"options\":{\"type\":\"text\",\"width\":\"100%\",\"defaultValue\":\"\",\"placeholder\":\"请输入\",\"clearable\":true,\"maxLength\":null,\"addonBefore\":\"\",\"addonAfter\":\"\",\"hidden\":false,\"disabled\":false},\"model\":\"aa\",\"key\":\"input_1659059676533\",\"help\":\"测试\",\"rules\":[{\"required\":true,\"message\":\"必填项\"}]},{\"type\":\"textarea\",\"label\":\"文本框\",\"options\":{\"width\":\"100%\",\"minRows\":4,\"maxRows\":6,\"maxLength\":null,\"defaultValue\":\"\",\"clearable\":true,\"hidden\":false,\"disabled\":false,\"placeholder\":\"请输入\"},\"model\":\"bb\",\"key\":\"textarea_1659020414125\",\"help\":\"\",\"rules\":[{\"required\":true,\"message\":\"必填项\"}]},{\"type\":\"slider\",\"label\":\"滑动输入条\",\"options\":{\"width\":\"100%\",\"defaultValue\":34,\"disabled\":false,\"hidden\":false,\"min\":0,\"max\":100,\"step\":1,\"showInput\":false},\"model\":\"cc\",\"key\":\"slider_1659020433092\",\"help\":\"\",\"rules\":[{\"required\":false,\"message\":\"必填项\"}]}],\"config\":{\"layout\":\"horizontal\",\"labelCol\":{\"xs\":4,\"sm\":4,\"md\":4,\"lg\":4,\"xl\":4,\"xxl\":4},\"labelWidth\":100,\"labelLayout\":\"flex\",\"wrapperCol\":{\"xs\":18,\"sm\":18,\"md\":18,\"lg\":18,\"xl\":18,\"xxl\":18},\"hideRequiredMark\":false,\"customStyle\":\"\"}}', '测试动态表单', 1399985191002447872, '2022-07-28 22:03:36', 1399985191002447872, '2022-07-29 09:55:22', 0, 7);
INSERT INTO `base_dynamic_form` VALUES (1552656018381422593, '测试表单1', 'test1', '{\"list\":[{\"type\":\"input\",\"label\":\"申请人\",\"options\":{\"type\":\"text\",\"width\":\"100%\",\"defaultValue\":\"\",\"placeholder\":\"请输入\",\"clearable\":true,\"maxLength\":null,\"addonBefore\":\"\",\"addonAfter\":\"\",\"hidden\":false,\"disabled\":false},\"model\":\"apply_by\",\"key\":\"input_1659059676533\",\"help\":\"测试\",\"rules\":[{\"required\":true,\"message\":\"必填项\"}]},{\"type\":\"input\",\"label\":\"请假天数\",\"options\":{\"type\":\"text\",\"width\":\"100%\",\"defaultValue\":\"\",\"placeholder\":\"请输入\",\"clearable\":false,\"maxLength\":null,\"addonBefore\":\"\",\"addonAfter\":\"\",\"hidden\":false,\"disabled\":false},\"model\":\"leave_days\",\"key\":\"input_1662106166142\",\"help\":\"\",\"rules\":[{\"required\":false,\"message\":\"必填项\"}]},{\"type\":\"textarea\",\"label\":\"备注\",\"options\":{\"width\":\"100%\",\"minRows\":4,\"maxRows\":6,\"maxLength\":null,\"defaultValue\":\"\",\"clearable\":true,\"hidden\":false,\"disabled\":false,\"placeholder\":\"请输入\"},\"model\":\"remark\",\"key\":\"textarea_1659020414125\",\"help\":\"\",\"rules\":[{\"required\":true,\"message\":\"必填项\"}]},{\"type\":\"switch\",\"label\":\"开关\",\"options\":{\"defaultValue\":false,\"hidden\":false,\"disabled\":false},\"model\":\"switch_1662108221389\",\"key\":\"switch_1662108221389\",\"help\":\"\",\"rules\":[{\"required\":false,\"message\":\"必填项\"}]},{\"type\":\"slider\",\"label\":\"滑动输入条\",\"options\":{\"width\":\"100%\",\"defaultValue\":34,\"disabled\":false,\"hidden\":false,\"min\":0,\"max\":100,\"step\":1,\"showInput\":false},\"model\":\"cc\",\"key\":\"slider_1659020433092\",\"help\":\"\",\"rules\":[{\"required\":false,\"message\":\"必填项\"}]},{\"type\":\"table\",\"label\":\"表格布局\",\"trs\":[{\"tds\":[{\"colspan\":1,\"rowspan\":1,\"list\":[]},{\"colspan\":1,\"rowspan\":1,\"list\":[]}]},{\"tds\":[{\"colspan\":1,\"rowspan\":1,\"list\":[{\"type\":\"editor\",\"label\":\"富文本\",\"icon\":\"icon-LC_icon_edit_line_1\",\"list\":[],\"options\":{\"height\":300,\"placeholder\":\"请输入\",\"defaultValue\":\"\",\"chinesization\":true,\"hidden\":false,\"disabled\":false,\"showLabel\":false,\"width\":\"100%\"},\"model\":\"editor_1662106288134\",\"key\":\"editor_1662106288134\",\"help\":\"\",\"rules\":[{\"required\":false,\"message\":\"必填项\"}]}]},{\"colspan\":1,\"rowspan\":1,\"list\":[]}]}],\"options\":{\"width\":\"100%\",\"bordered\":true,\"bright\":false,\"small\":true,\"customStyle\":\"\"},\"key\":\"table_1662106283652\"}],\"config\":{\"layout\":\"vertical\",\"labelCol\":{\"xs\":6,\"sm\":6,\"md\":6,\"lg\":6,\"xl\":6,\"xxl\":6},\"labelWidth\":100,\"labelLayout\":\"Grid\",\"wrapperCol\":{\"xs\":18,\"sm\":18,\"md\":18,\"lg\":18,\"xl\":18,\"xxl\":18},\"hideRequiredMark\":false,\"customStyle\":\"\"}}', '测试动态表单', 1399985191002447872, '2022-07-28 22:03:36', 1414143554414059520, '2022-09-02 16:44:01', 0, 12);
+-- ----------------------------
+-- Table structure for base_general_template
+-- ----------------------------
+DROP TABLE IF EXISTS `base_general_template`;
+CREATE TABLE `base_general_template` (
+ `id` bigint(20) NOT NULL COMMENT '主键',
+ `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '模板名称',
+ `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '模板代码',
+ `use_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '使用类型(导入/导出)',
+ `file_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '模板类型',
+ `file_suffix` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '模板后缀名',
+ `state` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '状态',
+ `file_id` bigint(20) NULL DEFAULT NULL COMMENT '文件ID',
+ `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '备注',
+ `creator` bigint(20) NULL DEFAULT NULL COMMENT '创建者ID',
+ `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+ `last_modifier` bigint(20) NULL DEFAULT NULL COMMENT '最后修者ID',
+ `last_modified_time` datetime NULL DEFAULT NULL COMMENT '最后修改时间',
+ `version` int(11) NOT NULL COMMENT '乐观锁',
+ `deleted` bit(1) NOT NULL COMMENT '删除标志',
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '通用模板管理' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of base_general_template
+-- ----------------------------
+
-- ----------------------------
-- Table structure for base_key_value
-- ----------------------------
@@ -3607,11 +3663,10 @@ CREATE TABLE `base_param` (
-- Records of base_param
-- ----------------------------
INSERT INTO `base_param` VALUES (1452842684284891136, '测试', 'test.v1', '123', 1, b'1', b'0', NULL, 1399985191002447872, '2021-10-26 11:41:03', 1399985191002447872, '2021-10-26 11:41:03', 0, 0);
-INSERT INTO `base_param` VALUES (1500338438182789120, '结算台聚合支付请求地址', 'CashierAggregateUrl', 'http://127.0.0.1/api/', 1, b'1', b'1', '', 1399985191002447872, '2022-03-06 13:12:13', 1399985191002447872, '2022-05-01 15:03:03', 0, 3);
INSERT INTO `base_param` VALUES (1520668030248361984, '文件服务器地址', 'FileServerUrl', 'http://127.0.0.1:9999', 1, b'1', b'1', '', 1399985191002447872, '2022-05-01 15:34:46', 1399985191002447872, '2022-05-19 12:53:21', 0, 5);
INSERT INTO `base_param` VALUES (1529281530059161600, 'websocket服务器地址', 'WebsocketServerUrl', 'ws://127.0.0.1:9999', 1, b'1', b'1', '', 1399985191002447872, '2022-05-25 10:01:44', 1399985191002447872, '2022-05-25 10:01:44', 0, 0);
INSERT INTO `base_param` VALUES (1545765299880448000, '服务器地址', 'ServerUrl', 'http://127.0.0.1:9999', 1, b'1', b'1', '优先级高于配置文件内进行的配置', 1399985191002447872, '2022-07-09 21:42:21', 1414143554414059520, '2023-08-05 16:40:05', 0, 1);
-INSERT INTO `base_param` VALUES (1547511252795912192, '微信jsapi支付回调服务地址', 'JsapiRedirectUrl', 'http://127.0.0.1/api/', 1, b'1', b'1', '', 1414143554414059520, '2022-07-14 17:20:09', 1414143554414059520, '2022-07-14 17:20:09', 0, 0);
+INSERT INTO `base_param` VALUES (1547511252795912192, '微信jsapi支付回调服务地址', 'JsapiRedirectUrl', 'http://127.0.0.1/api/', 1, b'1', b'1', '用于微信扫码登录使用', 1414143554414059520, '2022-07-14 17:20:09', 1414143554414059520, '2023-08-18 15:49:21', 0, 1);
-- ----------------------------
-- Table structure for base_province
@@ -3863,7 +3918,7 @@ CREATE TABLE `iam_client` (
`last_modifier` bigint(20) NULL DEFAULT NULL COMMENT '最后修者ID',
`last_modified_time` datetime NULL DEFAULT NULL COMMENT '最后修改时间',
`version` int(11) NOT NULL COMMENT '乐观锁',
- `deleted` bit(1) NOT NULL DEFAULT 0 COMMENT '删除标志',
+ `deleted` bit(1) NOT NULL COMMENT '删除标志',
`default_endow` bit(1) NULL DEFAULT NULL COMMENT '新注册的用户是否默认赋予该终端',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '认证终端' ROW_FORMAT = DYNAMIC;
@@ -4145,7 +4200,7 @@ INSERT INTO `iam_perm_menu` VALUES (1582302180999917568, 'adminv3', 158224992460
INSERT INTO `iam_perm_menu` VALUES (1582302542955769856, 'adminv3', 1582253011803262976, '用户管理', 'UserList', NULL, b'0', '', b'0', b'0', '/modules/system/user/UserList.vue', NULL, '/system/user/info', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-18 17:28:19', 1414143554414059520, '2022-10-18 17:28:19', 0, 0);
INSERT INTO `iam_perm_menu` VALUES (1582302764129808384, 'adminv3', 1582253011803262976, '部门管理', 'DeptList', NULL, b'0', '', b'0', b'0', '/modules/system/dept/DeptList.vue', NULL, '/system/user/dept', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-18 17:29:11', 1414143554414059520, '2022-10-18 17:32:26', 1, 0);
INSERT INTO `iam_perm_menu` VALUES (1582303143110340608, 'adminv3', 1582253152903843840, '数据字典', 'DictList', NULL, b'0', '', b'0', b'0', '/modules/system/dict/DictList.vue', NULL, '/system/config/dict', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-18 17:30:42', 1414143554414059520, '2022-10-18 17:30:42', 0, 0);
-INSERT INTO `iam_perm_menu` VALUES (1582303290070364160, 'adminv3', 1582253152903843840, '定时任务', 'QuartzJobList', NULL, b'0', '', b'0', b'0', '/modules/system/quartz/QuartzJobList.vue', NULL, '/system/config/quartz', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-18 17:31:17', 1414143554414059520, '2022-10-18 17:32:12', 1, 0);
+INSERT INTO `iam_perm_menu` VALUES (1582303290070364160, 'adminv3', 1582253152903843840, '定时任务', 'QuartzJobList', NULL, b'0', '', b'0', b'0', '/modules/baseapi/quartz/QuartzJobList.vue', NULL, '/system/config/quartz', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-18 17:31:17', 1414143554414059520, '2023-08-09 15:50:46', 2, 0);
INSERT INTO `iam_perm_menu` VALUES (1582303447428067328, 'adminv3', 1582253152903843840, '系统参数', 'SystemParamList', NULL, b'0', '', b'0', b'0', '/modules/system/param/SystemParamList.vue', NULL, '/system/config/param', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-18 17:31:54', 1414143554414059520, '2022-10-19 23:14:16', 1, 0);
INSERT INTO `iam_perm_menu` VALUES (1582632873244172288, 'adminv3', 1582276341792985088, '文件管理', 'FileUploadList', NULL, b'0', '', b'0', b'0', '/modules/develop/file/FileUploadList.vue', NULL, '/develop/file', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-19 15:20:56', 1414143554414059520, '2022-10-19 15:20:56', 0, 0);
INSERT INTO `iam_perm_menu` VALUES (1582633196587261952, 'adminv3', 1582276341792985088, '代码生成', 'CodeGenList', NULL, b'0', '', b'0', b'0', '/modules/develop/codegen/CodeGenList.vue', NULL, '/develop/codegen', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-19 15:22:13', 1414143554414059520, '2022-10-19 15:23:17', 1, 0);
@@ -4156,7 +4211,7 @@ INSERT INTO `iam_perm_menu` VALUES (1583075229563068416, 'adminv3', 158227587542
INSERT INTO `iam_perm_menu` VALUES (1583076217481043968, 'adminv3', 1583075229563068416, '登录日志', 'LoginLogList', NULL, b'0', '', b'0', b'0', '/modules/monitor/login/LoginLogList.vue', NULL, '/monitor/log/login', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-20 20:42:37', 1414143554414059520, '2022-10-20 20:43:36', 1, 0);
INSERT INTO `iam_perm_menu` VALUES (1583076424935514112, 'adminv3', 1583075229563068416, '操作日志', 'OperateLogList', NULL, b'0', '', b'0', b'0', '/modules/monitor/operate/OperateLogList.vue', NULL, '/monitor/log/operate', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-20 20:43:26', 1414143554414059520, '2022-10-20 20:43:26', 0, 0);
INSERT INTO `iam_perm_menu` VALUES (1583076670881112064, 'adminv3', 1583075229563068416, '数据版本日志', 'DataVersionLogList', NULL, b'0', '', b'0', b'0', '/modules/monitor/data/DataVersionLogList.vue', NULL, '/monitor/log/data', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-20 20:44:25', 1414143554414059520, '2022-10-20 20:44:25', 0, 0);
-INSERT INTO `iam_perm_menu` VALUES (1583076878956339200, 'adminv3', 1582275875424129024, 'ELK日志', 'ELK', NULL, b'0', '', b'0', b'0', '', NULL, 'http://elk.dev.bootx.cn:5601/app/discover', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-20 20:45:15', 1414143554414059520, '2022-11-21 15:04:13', 2, 0);
+INSERT INTO `iam_perm_menu` VALUES (1583076878956339200, 'adminv3', 1582275875424129024, 'ELK日志', 'ELK', NULL, b'0', '', b'1', b'0', '', NULL, 'http://elk.dev.bootx.cn:5601/app/discover', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-20 20:45:15', 1414143554414059520, '2023-08-12 19:26:12', 3, 0);
INSERT INTO `iam_perm_menu` VALUES (1583077015434797056, 'adminv3', 1582275875424129024, 'PlumeLog日志', 'PlumeLog', NULL, b'0', '', b'0', b'0', '', NULL, 'http://127.0.0.1:9999/plumelog/#/', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-20 20:45:47', 1414143554414059520, '2022-10-20 20:45:47', 0, 0);
INSERT INTO `iam_perm_menu` VALUES (1583077198772019200, 'adminv3', 1582275875424129024, '系统信息', 'SystemInfoMonitor', NULL, b'0', '', b'0', b'0', '/modules/monitor/system/SystemInfoMonitor.vue', NULL, '/monitor/sysinfo', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-20 20:46:31', 1414143554414059520, '2022-10-20 20:46:31', 0, 0);
INSERT INTO `iam_perm_menu` VALUES (1583077360827342848, 'adminv3', 1582275875424129024, 'Redis监控', 'RedisInfoMonitor', NULL, b'0', '', b'0', b'0', '/modules/monitor/redis/RedisInfoMonitor.vue', NULL, '/monitor/redis', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-20 20:47:10', 1414143554414059520, '2022-10-20 20:47:10', 0, 0);
@@ -4193,6 +4248,8 @@ INSERT INTO `iam_perm_menu` VALUES (1635274568758435840, 'adminv3', 158227634179
INSERT INTO `iam_perm_menu` VALUES (1687369862646558720, 'adminv3', 1582275984849326080, '短信管理', 'Sms', NULL, b'0', '', b'0', b'0', 'Layout', NULL, '/notice/sms', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-08-04 15:48:20', 1414143554414059520, '2023-08-04 15:48:32', 1, 0);
INSERT INTO `iam_perm_menu` VALUES (1687370142234669056, 'adminv3', 1687369862646558720, '短信配置', 'SmsChannelConfigList', NULL, b'0', '', b'0', b'0', '/modules/notice/sms/config/SmsChannelConfigList', NULL, '/notice/sms/config', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-08-04 15:49:26', 1414143554414059520, '2023-08-04 15:49:26', 0, 0);
INSERT INTO `iam_perm_menu` VALUES (1687370277496778752, 'adminv3', 1687369862646558720, '短信模板', 'SmsTemplateList', NULL, b'0', '', b'0', b'0', '/modules/notice/sms/template/SmsTemplateList', NULL, '/notice/sms/template', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-08-04 15:49:59', 1414143554414059520, '2023-08-04 15:50:38', 1, 0);
+INSERT INTO `iam_perm_menu` VALUES (1689181991598997504, 'adminv3', 1582253152903843840, '敏感词管理', 'ChinaWord', NULL, b'0', '', b'0', b'0', '/modules/baseapi/chianword/ChinaWordList.vue', NULL, '/system/config/chinaword', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-08-09 15:49:05', 1414143554414059520, '2023-08-09 15:49:05', 0, 0);
+INSERT INTO `iam_perm_menu` VALUES (1690324070514782208, 'adminv3', 1582276341792985088, '通用模板', 'GeneralTemplateList', NULL, b'0', '', b'0', b'0', '/modules/develop/template/GeneralTemplateList', NULL, '/develop/template', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-08-12 19:27:18', 1414143554414059520, '2023-08-12 19:31:26', 3, 0);
-- ----------------------------
-- Table structure for iam_perm_path
@@ -4345,8 +4402,8 @@ CREATE TABLE `iam_user_expand_info` (
-- ----------------------------
-- Records of iam_user_expand_info
-- ----------------------------
-INSERT INTO `iam_user_expand_info` VALUES (1399985191002447872, 1, '1996-12-01', '1495331905770315776', '2022-10-29 08:44:52', '2022-11-02 09:59:06', b'0', '2022-06-19 21:25:00', 1, '2021-06-02 15:04:15', 0, '2022-11-02 09:59:06', 367, 0);
-INSERT INTO `iam_user_expand_info` VALUES (1414143554414059520, 1, '2022-10-31', '1586953599627546624', '2022-11-02 21:32:23', '2022-11-02 21:33:21', b'0', NULL, 1, '2021-07-11 16:44:32', 0, '2022-11-02 21:33:21', 62, 0);
+INSERT INTO `iam_user_expand_info` VALUES (1399985191002447872, 1, '1996-12-01', '1495331905770315776', '2022-11-02 09:59:06', '2023-08-21 13:24:32', b'0', '2022-06-19 21:25:00', 1, '2021-06-02 15:04:15', 0, '2023-08-21 13:24:32', 368, 0);
+INSERT INTO `iam_user_expand_info` VALUES (1414143554414059520, 1, '2022-10-31', '1586953599627546624', '2023-08-21 13:06:47', '2023-08-21 13:23:26', b'0', NULL, 1, '2021-07-11 16:44:32', 0, '2023-08-21 13:23:26', 66, 0);
INSERT INTO `iam_user_expand_info` VALUES (1435894470432456704, 1, NULL, NULL, '2022-09-16 16:48:16', '2022-09-17 17:20:58', b'0', '2022-06-29 00:39:23', 1399985191002447872, '2021-09-09 17:14:54', 0, '2022-09-17 17:20:58', 5, 0);
INSERT INTO `iam_user_expand_info` VALUES (1435967884114194432, 1, NULL, NULL, NULL, '2022-05-31 15:59:42', b'0', NULL, 1414143554414059520, '2021-09-09 22:06:37', 0, '2022-05-31 15:59:42', 1, 0);
INSERT INTO `iam_user_expand_info` VALUES (1477990832987361280, 1, NULL, NULL, NULL, NULL, b'0', NULL, 1399985191002447872, '2022-01-03 21:10:49', 1399985191002447872, '2022-01-03 21:10:49', 0, 0);
@@ -4433,6 +4490,7 @@ CREATE TABLE `iam_user_third` (
-- ----------------------------
-- Records of iam_user_third
-- ----------------------------
+INSERT INTO `iam_user_third` VALUES (1693285779222376448, 1414143554414059520, 'oAAyF68eYHdvi3lc_XGGDpzE7EWM', NULL, NULL, NULL, NULL, NULL, NULL, 1414143554414059520, '2023-08-20 23:36:04', 1414143554414059520, '2023-08-20 23:46:17', 1, 0);
-- ----------------------------
-- Table structure for iam_user_third_info
@@ -4455,10 +4513,6 @@ CREATE TABLE `iam_user_third_info` (
INDEX `pk_user_client`(`user_id`, `client_code`) USING BTREE COMMENT '用户id和终端code'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '用户三方登录绑定详情' ROW_FORMAT = DYNAMIC;
--- ----------------------------
--- Records of iam_user_third_info
--- ----------------------------
-
-- ----------------------------
-- Table structure for notice_mail_config
-- ----------------------------
@@ -4797,9 +4851,6 @@ CREATE TABLE `qrtz_locks` (
PRIMARY KEY (`SCHED_NAME`, `LOCK_NAME`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
--- ----------------------------
--- Records of qrtz_locks
--- ----------------------------
-- ----------------------------
-- Table structure for qrtz_paused_trigger_grps
@@ -5006,9 +5057,6 @@ CREATE TABLE `starter_audit_login_log` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '登陆日志' ROW_FORMAT = DYNAMIC;
--- ----------------------------
--- Records of starter_audit_login_log
--- ----------------------------
-- ----------------------------
-- Table structure for starter_audit_operate_log
@@ -5086,7 +5134,7 @@ DROP TABLE IF EXISTS `starter_file_data`;
CREATE TABLE `starter_file_data` (
`id` bigint(20) NOT NULL COMMENT '主键',
`base64` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT 'base64方式存储',
- `data` longblob NULL COMMENT 'base64方式存储',
+ `data` longblob NULL COMMENT '数据方式存储',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '上传文件数据' ROW_FORMAT = DYNAMIC;
diff --git a/_doc/ChangeLog.md b/_doc/ChangeLog.md
index 051a20f34e1b64a71644cd5758f54a449a29842f..15c460e5535c6163274c231a2194c44205bce9f2 100644
--- a/_doc/ChangeLog.md
+++ b/_doc/ChangeLog.md
@@ -1,4 +1,17 @@
# CHANGELOG
+
+## [v1.3.4] 一号线-园博园
+- 新增: 通用导入组件
+- 新增: 小程序端脚手架
+- 新增: 小程序后端对接相关配置
+- 新增: 敏感字管理和过滤功能
+- 新增: 适配腾讯云cos文件存储上传
+- 优化: 优化几种MP的类型转换器类
+- 优化: 用户批量重置密码
+- 优化: 代码生成模板添加批量操作相关
+- 优化: 支持IpV6地址的记录
+- 优化: Dockerfile相关配置
+- fix: 修复无法查看站内信的问题
## [v1.3.3] 一号线-园博园
- 新增: 添加短信配置, 集成SMS4J, 支持分渠道配置
- 新增: 新版自定义表单集成(epic-designer尚处于测试版)
diff --git a/_doc/Task.md b/_doc/Task.md
index a2f67693dee0bf9641da098c92c1ee1ad4b30a35..ccb86be2880e5fa8b95bf19e12bcfe90077db3c5 100644
--- a/_doc/Task.md
+++ b/_doc/Task.md
@@ -1,10 +1,22 @@
## 1.3.4
-- MiniApp添加用户协议/隐私协议等(富文本)
+- x 通用导入组件
+ - x 支持自定义模板下载
+ - x 模板管理
+ - x 支持自定义上传到的地址
+ - x 导入数据支持选择: 跳过, 覆盖, 报错
+- x 小程序用户反馈功能
+- x 敏感字功能
+- x 用户批量重置密码
+- x 代码生成模板添加批量操作相关
+- x 支持IpV6地址的记录
+- 参数配置支持只允许后端访问
+- 键值对管理增加可视化界面管理
+## 1.3.5
+- 审计日志增加定时删除和一键清除超期日志功能
+- 文件管理支持配置所属上传类型、是否被使用过、是否登陆后才可以访问
+## 1.3.x、1.4.x
- 小程序工单功能
- 小程序日报功能
-- 小程序用户反馈功能
-- 敏感字功能
-## 1.3.x
- PostgreSQL 数据库适配
- 添加短信模板功能, 可以与各短信商渠道进行同步
- 优化异常类,将各种异常类进行拆分出来
@@ -12,11 +24,16 @@
- 代码生成模板支持配置
- 代码生成支持预览
- Sql查询功能
+- SQL查询片段升级为数据集
- 支持预览编辑完成的富文本
- 添加配置备份功能(菜单/系统参数/字典), csv方式
-- 添加各种导入和导出功能
-- 导入数据支持选择: 跳过, 覆盖, 报错
- 添加各种批量操作功能
- 一键缓存同步和更新操作(字典/参数)
- 加密模块支持主键加密
- Knife4j移植官方basic认证功能
+- 多次输错密码自动锁定功能
+- 密码多少天必须更改,且不能与前N次相同功能
+- 对上传的文件管理还需要完善, 例如改文件是否还被使用, 上传场景是什么样的一类
+- 前端首页分析页面需要重做,接入真实数据
+- 可视化大屏端支持一键登录
+- 可视化大屏支持快速对接数据集
diff --git a/bootx-common-core/pom.xml b/bootx-common-core/pom.xml
index 7afde8dba90ac513c287c16b07448a82be8026ff..c7d19e9f90553c1a4094450e9489a49715d8a0fc 100644
--- a/bootx-common-core/pom.xml
+++ b/bootx-common-core/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-platform-parent
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-common-core/src/main/java/cn/bootx/platform/common/core/annotation/IgnoreAuth.java b/bootx-common-core/src/main/java/cn/bootx/platform/common/core/annotation/IgnoreAuth.java
index f47b1c740ffdb477ee42a3c359c27e8daa105baf..604e60037c2b6e71119ed71d143ae51a9fdc3265 100644
--- a/bootx-common-core/src/main/java/cn/bootx/platform/common/core/annotation/IgnoreAuth.java
+++ b/bootx-common-core/src/main/java/cn/bootx/platform/common/core/annotation/IgnoreAuth.java
@@ -23,4 +23,5 @@ public @interface IgnoreAuth {
*/
boolean login() default false;
+
}
diff --git a/bootx-common-core/src/main/java/cn/bootx/platform/common/core/annotation/PermCode.java b/bootx-common-core/src/main/java/cn/bootx/platform/common/core/annotation/PermCode.java
index ac9d10271e934069f81ba209812220b8272f4526..9df640d1af2f531c9faa7a1e350552f4bea700d4 100644
--- a/bootx-common-core/src/main/java/cn/bootx/platform/common/core/annotation/PermCode.java
+++ b/bootx-common-core/src/main/java/cn/bootx/platform/common/core/annotation/PermCode.java
@@ -3,8 +3,9 @@ package cn.bootx.platform.common.core.annotation;
import java.lang.annotation.*;
/**
- * 权限码鉴权注解 1. 用在Controller及对应的请求方法上时,可以通过用户是否拥有该请求路径的权限码,来决定是否可以通行本次请求 2.
- * 放在数据库实体类及字段上时,会在启用查询字段权限的时候,对用户没有权限码的字段不进行SQL查询
+ * 权限码鉴权注解
+ * 1. 用在Controller及对应的请求方法上时,可以通过用户是否拥有该请求路径的权限码,来决定是否可以通行本次请求
+ * 2.放在数据库实体类及字段上时,会在启用查询字段权限的时候,对用户没有权限码的字段不进行SQL查询
*
* @author xxm
* @since 2023/1/22
diff --git a/bootx-common-core/src/main/java/cn/bootx/platform/common/core/function/ParamService.java b/bootx-common-core/src/main/java/cn/bootx/platform/common/core/function/ParamService.java
index b72ea2c96d3e88f40be1d66512a68b13addd17c4..c88e12361fb6c7f88fd1878440ce102cd0187242 100644
--- a/bootx-common-core/src/main/java/cn/bootx/platform/common/core/function/ParamService.java
+++ b/bootx-common-core/src/main/java/cn/bootx/platform/common/core/function/ParamService.java
@@ -9,7 +9,7 @@ package cn.bootx.platform.common.core.function;
public interface ParamService {
/**
- * 获取 参数值
+ * 获取 参数值, 如果未启用, 返回空
*/
String getValue(String key);
diff --git a/bootx-common-core/src/main/java/cn/bootx/platform/common/core/function/SystemKeyValueService.java b/bootx-common-core/src/main/java/cn/bootx/platform/common/core/function/SystemKeyValueService.java
index 293c259575f50d56d5d226eb8b162c62a2d22ab2..ea90fa123ce846647034b729b057744020d23136 100644
--- a/bootx-common-core/src/main/java/cn/bootx/platform/common/core/function/SystemKeyValueService.java
+++ b/bootx-common-core/src/main/java/cn/bootx/platform/common/core/function/SystemKeyValueService.java
@@ -23,12 +23,12 @@ public interface SystemKeyValueService {
List gets(List keys);
/**
- * 设置值
+ * 设置值, 如果key不存在将会创建,key存在则会更新
*/
void setup(String key, String value);
/**
- * 设置多个
+ * 保存多个值
*/
void setupBatch(List list);
diff --git a/bootx-common-starters/common-starter-audit-log/pom.xml b/bootx-common-starters/common-starter-audit-log/pom.xml
index 21233564a31d1fe4b757dc103452839799d9fa0b..8ad0fff3acf8d789c468287c0b6a26d061d4bfe1 100644
--- a/bootx-common-starters/common-starter-audit-log/pom.xml
+++ b/bootx-common-starters/common-starter-audit-log/pom.xml
@@ -5,7 +5,7 @@
bootx-common-starters
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-common-starters/common-starter-audit-log/src/main/java/cn/bootx/platform/starter/audit/log/ip2region/IpToRegionService.java b/bootx-common-starters/common-starter-audit-log/src/main/java/cn/bootx/platform/starter/audit/log/ip2region/IpToRegionService.java
index e05437992305e22e49450dcc3c13707275046f64..4cb65b7b7c1d3d93eb167f5a34c700dbec9deda7 100644
--- a/bootx-common-starters/common-starter-audit-log/src/main/java/cn/bootx/platform/starter/audit/log/ip2region/IpToRegionService.java
+++ b/bootx-common-starters/common-starter-audit-log/src/main/java/cn/bootx/platform/starter/audit/log/ip2region/IpToRegionService.java
@@ -79,8 +79,15 @@ public class IpToRegionService {
public IpRegion getRegionByIp(String ip){
// 判断IP是否合法
Matcher matcher = PatternPool.IPV4.matcher(ip);
+ Matcher ipV6Matcher =PatternPool.IPV6.matcher(ip);
if (!matcher.matches()) {
- log.warn("非法IPv4地址: {}",ip);
+ if (ipV6Matcher.matches()){
+ log.warn("IpV6地址: {}",ip);
+
+ }else {
+ log.warn("非法IPv4地址: {}",ip);
+
+ }
return null;
}
diff --git a/bootx-common-starters/common-starter-auth/pom.xml b/bootx-common-starters/common-starter-auth/pom.xml
index f408f0d87372949b6ec235cb9064a11d203e6302..fb3d8761186726615d956d6089fff7f715babbaf 100644
--- a/bootx-common-starters/common-starter-auth/pom.xml
+++ b/bootx-common-starters/common-starter-auth/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-common-starters
- 1.3.3
+ 1.3.4
4.0.0
common-starter-auth
diff --git a/bootx-common-starters/common-starter-auth/src/main/java/cn/bootx/platform/starter/auth/code/AuthLoginTypeCode.java b/bootx-common-starters/common-starter-auth/src/main/java/cn/bootx/platform/starter/auth/code/AuthLoginTypeCode.java
index 2fa7aec9ea056c6f1d8228265aa0597d13fcde54..328693bc70de8d2be8f631907d1bc6a3bd1fda2d 100644
--- a/bootx-common-starters/common-starter-auth/src/main/java/cn/bootx/platform/starter/auth/code/AuthLoginTypeCode.java
+++ b/bootx-common-starters/common-starter-auth/src/main/java/cn/bootx/platform/starter/auth/code/AuthLoginTypeCode.java
@@ -33,6 +33,10 @@ public interface AuthLoginTypeCode {
/** 微信登录(公众号) */
String WE_CHAT = "weChat";
+
+ /** 微信登录(小程序) */
+ String WE_CHAT_APPLET = "weChatApplet";
+
/** 微信登录(开放平台) */
String WE_CHAT_OPEN = "weChatOpen";
diff --git a/bootx-common-starters/common-starter-code-gen/pom.xml b/bootx-common-starters/common-starter-code-gen/pom.xml
index 7a72e9f36b217ecf32d57e88cab585bb7bbfe1e3..77f4bb09b61502955c2499c67db0b0bd69e124a8 100644
--- a/bootx-common-starters/common-starter-code-gen/pom.xml
+++ b/bootx-common-starters/common-starter-code-gen/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-common-starters
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-common-starters/common-starter-code-gen/src/main/java/cn/bootx/platform/starter/code/gen/code/CodeGenTemplateVmEnum.java b/bootx-common-starters/common-starter-code-gen/src/main/java/cn/bootx/platform/starter/code/gen/code/CodeGenTemplateVmEnum.java
index bf50054f8f011c74c2d66e4983c6c7a160870ffa..5cd52a82d315014edf0663d18e15a7731c7afcb5 100644
--- a/bootx-common-starters/common-starter-code-gen/src/main/java/cn/bootx/platform/starter/code/gen/code/CodeGenTemplateVmEnum.java
+++ b/bootx-common-starters/common-starter-code-gen/src/main/java/cn/bootx/platform/starter/code/gen/code/CodeGenTemplateVmEnum.java
@@ -25,9 +25,6 @@ public enum CodeGenTemplateVmEnum {
DTO("dto", "codegen/template/java/dto.java.vm", "Dto.java"),
PARAM("param", "codegen/template/java/param.java.vm", "Param.java"),
CONVERT("convert", "codegen/template/java/convert.java.vm", "Convert.java"),
- API_V2("api_v2", "codegen/template/vue2/api.js.vm", ".js"),
- LIST_V2("list_v2", "codegen/template/vue2/list.vue.vm", "List.vue"),
- EDIT_V2("edit_v2", "codegen/template/vue2/edit.vue.vm", "Edit.vue"),
API_V3("api_v3", "codegen/template/vue3/api.ts.vm", ".api.ts"),
LIST_V3("list_v3", "codegen/template/vue3/list.vue.vm", "List.vue"),
EDIT_V3("edit_v3", "codegen/template/vue3/edit.vue.vm", "Edit.vue");
diff --git a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/controller.java.vm b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/controller.java.vm
index fad161c6eef4af44554b9e4afa1a65d40904a1ff..5f2aec471b3c5fcb29c79aaaea0dcea4e6aa2655 100644
--- a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/controller.java.vm
+++ b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/controller.java.vm
@@ -47,6 +47,13 @@ public class ${entityUpName}Controller {
return Res.ok();
}
+ @Operation(summary = "批量删除")
+ @DeleteMapping("/deleteBatch")
+ public ResResult deleteBatch(@RequestBody List ids) {
+ ${entityLowName}Service.deleteBatch(ids);
+ return Res.ok();
+ }
+
@Operation( summary = "通过ID查询")
@GetMapping(value = "/findById")
public ResResult<${entityUpName}Dto> findById(Long id){
@@ -61,7 +68,7 @@ public class ${entityUpName}Controller {
@Operation( summary = "分页查询")
@GetMapping(value = "/page")
- public ResResult> page(PageParam pageParam, ${entityUpName}Param ${entityLowName}Param){
- return Res.ok(${entityLowName}Service.page(pageParam,${entityLowName}Param));
+ public ResResult> page(PageParam pageParam, ${entityUpName}Param query){
+ return Res.ok(${entityLowName}Service.page(pageParam,query));
}
}
diff --git a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/param.java.vm b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/param.java.vm
index ddae2982cb97bb1dde696ed80a352dff5af2ce0f..6a294adfe2c849afbc373042cf5c93db27fc2aa5 100644
--- a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/param.java.vm
+++ b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/param.java.vm
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDate;
+import cn.bootx.platform.common.core.annotation.QueryParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
@@ -13,6 +14,7 @@ import lombok.experimental.Accessors;
* @author ${author}
* @since ${datetime}
*/
+@QueryParam(type = QueryParam.CompareTypeEnum.LIKE)
@Data
@Schema(title = "${comments}")
@Accessors(chain = true)
diff --git a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/service.java.vm b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/service.java.vm
index 23d54eb064f27f4028591a8b1a8dd52e7b96812f..69dd1772531618396f5e27ea2cc8cafbad02ed8a 100644
--- a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/service.java.vm
+++ b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/java/service.java.vm
@@ -49,8 +49,8 @@ public class ${entityUpName}Service {
/**
* 分页
*/
- public PageResult<${entityUpName}Dto> page(PageParam pageParam,${entityUpName}Param ${entityLowName}Param){
- return MpUtil.convert2DtoPageResult(${entityLowName}Manager.page(pageParam,${entityLowName}Param));
+ public PageResult<${entityUpName}Dto> page(PageParam pageParam,${entityUpName}Param query){
+ return MpUtil.convert2DtoPageResult(${entityLowName}Manager.page(pageParam,query));
}
/**
@@ -73,4 +73,12 @@ public class ${entityUpName}Service {
public void delete(Long id){
${entityLowName}Manager.deleteById(id);
}
+
+
+ /**
+ * 批量删除
+ */
+ public void deleteBatch(List ids){
+ ${entityLowName}Manager.deleteByIds(ids);
+ }
}
diff --git a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue2/api.js.vm b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue2/api.js.vm
deleted file mode 100644
index 5d7e008bef07a0f28657acd13992d173b0499b13..0000000000000000000000000000000000000000
--- a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue2/api.js.vm
+++ /dev/null
@@ -1,66 +0,0 @@
-import { axios } from '@/utils/request'
-
-/**
- * 分页
- */
-export function page (params) {
- return axios({
- url: '${requestPath}/page',
- method: 'GET',
- params: params
- })
-}
-
-/**
- * 查询全部
- */
-export function list () {
- return axios({
- url: '${requestPath}/findAll',
- method: 'GET'
- })
-}
-
-/**
- * 获取单条
- */
-export function get (id) {
- return axios({
- url: '${requestPath}/findById',
- method: 'GET',
- params: { id }
- })
-}
-
-/**
- * 添加
- */
-export function add (obj) {
- return axios({
- url: '${requestPath}/add',
- method: 'POST',
- data: obj
- })
-}
-
-/**
- * 更新
- */
-export function update (obj) {
- return axios({
- url: '${requestPath}/update',
- method: 'POST',
- data: obj
- })
-}
-
-/**
- * 删除
- */
-export function del (id) {
- return axios({
- url: '${requestPath}/delete',
- params: { id },
- method: 'DELETE'
- })
-}
diff --git a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue2/edit.vue.vm b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue2/edit.vue.vm
deleted file mode 100644
index 146d022a5b863ccf8aec29df61fb98e030aeac4a..0000000000000000000000000000000000000000
--- a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue2/edit.vue.vm
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
-
-
-
-
- #foreach ($column in $columns)
-
-
-
- #end
-
-
-
- 取消
- 保存
-
-
-
-
-
-
-
diff --git a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue2/list.vue.vm b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue2/list.vue.vm
deleted file mode 100644
index 5039c8623df888fdb14e2a3ea7a3ae1635ba255c..0000000000000000000000000000000000000000
--- a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue2/list.vue.vm
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
- queryParam = {}"
- />
-
-
- 新建
-
-
-
-
- #foreach ($column in $columns)
-
- #end
-
-
-
-
- 查看
-
-
-
- 编辑
-
-
-
- 删除
-
-
-
-
-
- <${entityDashName}-edit
- ref="${entityLowName}Edit"
- @ok="handleOk"/>
-
-
-
-
-
-
diff --git a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue3/api.ts.vm b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue3/api.ts.vm
index 225f4b7d88e3ae7e8284f382fc7f7c425d8b80fe..880972f86a8de284d0a7cf8d646305cbfa656bc7 100644
--- a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue3/api.ts.vm
+++ b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue3/api.ts.vm
@@ -61,6 +61,16 @@ export function del(id) {
})
}
+/**
+ * 批量删除
+ */
+export function deleteBatch(ids) {
+ return defHttp.delete({
+ url: '${requestPath}/template/delete',
+ data: ids,
+ })
+}
+
/**
* ${comments}
*/
diff --git a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue3/list.vue.vm b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue3/list.vue.vm
index 9edcc2a4806a5b67c58281e84dd2b0c7cf6fdf02..2b9a671c5365ad20f208907aa56d9eb6163dfc7e 100644
--- a/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue3/list.vue.vm
+++ b/bootx-common-starters/common-starter-code-gen/src/main/resources/codegen/template/vue3/list.vue.vm
@@ -8,11 +8,28 @@
新建
+
+ 批量操作
+
+
+
+ 批量删除
+
+
+
+
-
-
+
+
#foreach ($column in $columns)
#end
@@ -56,7 +73,7 @@
diff --git a/bootx-common-starters/common-starter-data-perm/pom.xml b/bootx-common-starters/common-starter-data-perm/pom.xml
index 950a73b077c29ec1b6e1c850069404a8d5e2ef79..9d68ff76132e200babdaa11d556c1fa6e70b00ec 100644
--- a/bootx-common-starters/common-starter-data-perm/pom.xml
+++ b/bootx-common-starters/common-starter-data-perm/pom.xml
@@ -5,7 +5,7 @@
bootx-common-starters
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-common-starters/common-starter-dingtalk/pom.xml b/bootx-common-starters/common-starter-dingtalk/pom.xml
index 80cc29b92be944c398b0f9db16c54fefbb25db47..ba0a30627fea70d342a9d6221b605ca5f130f3c6 100644
--- a/bootx-common-starters/common-starter-dingtalk/pom.xml
+++ b/bootx-common-starters/common-starter-dingtalk/pom.xml
@@ -5,7 +5,7 @@
bootx-common-starters
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-common-starters/common-starter-file/pom.xml b/bootx-common-starters/common-starter-file/pom.xml
index 389749e83770a1206e7920aa0bd081bd758189b3..a914aabd61a9544e7fa6d52f0238d06787408d2a 100644
--- a/bootx-common-starters/common-starter-file/pom.xml
+++ b/bootx-common-starters/common-starter-file/pom.xml
@@ -5,7 +5,7 @@
bootx-common-starters
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
@@ -42,5 +42,15 @@
${minio.version}
true
+
+ com.qcloud
+ cos_api
+ 5.6.155
+
+
+ com.qcloud
+ cos-sts_api
+ 3.1.0
+
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/code/FileUploadTypeEnum.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/code/FileUploadTypeEnum.java
index 113361c5489c38d9846dd90ded8e4f783a297154..f2bebea42d8bc662e5006b47a8c3b279c1c18053 100644
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/code/FileUploadTypeEnum.java
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/code/FileUploadTypeEnum.java
@@ -17,6 +17,9 @@ public enum FileUploadTypeEnum {
/** minio存储 */
MINIO,
/** 阿里云 oss存储 */
- ALIYUN_OSS
+ ALIYUN_OSS,
+
+ /** 腾讯云 oss存储 */
+ TENCENT_OSS
}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/configuration/FileUploadProperties.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/configuration/FileUploadProperties.java
index 7e24f6268bbaec54678c40f53a8c8f33c77f1ab8..a7344761ec2992dbe92bc73706234bbe1ef3e2bc 100644
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/configuration/FileUploadProperties.java
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/configuration/FileUploadProperties.java
@@ -23,21 +23,36 @@ public class FileUploadProperties {
*/
private FileUploadTypeEnum uploadType = FileUploadTypeEnum.LOCAL;
- /** 服务器地址,优先级低于系统参数配置 */
+ /**
+ * 服务器地址,优先级低于系统参数配置
+ */
private String serverUrl = "http://127.0.0.1:9999";
- /** 本地存储 */
+ /**
+ * 本地存储
+ */
private Local local = new Local();
- /** 数据库存储 */
+ /**
+ * 数据库存储
+ */
private JDBC jdbc = new JDBC();
- /** mongo存储配置 */
+ /**
+ * mongo存储配置
+ */
private Mongo mongo = new Mongo();
- /** minio存储配置 */
+ /**
+ * minio存储配置
+ */
private Minio minio = new Minio();
+ /**
+ * 腾讯云存储配置
+ */
+ private TencentOss tencentOss = new TencentOss();
+
/**
* 本地存储
*/
@@ -45,7 +60,9 @@ public class FileUploadProperties {
@Setter
public static class Local {
- /** 本地存储路径 */
+ /**
+ * 本地存储路径
+ */
private String localPath = "/data/file/";
}
@@ -57,7 +74,9 @@ public class FileUploadProperties {
@Setter
public static class JDBC {
- /** 是否以Base64方式进行存储 */
+ /**
+ * 是否以Base64方式进行存储
+ */
private boolean base64 = false;
}
@@ -69,7 +88,9 @@ public class FileUploadProperties {
@Setter
public static class Mongo {
- /** 存储桶 */
+ /**
+ * 存储桶
+ */
private String bucket = "fs";
}
@@ -81,21 +102,60 @@ public class FileUploadProperties {
@Setter
public static class Minio {
- /** 端点地址 */
+ /**
+ * 端点地址
+ */
private String endpoint;
- /** 区域 */
+ /**
+ * 区域
+ */
private String region;
- /** 访问 key */
+ /**
+ * 访问 key
+ */
private String accessKey;
- /** 访问 Secret */
+ /**
+ * 访问 Secret
+ */
private String accessSecret;
- /** 存储桶 需要至少三位 */
+ /**
+ * 存储桶 需要至少三位
+ */
private String bucket = "bootx";
}
+ @Getter
+ @Setter
+ public static class TencentOss {
+
+ /**
+ * 地域
+ */
+ private String region;
+
+ /**
+ * 标识Id
+ */
+ private String secretId;
+ /**
+ * 秘钥
+ */
+ private String secretKey;
+
+ /**
+ * 会话Token
+ */
+ private String sessionToken;
+
+ /**
+ * 存储桶
+ */
+ private String bucket;
+ }
+
}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/controller/FIleUpLoadController.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/controller/FIleUpLoadController.java
index 65c9ea25653fdf479b8153f71e0811573112ebf4..eec514d985b6d816d915a10c3ed560d7b94f70d9 100644
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/controller/FIleUpLoadController.java
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/controller/FIleUpLoadController.java
@@ -5,7 +5,9 @@ import cn.bootx.platform.common.core.rest.PageResult;
import cn.bootx.platform.common.core.rest.Res;
import cn.bootx.platform.common.core.rest.ResResult;
import cn.bootx.platform.common.core.rest.param.PageParam;
+import cn.bootx.platform.starter.file.dto.UpLoadOptions;
import cn.bootx.platform.starter.file.dto.UpdateFileDto;
+import cn.bootx.platform.starter.file.entity.UpdateFileInfo;
import cn.bootx.platform.starter.file.service.FileUploadService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -39,6 +41,7 @@ public class FIleUpLoadController {
return Res.ok(uploadService.page(pageParam));
}
+
@IgnoreAuth(ignore = false, login = true)
@Operation(summary = "上传")
@PostMapping("/upload")
@@ -48,7 +51,7 @@ public class FIleUpLoadController {
@Operation(summary = "删除")
@DeleteMapping("/delete")
- public ResResult delete(Long id){
+ public ResResult delete(Long id) {
uploadService.delete(id);
return Res.ok();
}
@@ -83,4 +86,17 @@ public class FIleUpLoadController {
return uploadService.download(id);
}
+ @Operation(summary = "获取临时oss密钥")
+ @GetMapping("/getUpLoadOptions")
+ public ResResult getTempCredentials() {
+ return Res.ok(uploadService.getTempCredentials());
+ }
+ @Operation(summary = "保存记录")
+ @PostMapping("/saveUploadResult")
+ public ResResult saveUploadResult(@RequestBody UpdateFileInfo info) {
+ return Res.ok(uploadService.saveUploadResult(info));
+ }
+
+
+
}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/dto/UpLoadOptions.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/dto/UpLoadOptions.java
new file mode 100644
index 0000000000000000000000000000000000000000..c94d00e9c1f725f2c2600aa3d2259564075d453d
--- /dev/null
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/dto/UpLoadOptions.java
@@ -0,0 +1,21 @@
+package cn.bootx.platform.starter.file.dto;
+
+import lombok.Data;
+
+import java.util.TreeMap;
+
+@Data
+public class UpLoadOptions {
+ private String tmpSecretId;
+ private String tmpSecretKey;
+ private String sessionToken;
+
+ private Long expiredTime;
+
+ private TreeMap formData;
+
+ private String uploadUrl;
+
+ private String key;
+
+}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/entity/JdbcFileData.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/entity/JdbcFileData.java
index 3a73132131521f70489ba01a4959482303aee937..9959008fded5571835b7f1e7589dbe86294a231f 100644
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/entity/JdbcFileData.java
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/entity/JdbcFileData.java
@@ -18,15 +18,17 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
-@DbTable(comment = "上传文件数据")
+//@DbTable(comment = "上传文件数据")
@TableName("starter_file_data")
public class JdbcFileData extends MpIdEntity {
+ /** base64方式存储 */
@DbColumn(comment = "base64方式存储")
@DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT)
private String base64;
- @DbColumn(comment = "base64方式存储")
+ /** 数据方式存储 */
+ @DbColumn(comment = "数据方式存储")
@DbMySqlFieldType(MySqlFieldTypeEnum.LONGBLOB)
private byte[] data;
}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/service/FileUploadService.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/service/FileUploadService.java
index 8e5c4cd8982205ee788ef75fcdf941fb56dd3cc7..7d1a712692508240b0922485e76be5aed535495b 100644
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/service/FileUploadService.java
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/service/FileUploadService.java
@@ -1,5 +1,6 @@
package cn.bootx.platform.starter.file.service;
+import cn.bootx.platform.starter.file.code.FileUploadTypeEnum;
import cn.bootx.platform.starter.file.configuration.FileUploadProperties;
import cn.bootx.platform.common.core.exception.BizException;
import cn.bootx.platform.common.core.function.ParamService;
@@ -7,9 +8,12 @@ import cn.bootx.platform.common.core.rest.PageResult;
import cn.bootx.platform.common.core.rest.param.PageParam;
import cn.bootx.platform.common.mybatisplus.util.MpUtil;
import cn.bootx.platform.starter.file.dao.UpdateFileManager;
+import cn.bootx.platform.starter.file.dto.UpLoadOptions;
import cn.bootx.platform.starter.file.dto.UpdateFileDto;
import cn.bootx.platform.starter.file.entity.UpdateFileInfo;
import cn.bootx.platform.starter.file.entity.UploadFileContext;
+import cn.bootx.platform.starter.file.service.impl.OssUploadService;
+import cn.bootx.platform.starter.file.service.impl.TencentOssUploadService;
import cn.hutool.core.io.FileTypeUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.IdUtil;
@@ -187,4 +191,19 @@ public class FileUploadService {
return serverUrl;
}
+ public UpLoadOptions getTempCredentials() {
+
+ TencentOssUploadService ossUploadService=(TencentOssUploadService)uploadServices.stream().filter(s -> s.enable(FileUploadTypeEnum.TENCENT_OSS))
+ .findFirst().orElseThrow(() -> new BizException("未找到该类文件的处理器"));
+
+ return ossUploadService.getTemplateCredential();
+
+ }
+
+ public UpdateFileDto saveUploadResult(UpdateFileInfo uploadInfo) {
+
+ uploadInfo.setId(IdUtil.getSnowflakeNextId());
+ updateFileManager.save(uploadInfo);
+ return uploadInfo.toDto();
+ }
}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/service/impl/TencentOssUploadService.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/service/impl/TencentOssUploadService.java
new file mode 100644
index 0000000000000000000000000000000000000000..efd397fc24b18047fa2fb9f891b6611794bb585d
--- /dev/null
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/service/impl/TencentOssUploadService.java
@@ -0,0 +1,248 @@
+package cn.bootx.platform.starter.file.service.impl;
+
+import cn.bootx.platform.common.core.exception.BizException;
+import cn.bootx.platform.common.jackson.util.JacksonUtil;
+import cn.bootx.platform.starter.file.code.FileUploadTypeEnum;
+import cn.bootx.platform.starter.file.configuration.FileUploadProperties;
+import cn.bootx.platform.starter.file.dto.UpLoadOptions;
+import cn.bootx.platform.starter.file.entity.UpdateFileInfo;
+import cn.bootx.platform.starter.file.entity.UploadFileContext;
+import cn.bootx.platform.starter.file.service.UploadService;
+import cn.hutool.core.codec.Base64Encoder;
+import cn.hutool.core.date.LocalDateTimeUtil;
+import cn.hutool.crypto.SecureUtil;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.qcloud.cos.COSClient;
+import com.qcloud.cos.ClientConfig;
+import com.qcloud.cos.auth.BasicCOSCredentials;
+import com.qcloud.cos.auth.COSCredentials;
+import com.qcloud.cos.exception.CosClientException;
+import com.qcloud.cos.http.HttpMethodName;
+import com.qcloud.cos.http.HttpProtocol;
+import com.qcloud.cos.model.GeneratePresignedUrlRequest;
+import com.qcloud.cos.model.ObjectMetadata;
+import com.qcloud.cos.model.PutObjectRequest;
+import com.qcloud.cos.model.UploadResult;
+import com.qcloud.cos.region.Region;
+import com.qcloud.cos.transfer.TransferManager;
+import com.qcloud.cos.transfer.TransferManagerConfiguration;
+import com.qcloud.cos.transfer.Upload;
+import com.tencent.cloud.CosStsClient;
+import com.tencent.cloud.Response;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.Date;
+import java.util.Objects;
+import java.util.TreeMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import static java.time.temporal.ChronoUnit.MINUTES;
+
+/**
+ * 阿里云OSS上传文件
+ *
+ * @author xxm
+ * @since 2022/1/12
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class TencentOssUploadService implements UploadService {
+ private final FileUploadProperties fileUploadProperties;
+
+ private final ObjectMapper objectMapper;
+
+ COSClient client;
+ TransferManager transferManager;
+
+ @Override
+ public boolean enable(FileUploadTypeEnum type) {
+ boolean initFlag = type == FileUploadTypeEnum.TENCENT_OSS;
+ if (initFlag) {
+ this.doInit();
+ }
+ return initFlag;
+ }
+
+ @Override
+ public UpdateFileInfo upload(MultipartFile file, UploadFileContext context) {
+ FileUploadProperties.TencentOss oss = fileUploadProperties.getTencentOss();
+ ObjectMetadata objectMetadata = new ObjectMetadata();
+ objectMetadata.setContentLength(file.getSize());
+ PutObjectRequest putObjectRequest;
+ UploadResult uploadResult;
+ try {
+ putObjectRequest = new PutObjectRequest(oss.getBucket(), context.getFileId().toString(), file.getInputStream(), objectMetadata);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ try {
+ // 高级接口会返回一个异步结果Upload
+ // 可同步地调用 waitForUploadResult 方法等待上传完成,成功返回 UploadResult, 失败抛出异常
+ Upload upload = transferManager.upload(putObjectRequest);
+ uploadResult = upload.waitForUploadResult();
+ } catch (CosClientException | InterruptedException e) {
+ e.printStackTrace();
+ log.error("上传失败,原因:", e);
+ throw new BizException("上传失败");
+ }
+
+ return new UpdateFileInfo().setExternalStorageId(uploadResult.getKey()).setFileSize(file.getSize());
+ }
+
+ @Override
+ public void preview(UpdateFileInfo updateFileInfo, HttpServletResponse response) {
+ FileUploadProperties.TencentOss oss = fileUploadProperties.getTencentOss();
+ String key = updateFileInfo.getExternalStorageId();
+ GeneratePresignedUrlRequest req =
+ new GeneratePresignedUrlRequest(oss.getBucket(), key, HttpMethodName.GET);
+ Date expirationDate = new Date(System.currentTimeMillis() + 30L * 60L * 1000L);
+ req.setExpiration(expirationDate);
+ URL url = client.generatePresignedUrl(req);
+ try {
+ response.sendRedirect(url.toString());
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public InputStream download(UpdateFileInfo updateFileInfo) {
+ FileUploadProperties.TencentOss oss = fileUploadProperties.getTencentOss();
+ String key = updateFileInfo.getExternalStorageId();
+ GeneratePresignedUrlRequest req =
+ new GeneratePresignedUrlRequest(oss.getBucket(), key, HttpMethodName.GET);
+ Date expirationDate = new Date(System.currentTimeMillis() + 30L * 60L * 1000L);
+ req.setExpiration(expirationDate);
+ URL url = client.generatePresignedUrl(req);
+ try {
+ return url.openStream();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public void delete(UpdateFileInfo updateFileInfo) {
+ FileUploadProperties.TencentOss oss = fileUploadProperties.getTencentOss();
+ client.deleteObject(oss.getBucket(), updateFileInfo.getFileName());
+ }
+
+ public UpLoadOptions getTemplateCredential() {
+ UpLoadOptions options;
+ FileUploadProperties.TencentOss oss = fileUploadProperties.getTencentOss();
+ TreeMap config = new TreeMap();
+ config.put("secretId", oss.getSecretId());
+ config.put("secretKey", oss.getSecretKey());
+ config.put("durationSeconds", 1800);
+ config.put("bucket", oss.getBucket());
+ config.put("region", oss.getRegion());
+ config.put("allowPrefixes", new String[]{
+ "bootx/*"
+ });
+
+ String[] allowActions = new String[]{
+ // 简单上传
+ "name/cos:PutObject",
+ // 表单上传、小程序上传
+ "name/cos:PostObject",
+ // 分块上传
+ "name/cos:InitiateMultipartUpload",
+ "name/cos:ListMultipartUploads",
+ "name/cos:ListParts",
+ "name/cos:UploadPart",
+ "name/cos:CompleteMultipartUpload"
+ };
+
+ config.put("allowActions", allowActions);
+ try {
+ Response response = CosStsClient.getCredential(config);
+ options = new UpLoadOptions();
+ options.setSessionToken(response.credentials.sessionToken);
+ options.setTmpSecretKey(response.credentials.tmpSecretKey);
+ options.setTmpSecretId(response.credentials.tmpSecretId);
+ options.setExpiredTime(1800L);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ LocalDateTime startTime = LocalDateTime.now();
+ LocalDateTime endTime = startTime.plus(5, MINUTES);
+ String keyTime = LocalDateTimeUtil.toEpochMilli(startTime) / 1000 + ";" + LocalDateTimeUtil.toEpochMilli(endTime) / 1000;
+ TreeMap formData = new TreeMap<>();
+ ObjectNode root = objectMapper.createObjectNode();
+ root.put("expiration", endTime.plus(30, MINUTES).withNano(0).atZone(ZoneId.of("Z"))
+ .toString());
+ ArrayNode conditions = objectMapper.createArrayNode();
+ root.putIfAbsent("conditions", conditions);
+ ObjectNode child = objectMapper.createObjectNode();
+ child.put("acl", "default");
+ child = objectMapper.createObjectNode();
+ child.put("bucket", oss.getBucket());
+ ArrayNode tempArr = objectMapper.createArrayNode();
+ tempArr.add("starts-with");
+ tempArr.add("$key");
+ tempArr.add("bootx/");
+ conditions.addPOJO(tempArr);
+ conditions.addPOJO(child);
+ child = objectMapper.createObjectNode();
+ child.put("q-sign-algorithm", "sha1");
+ conditions.addPOJO(child);
+ child = objectMapper.createObjectNode();
+ child.put("q-ak", options.getTmpSecretId());
+
+ conditions.addPOJO(child);
+ child = objectMapper.createObjectNode();
+ child.put("q-sign-time", keyTime);
+ conditions.addPOJO(child);
+ formData.put("x-cos-security-token", options.getSessionToken());
+ String policyText = JacksonUtil.toJson(root);
+ formData.put("policy", Base64Encoder.encode(policyText));
+ formData.put("acl", "default");
+ formData.put("q-sign-algorithm", "sha1");
+ formData.put("q-ak", options.getTmpSecretId());
+ formData.put("q-key-time", keyTime);
+ String signKey = SecureUtil.hmacSha1(options.getTmpSecretKey()).digestHex(keyTime);
+ String stringToSign = SecureUtil.sha1().digestHex(policyText);
+ String signature = SecureUtil.hmacSha1(signKey).digestHex(stringToSign);
+ formData.put("q-signature", signature);
+ log.info("signKey:{},stringToSign:{},signature:{}", signKey, stringToSign, signature);
+ options.setFormData(formData);
+ options.setUploadUrl("https://" + oss.getBucket() + ".cos.ap-beijing.myqcloud.com");
+
+
+ return options;
+ }
+
+ protected void doInit() {
+ if (Objects.nonNull(client)) {
+ return;
+ }
+ // 初始化客户端
+ FileUploadProperties.TencentOss oss = fileUploadProperties.getTencentOss();
+
+ Region region = new Region(oss.getRegion()); //COS_REGION 参数:配置成存储桶 bucket 的实际地域,例如 ap-beijing,更多 COS 地域的简称请参见 https://cloud.tencent.com/document/product/436/6224
+ ClientConfig clientConfig = new ClientConfig(region);
+ clientConfig.setHttpProtocol(HttpProtocol.https);
+ COSCredentials cred = new BasicCOSCredentials(oss.getSecretId(), oss.getSecretKey());
+ client = new COSClient(cred, clientConfig);
+ ExecutorService threadPool = Executors.newFixedThreadPool(32);
+ transferManager = new TransferManager(client, threadPool);
+ TransferManagerConfiguration transferManagerConfiguration = new TransferManagerConfiguration();
+ transferManagerConfiguration.setMultipartUploadThreshold(5 * 1024 * 1024);
+ transferManagerConfiguration.setMinimumUploadPartSize(1024 * 1024);
+ transferManager.setConfiguration(transferManagerConfiguration);
+
+ }
+}
diff --git a/bootx-common-starters/common-starter-monitor/pom.xml b/bootx-common-starters/common-starter-monitor/pom.xml
index 72c247a75c07ff6a394c51864d44f7b625a4bf37..0929ad32ff558d14987cdf47eee1cbd01ff61650 100644
--- a/bootx-common-starters/common-starter-monitor/pom.xml
+++ b/bootx-common-starters/common-starter-monitor/pom.xml
@@ -5,7 +5,7 @@
bootx-common-starters
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
jar
diff --git a/bootx-common-starters/common-starter-quartz/pom.xml b/bootx-common-starters/common-starter-quartz/pom.xml
index c20f0927bb67272993c18fb084bf922a9090cf6a..fd2de4390b4caca1d03ee02b207df2cc8a1a819e 100644
--- a/bootx-common-starters/common-starter-quartz/pom.xml
+++ b/bootx-common-starters/common-starter-quartz/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-common-starters
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-common-starters/common-starter-wechat/pom.xml b/bootx-common-starters/common-starter-wechat/pom.xml
index 581c7f41e93a414eed83a9b6b626831eb13afada..c1af83b604c403208ec7dea96d40cd7e181e3686 100644
--- a/bootx-common-starters/common-starter-wechat/pom.xml
+++ b/bootx-common-starters/common-starter-wechat/pom.xml
@@ -5,7 +5,7 @@
bootx-common-starters
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
@@ -43,6 +43,26 @@
+
+
+ com.github.binarywang
+ weixin-java-miniapp
+ ${wxjava.version}
+
+
+ commons-io
+ commons-io
+
+
+ guava
+ com.google.guava
+
+
+ com.thoughtworks.xstream
+ xstream
+
+
+
com.thoughtworks.xstream
diff --git a/bootx-common-starters/common-starter-wechat/src/main/java/cn/bootx/platform/starter/wechat/configuration/WeChatAppletProperties.java b/bootx-common-starters/common-starter-wechat/src/main/java/cn/bootx/platform/starter/wechat/configuration/WeChatAppletProperties.java
new file mode 100644
index 0000000000000000000000000000000000000000..2dc48b7b86f774ff6b01049d0ad53104adf8377c
--- /dev/null
+++ b/bootx-common-starters/common-starter-wechat/src/main/java/cn/bootx/platform/starter/wechat/configuration/WeChatAppletProperties.java
@@ -0,0 +1,26 @@
+package cn.bootx.platform.starter.wechat.configuration;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * 微信公众平台配置
+ *
+ * @author xxm
+ * @since 2022/7/15
+ */
+@Getter
+@Setter
+@ConfigurationProperties("bootx.starter.third.wechat-applet")
+public class WeChatAppletProperties {
+
+ /** AppKey */
+ private String appId;
+
+ /** AppSecret */
+ private String appSecret;
+
+
+
+}
diff --git a/bootx-common-starters/common-starter-wechat/src/main/java/cn/bootx/platform/starter/wechat/configuration/WeChatConfiguration.java b/bootx-common-starters/common-starter-wechat/src/main/java/cn/bootx/platform/starter/wechat/configuration/WeChatConfiguration.java
index 991a8f630704da3f2388c2edcfc160c1444ff96b..d1bce120a72725626629c37b9178eaa29e9277ba 100644
--- a/bootx-common-starters/common-starter-wechat/src/main/java/cn/bootx/platform/starter/wechat/configuration/WeChatConfiguration.java
+++ b/bootx-common-starters/common-starter-wechat/src/main/java/cn/bootx/platform/starter/wechat/configuration/WeChatConfiguration.java
@@ -1,5 +1,9 @@
package cn.bootx.platform.starter.wechat.configuration;
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
+import cn.binarywang.wx.miniapp.config.WxMaConfig;
+import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.mp.api.*;
import me.chanjar.weixin.mp.api.impl.*;
@@ -20,6 +24,8 @@ public class WeChatConfiguration {
private final WeChatProperties weChatProperties;
+ private final WeChatAppletProperties weChatAppletProperties;
+
/**
* 微信公众号APIService
*/
@@ -42,5 +48,17 @@ public class WeChatConfiguration {
config.setAesKey(weChatProperties.getEncodingAesKey()); // 消息加解密密钥
return config;
}
-
+ @Bean
+ public WxMaService wxMaService(WxMaConfig wxMaConfigStorage) {
+ WxMaService wxMpService = new WxMaServiceImpl();
+ wxMpService.setWxMaConfig(wxMaConfigStorage);
+ return wxMpService;
+ }
+ @Bean
+ public WxMaConfig wxMaConfigStorage() {
+ WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
+ config.setAppid(weChatAppletProperties.getAppId()); // 设置微信公众号的appid
+ config.setSecret(weChatAppletProperties.getAppSecret()); // 设置微信公众号的app corpSecret
+ return config;
+ }
}
diff --git a/bootx-common-starters/common-starter-wecom/pom.xml b/bootx-common-starters/common-starter-wecom/pom.xml
index 4e9bdb3993578e4182faf76ef77211884b8f71d3..a84b05e042ee7c8545d3dee1677c2c4565e3b246 100644
--- a/bootx-common-starters/common-starter-wecom/pom.xml
+++ b/bootx-common-starters/common-starter-wecom/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-common-starters
- 1.3.3
+ 1.3.4
4.0.0
jar
diff --git a/bootx-common-starters/pom.xml b/bootx-common-starters/pom.xml
index 3b798843ce49a4d5e5f3bad611a128b817746089..2ba7b8deed9aeae402cb0970a7abca25cb04a0f1 100644
--- a/bootx-common-starters/pom.xml
+++ b/bootx-common-starters/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-platform-parent
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-commons/common-cache/pom.xml b/bootx-commons/common-cache/pom.xml
index ad555584fa3c0cefdd30cdd845cae9472afccd22..f608a568e38105ac2c0e0a9c706ff1cff545b743 100644
--- a/bootx-commons/common-cache/pom.xml
+++ b/bootx-commons/common-cache/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-commons
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-commons/common-data-translate/pom.xml b/bootx-commons/common-data-translate/pom.xml
index ba406178a11d3981d228beeb679c7a6244e89d94..cd726fa57f4182a2ad2a8b11561285190122f91c 100644
--- a/bootx-commons/common-data-translate/pom.xml
+++ b/bootx-commons/common-data-translate/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-commons
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-commons/common-data-translate/src/main/java/cn/bootx/platform/common/translate/cache/TranslationCacheService.java b/bootx-commons/common-data-translate/src/main/java/cn/bootx/platform/common/translate/cache/TranslationCacheService.java
index efe6202b571a69236e3449c42b17f91d6ea7ad86..f2dd33c287f69333c9f911531afa755398919499 100644
--- a/bootx-commons/common-data-translate/src/main/java/cn/bootx/platform/common/translate/cache/TranslationCacheService.java
+++ b/bootx-commons/common-data-translate/src/main/java/cn/bootx/platform/common/translate/cache/TranslationCacheService.java
@@ -21,6 +21,7 @@ import java.util.Objects;
import java.util.stream.Collectors;
/**
+ * 翻译缓存服务
* @author xxm
* @since 2023/1/30
*/
diff --git a/bootx-commons/common-eventer/pom.xml b/bootx-commons/common-eventer/pom.xml
index 4b09531828687b6b003f64c13b9828e586030f38..d54847f763ad0c8717ef0d8f5c6148f6ab010d0a 100644
--- a/bootx-commons/common-eventer/pom.xml
+++ b/bootx-commons/common-eventer/pom.xml
@@ -6,7 +6,7 @@
cn.bootx.platform
bootx-commons
- 1.3.3
+ 1.3.4
common-eventer
diff --git a/bootx-commons/common-exception-handler/pom.xml b/bootx-commons/common-exception-handler/pom.xml
index 2adb989e93a1cee5958e9cff291ae565db9d38ba..a50e3edae5179ed92c8d3128274f9e53614231cc 100644
--- a/bootx-commons/common-exception-handler/pom.xml
+++ b/bootx-commons/common-exception-handler/pom.xml
@@ -5,7 +5,7 @@
bootx-commons
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
common-exception-handler
diff --git a/bootx-commons/common-header-holder/pom.xml b/bootx-commons/common-header-holder/pom.xml
index 310e66e9ad61eb46bc19ef2de593f327355bcc07..63d0c6bd75d2231c1905bdd74e1d5ef04843672a 100644
--- a/bootx-commons/common-header-holder/pom.xml
+++ b/bootx-commons/common-header-holder/pom.xml
@@ -5,7 +5,7 @@
bootx-commons
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-commons/common-idempotency/pom.xml b/bootx-commons/common-idempotency/pom.xml
index d9d3745a06873c11dfd1c722a2d4e9f64c2344ff..6fde82c39561e8c2f6bfdf93aee9ce40eac12c30 100644
--- a/bootx-commons/common-idempotency/pom.xml
+++ b/bootx-commons/common-idempotency/pom.xml
@@ -5,7 +5,7 @@
bootx-commons
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-commons/common-jackson/README.md b/bootx-commons/common-jackson/README.md
deleted file mode 100644
index fbdc98b31a8ca6362dacce2999cb94576706ff6d..0000000000000000000000000000000000000000
--- a/bootx-commons/common-jackson/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-
-## JackSon配置
-
-### 功能
-
-- 提供`JacksonUtil`工具类,用于需要进行`Jackson`解析的场合
-- 提供 `java8` 时间序列化类,在`Jackson`序列化时对`JDK8`新增的时间类进行支持
-- 提供`Long` 类型序列化为`String`类型的序列化类,处理前端长整形精度丢失问题
-- 提供一个默认的`ObjectMapper`序列化配置,支持`jdk8`,`LongToString`等配置
-- 提供`Jackson2ObjectMapper`相关配置(`Spring MVC`进行参数和结果转换),支持`jdk8`,`LongToString`等配置
diff --git a/bootx-commons/common-jackson/pom.xml b/bootx-commons/common-jackson/pom.xml
index 51b8342763e807705f459957c9d6ab7ade20b5c8..17ad010d286b27313f944cfcb83ef74c55dff5f5 100644
--- a/bootx-commons/common-jackson/pom.xml
+++ b/bootx-commons/common-jackson/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-commons
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-commons/common-log/pom.xml b/bootx-commons/common-log/pom.xml
index 96da106df656db3e42bf3b0b22c7f5e86fa25fac..29fd3871dce0bd248e23b177f69ac972f77f3b9f 100644
--- a/bootx-commons/common-log/pom.xml
+++ b/bootx-commons/common-log/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-commons
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-commons/common-mongo/pom.xml b/bootx-commons/common-mongo/pom.xml
index 293551c9bd2f132b88f4aed9cd767f4f08b62c89..5591b7dcd0a3712a48a9fa95d1bd7020e88a8daa 100644
--- a/bootx-commons/common-mongo/pom.xml
+++ b/bootx-commons/common-mongo/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-commons
- 1.3.3
+ 1.3.4
4.0.0
common-mongo
diff --git a/bootx-commons/common-mybatis-plus/pom.xml b/bootx-commons/common-mybatis-plus/pom.xml
index 06f249b084f3c444ac0212af4439a716053d6a60..36fa633854eca1cd3b5fc2ba0a8225146a7ded8a 100644
--- a/bootx-commons/common-mybatis-plus/pom.xml
+++ b/bootx-commons/common-mybatis-plus/pom.xml
@@ -5,7 +5,7 @@
bootx-commons
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-commons/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/base/MpCreateEntity.java b/bootx-commons/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/base/MpCreateEntity.java
index ba0a8f01731f623d88e57509e262ba6717ad8fae..fa9a89351483b249822dad47489b1a7c87cb58d9 100644
--- a/bootx-commons/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/base/MpCreateEntity.java
+++ b/bootx-commons/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/base/MpCreateEntity.java
@@ -10,6 +10,7 @@ import lombok.experimental.FieldNameConstants;
import java.time.LocalDateTime;
/**
+ * 创建实体类 (不带逻辑删除)
* @author xxm
* @since 2022/7/26
*/
diff --git a/bootx-commons/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/JacksonRawTypeHandler.java b/bootx-commons/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/JacksonRawTypeHandler.java
index 053c2394941969a4c499df7a91037750d1b35169..68a0fe5a17b75a03dadf1022eb78d1df94bc4a83 100644
--- a/bootx-commons/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/JacksonRawTypeHandler.java
+++ b/bootx-commons/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/JacksonRawTypeHandler.java
@@ -9,7 +9,8 @@ import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
/**
- * Jackson 实现 JSON 字段类型处理器, 会记录对象属性类型, 通常用于被容器(List、Set、Map)包装的属性上
+ * Jackson 实现 JSON 字段类型处理器, 会记录对象属性类型, 通常用于储存不确定对象的属性上
+ * 例如: 泛型对象、存储的数据是字段类型的子类等
*
* @author xxm
* @since 2022/7/11
@@ -21,6 +22,9 @@ public class JacksonRawTypeHandler extends AbstractJsonTypeHandler
+
+ cn.bootx
+ mybatis-table-modify-mysql-boot-starter
+
+
+ com.baomidou
+ mybatis-plus-annotation
+
+
+
org.springframework.boot
spring-boot-starter-data-mongodb
@@ -66,9 +76,5 @@
cn.bootx.platform
common-rabbitmq
-
- cn.bootx
- mybatis-table-modify-mysql-boot-starter
-
diff --git a/bootx-demo/src/main/java/cn/bootx/platform/demo/core/query/service/SuperQueryDemoService.java b/bootx-demo/src/main/java/cn/bootx/platform/demo/core/query/service/SuperQueryDemoService.java
index 1c36a3f3f6c6219434fa7581dc91470abd5ad56c..d3f9d306ba0f984dcca55bb9b8a1816cc24d0da0 100644
--- a/bootx-demo/src/main/java/cn/bootx/platform/demo/core/query/service/SuperQueryDemoService.java
+++ b/bootx-demo/src/main/java/cn/bootx/platform/demo/core/query/service/SuperQueryDemoService.java
@@ -1,5 +1,6 @@
package cn.bootx.platform.demo.core.query.service;
+import cn.bootx.platform.common.core.annotation.QueryParam;
import cn.bootx.platform.common.core.exception.DataNotExistException;
import cn.bootx.platform.common.core.rest.PageResult;
import cn.bootx.platform.common.core.rest.param.PageParam;
@@ -21,6 +22,7 @@ import java.time.LocalDateTime;
* @author xxm
* @since 2022/2/21
*/
+@QueryParam(type = QueryParam.CompareTypeEnum.LIKE)
@Slf4j
@Service
@RequiredArgsConstructor
diff --git a/bootx-services/pom.xml b/bootx-services/pom.xml
index 742c33a98ffbcda0b13d7f21163d46d3245feffb..fe2025a704180a0a02b1f81c3503b47a3e4cb54d 100644
--- a/bootx-services/pom.xml
+++ b/bootx-services/pom.xml
@@ -5,11 +5,8 @@
cn.bootx.platform
bootx-platform-parent
- 1.3.3
+ 1.3.4
-
- service-miniapp
-
4.0.0
@@ -17,29 +14,25 @@
pom
业务服务父pom
+
+ service-baseapi
+ service-iam
+ service-notice
+ service-platform
+
+
-
+
noDeploy
- service-baseapi
- service-iam
- service-notice
service-visualization
+ service-miniapp
true
-
-
- deploy
-
- service-baseapi
- service-iam
- service-notice
-
-
diff --git a/bootx-services/service-baseapi/pom.xml b/bootx-services/service-baseapi/pom.xml
index 1b354bdc021b9fa37b176964aead7ec05e1fbfe7..d46d02bc07dc9bfc1f7c65feb6682901da355f85 100644
--- a/bootx-services/service-baseapi/pom.xml
+++ b/bootx-services/service-baseapi/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-services
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/code/GeneralTemplateCode.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/code/GeneralTemplateCode.java
new file mode 100644
index 0000000000000000000000000000000000000000..866ef5a28ba4f47bbf73cb3c934f40ede48984ef
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/code/GeneralTemplateCode.java
@@ -0,0 +1,17 @@
+package cn.bootx.platform.baseapi.code;
+
+/**
+ * 通用模板变量
+ * @author xxm
+ * @since 2023/8/12
+ */
+public interface GeneralTemplateCode {
+
+ /** 模板类型 */
+ String USE_TYPE_IMPORT = "import";
+ String USE_TYPE_EXPORT = "export";
+
+ /** 启用状态 */
+ String STATE_ENABLE = "enable";
+ String STATE_DISABLE = "disable";
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/code/WordFilterCode.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/code/WordFilterCode.java
new file mode 100644
index 0000000000000000000000000000000000000000..fae961eef6765ca45243f2f29d264c4c5c3d1b5d
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/code/WordFilterCode.java
@@ -0,0 +1,13 @@
+package cn.bootx.platform.baseapi.code;
+
+/**
+ * 敏感词过滤器常量
+ * @author xxm
+ * @since 2023/8/9
+ */
+public interface WordFilterCode {
+ /** 白名单名词 */
+ String IS_WHITE_WORD = "isWhiteWord";
+ /** 是否结束 */
+ String IS_END = "isEnd";
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/controller/ChinaWordController.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/controller/ChinaWordController.java
new file mode 100644
index 0000000000000000000000000000000000000000..913fa896584598b3242e6ae10027ce959251752a
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/controller/ChinaWordController.java
@@ -0,0 +1,106 @@
+package cn.bootx.platform.baseapi.controller;
+
+import cn.bootx.platform.baseapi.core.chinaword.service.ChinaWordService;
+import cn.bootx.platform.baseapi.dto.chinaword.ChinaWordDto;
+import cn.bootx.platform.baseapi.dto.chinaword.ChinaWordVerifyResult;
+import cn.bootx.platform.baseapi.param.chinaword.ChinaWordParam;
+import cn.bootx.platform.baseapi.param.chinaword.ChinaWordVerifyParam;
+import cn.bootx.platform.common.core.rest.PageResult;
+import cn.bootx.platform.common.core.rest.Res;
+import cn.bootx.platform.common.core.rest.ResResult;
+import cn.bootx.platform.common.core.rest.param.PageParam;
+import cn.hutool.core.io.IoUtil;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.*;
+import java.nio.file.Files;
+import java.util.List;
+
+/**
+ * 敏感词
+ * @author xxm
+ * @since 2023-08-09
+ */
+@Tag(name ="敏感词管理")
+@RestController
+@RequestMapping("/chinaword")
+@RequiredArgsConstructor
+public class ChinaWordController {
+ private final ChinaWordService chinaWordService;
+
+ @Operation( summary = "添加")
+ @PostMapping(value = "/add")
+ public ResResult add(@RequestBody ChinaWordParam param){
+ chinaWordService.add(param);
+ return Res.ok();
+ }
+
+ @Operation( summary = "修改")
+ @PostMapping(value = "/update")
+ public ResResult update(@RequestBody ChinaWordParam param){
+ chinaWordService.update(param);
+ return Res.ok();
+ }
+
+ @Operation( summary = "删除")
+ @DeleteMapping(value = "/delete")
+ public ResResult delete(Long id){
+ chinaWordService.delete(id);
+ return Res.ok();
+ }
+
+ @Operation( summary = "通过ID查询")
+ @GetMapping(value = "/findById")
+ public ResResult findById(Long id){
+ return Res.ok(chinaWordService.findById(id));
+ }
+
+ @Operation( summary = "刷新缓存")
+ @PostMapping(value = "/refresh")
+ public ResResult refresh(){
+ chinaWordService.refresh();
+ return Res.ok();
+ }
+
+ @Operation( summary = "测试敏感词效果")
+ @PostMapping(value = "/verify")
+ public ResResult verify(@RequestBody ChinaWordVerifyParam param){
+ return Res.ok(chinaWordService.verify(param.getText(),param.getSkip(),param.getSymbol()));
+ }
+
+ @Operation( summary = "查询所有")
+ @GetMapping(value = "/findAll")
+ public ResResult> findAll(){
+ return Res.ok(chinaWordService.findAll());
+ }
+
+ @Operation( summary = "分页查询")
+ @GetMapping(value = "/page")
+ public ResResult> page(PageParam pageParam, ChinaWordParam query){
+ return Res.ok(chinaWordService.page(pageParam,query));
+ }
+
+ @Operation(summary = "批量导入")
+ @PostMapping("/importBatch")
+ public ResResult local(MultipartFile file, String type) throws IOException {
+ chinaWordService.importBatch(file, type);
+ return Res.ok();
+ }
+
+ @Operation(summary = "获取模板")
+ @GetMapping("/getTemplate")
+ public ResponseEntity getTemplate() throws IOException {
+ InputStream is = Files.newInputStream(new File("D:/data/洛阳工作量报价.xlsx").toPath());
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
+ return new ResponseEntity<>(IoUtil.readBytes(is), headers, HttpStatus.OK);
+ }
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/controller/GeneralTemplateController.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/controller/GeneralTemplateController.java
new file mode 100644
index 0000000000000000000000000000000000000000..dc0d2140fdb7bc9476df8f4481d4577f8df0e705
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/controller/GeneralTemplateController.java
@@ -0,0 +1,94 @@
+package cn.bootx.platform.baseapi.controller;
+
+import cn.bootx.platform.baseapi.core.template.service.GeneralTemplateService;
+import cn.bootx.platform.baseapi.dto.template.GeneralTemplateDto;
+import cn.bootx.platform.baseapi.param.template.GeneralTemplateParam;
+import cn.bootx.platform.common.core.rest.PageResult;
+import cn.bootx.platform.common.core.rest.Res;
+import cn.bootx.platform.common.core.rest.ResResult;
+import cn.bootx.platform.common.core.rest.param.PageParam;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 通用模板管理
+ * @author xxm
+ * @since 2023-08-12
+ */
+@Tag(name ="通用模板管理")
+@RestController
+@RequestMapping("/general/template")
+@RequiredArgsConstructor
+public class GeneralTemplateController {
+ private final GeneralTemplateService generalTemplateService;
+
+ @Operation( summary = "添加")
+ @PostMapping(value = "/add")
+ public ResResult add(@RequestBody GeneralTemplateParam param){
+ generalTemplateService.add(param);
+ return Res.ok();
+ }
+
+ @Operation( summary = "修改")
+ @PostMapping(value = "/update")
+ public ResResult update(@RequestBody GeneralTemplateParam param){
+ generalTemplateService.update(param);
+ return Res.ok();
+ }
+
+ @Operation( summary = "删除")
+ @DeleteMapping(value = "/delete")
+ public ResResult delete(Long id){
+ generalTemplateService.delete(id);
+ return Res.ok();
+ }
+
+ @Operation(summary = "批量删除")
+ @DeleteMapping("/deleteBatch")
+ public ResResult deleteBatch(@RequestBody List ids) {
+ generalTemplateService.deleteBatch(ids);
+ return Res.ok();
+ }
+
+ @Operation( summary = "通过ID查询")
+ @GetMapping(value = "/findById")
+ public ResResult findById(Long id){
+ return Res.ok(generalTemplateService.findById(id));
+ }
+
+ @Operation( summary = "通过Code查询")
+ @GetMapping(value = "/findByCode")
+ public ResResult findByCode(String code){
+ return Res.ok(generalTemplateService.findByCode(code));
+ }
+
+
+ @Operation(summary = "编码是否被使用")
+ @GetMapping("/existsByCode")
+ public ResResult existsByCode(String code) {
+ return Res.ok(generalTemplateService.existsByCode(code));
+ }
+
+ @Operation(summary = "编码是否被使用(不包含自己)")
+ @GetMapping("/existsByCodeNotId")
+ public ResResult existsByCode(String code, Long id) {
+ return Res.ok(generalTemplateService.existsByCode(code, id));
+ }
+
+
+ @Operation( summary = "查询所有")
+ @GetMapping(value = "/findAll")
+ public ResResult> findAll(){
+ return Res.ok(generalTemplateService.findAll());
+ }
+
+ @Operation( summary = "分页查询")
+ @GetMapping(value = "/page")
+ public ResResult> page(PageParam pageParam, GeneralTemplateParam query){
+ return Res.ok(generalTemplateService.page(pageParam,query));
+ }
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/captcha/service/CaptchaService.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/captcha/service/CaptchaService.java
index 148826dd15823adcee0c1013a2b45985f302e334..ff3abf907e0310741002d6c5d513ef4768eb2cc9 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/captcha/service/CaptchaService.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/captcha/service/CaptchaService.java
@@ -2,7 +2,6 @@ package cn.bootx.platform.baseapi.core.captcha.service;
import cn.bootx.platform.baseapi.dto.captcha.CaptchaDataResult;
import cn.bootx.platform.common.redis.RedisClient;
-import cn.bootx.platform.common.websocket.service.UserWsNoticeService;
import cn.hutool.core.util.RandomUtil;
import com.wf.captcha.ArithmeticCaptcha;
import lombok.RequiredArgsConstructor;
@@ -31,8 +30,6 @@ public class CaptchaService {
/** 邮箱验证码前缀 */
private final String emailCaptchaPrefix = "email:captcha:";
- private final UserWsNoticeService userWsNoticeService;
-
private final RedisClient redisClient;
/**
@@ -51,6 +48,7 @@ public class CaptchaService {
/**
* 校验图片验证码
+ * @param key 验证码Key
*/
public boolean validateImgCaptcha(String key, String captcha) {
// 比较验证码是否正确
@@ -59,7 +57,8 @@ public class CaptchaService {
}
/**
- * 失效图片验证码
+ * 将图片验证码设置为失效
+ * @param key 验证码Key
*/
public void deleteImgCaptcha(String key) {
redisClient.deleteKey(imgCaptchaPrefix + key);
@@ -67,6 +66,10 @@ public class CaptchaService {
/**
* 发送手机验证码
+ * @param phone 手机号
+ * @param timeoutSec 超时时间
+ * @param type 业务类型, 用来区分不同业务的短信验证码
+ * @return 验证码
*/
public int sendSmsCaptcha(String phone, long timeoutSec, String type) {
int captcha = RandomUtil.randomInt(100000, 1000000);
@@ -76,7 +79,7 @@ public class CaptchaService {
}
/**
- * 手机发送的验证码是否还有效
+ * 验证手机发送的验证码是否还在有效时间内
*/
public boolean existsSmsCaptcha(String phone, String type) {
return redisClient.exists(getSmsCaptchaPrefix(type) + phone);
@@ -92,7 +95,7 @@ public class CaptchaService {
}
/**
- * 失效手机验证码
+ * 将手机验证码验证码设置为失效
*/
public void deleteSmsCaptcha(String phone, String type) {
redisClient.deleteKey(getSmsCaptchaPrefix(type) + phone);
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/convert/ChinaWordConvert.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/convert/ChinaWordConvert.java
new file mode 100644
index 0000000000000000000000000000000000000000..8ea78d8210cbfcc27b3d55dd60fb7a029159e80d
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/convert/ChinaWordConvert.java
@@ -0,0 +1,22 @@
+package cn.bootx.platform.baseapi.core.chinaword.convert;
+
+import cn.bootx.platform.baseapi.core.chinaword.entity.ChinaWord;
+import cn.bootx.platform.baseapi.dto.chinaword.ChinaWordDto;
+import cn.bootx.platform.baseapi.param.chinaword.ChinaWordParam;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * 敏感词
+ * @author xxm
+ * @since 2023-08-09
+ */
+@Mapper
+public interface ChinaWordConvert {
+ ChinaWordConvert CONVERT = Mappers.getMapper(ChinaWordConvert.class);
+
+ ChinaWord convert(ChinaWordParam in);
+
+ ChinaWordDto convert(ChinaWord in);
+
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/convert/ChinaWordImportType.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/convert/ChinaWordImportType.java
new file mode 100644
index 0000000000000000000000000000000000000000..fbe108335974120081a379323248f37fc01d477d
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/convert/ChinaWordImportType.java
@@ -0,0 +1,30 @@
+package cn.bootx.platform.baseapi.core.chinaword.convert;
+
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.converters.ReadConverterContext;
+import com.alibaba.excel.enums.CellDataTypeEnum;
+
+public class ChinaWordImportType implements Converter {
+
+ @Override
+ public Class> supportJavaTypeKey() {
+ return String.class;
+ }
+
+ @Override
+ public CellDataTypeEnum supportExcelTypeKey() {
+ return CellDataTypeEnum.STRING;
+ }
+
+ /**
+ * 这里读的时候会调用
+ *
+ * @param context
+ * @return
+ */
+ @Override
+ public String convertToJavaData(ReadConverterContext> context) {
+
+ return "自定义:" + context.getReadCellData().getStringValue();
+ }
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/dao/ChinaWordManager.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/dao/ChinaWordManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..4f85fecd45b49a0a2df1c5887f6319f8280cc69e
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/dao/ChinaWordManager.java
@@ -0,0 +1,39 @@
+package cn.bootx.platform.baseapi.core.chinaword.dao;
+
+import cn.bootx.platform.baseapi.core.chinaword.entity.ChinaWord;
+import cn.bootx.platform.baseapi.param.chinaword.ChinaWordParam;
+import cn.bootx.platform.common.core.rest.param.PageParam;
+import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
+import cn.bootx.platform.common.mybatisplus.util.MpUtil;
+import cn.bootx.platform.common.query.generator.QueryGenerator;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 敏感词
+ * @author xxm
+ * @since 2023-08-09
+ */
+@Repository
+@RequiredArgsConstructor
+public class ChinaWordManager extends BaseManager {
+
+ public List findAllByEnable(boolean enable){
+ return findAllByField(ChinaWord::getEnable,enable);
+ }
+
+ /**
+ * 分页
+ */
+ public Page page(PageParam pageParam, ChinaWordParam param) {
+ Page mpPage = MpUtil.getMpPage(pageParam, ChinaWord.class);
+ QueryWrapper wrapper = QueryGenerator.generator(param, this.getEntityClass());
+ wrapper.select(this.getEntityClass(),MpUtil::excludeBigField)
+ .orderByDesc(MpUtil.getColumnName(ChinaWord::getId));
+ return this.page(mpPage,wrapper);
+ }
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/dao/ChinaWordMapper.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/dao/ChinaWordMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..68ba3babfd45931e88aacd4bffd9d532afa4dd1b
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/dao/ChinaWordMapper.java
@@ -0,0 +1,14 @@
+package cn.bootx.platform.baseapi.core.chinaword.dao;
+
+import cn.bootx.platform.baseapi.core.chinaword.entity.ChinaWord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 敏感词
+ * @author xxm
+ * @since 2023-08-09
+ */
+@Mapper
+public interface ChinaWordMapper extends BaseMapper {
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/entity/ChinaWord.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/entity/ChinaWord.java
index 0d3049a879088f27ffbbe9731f993576fd60707c..5f939c9a9bb0a155fbbd399a8429881617fcc682 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/entity/ChinaWord.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/entity/ChinaWord.java
@@ -1,16 +1,18 @@
package cn.bootx.platform.baseapi.core.chinaword.entity;
+import cn.bootx.mybatis.table.modify.annotation.DbColumn;
import cn.bootx.mybatis.table.modify.annotation.DbTable;
+import cn.bootx.platform.baseapi.core.chinaword.convert.ChinaWordConvert;
+import cn.bootx.platform.baseapi.dto.chinaword.ChinaWordDto;
+import cn.bootx.platform.baseapi.param.chinaword.ChinaWordParam;
+import cn.bootx.platform.common.core.function.EntityBaseFunction;
import cn.bootx.platform.common.mybatisplus.base.MpDelEntity;
-import cn.bootx.platform.common.mybatisplus.handler.StringListTypeHandler;
-import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
-import java.util.List;
-
/**
* 敏感词
* @author xxm
@@ -18,22 +20,34 @@ import java.util.List;
*/
@EqualsAndHashCode(callSuper = true)
@Data
-@DbTable(comment = "敏感词")
+//@DbTable(comment = "敏感词")
@Accessors(chain = true)
@TableName(value = "base_china_word",autoResultMap = true)
-public class ChinaWord extends MpDelEntity {
+public class ChinaWord extends MpDelEntity implements EntityBaseFunction {
/** 敏感词 */
- private String name;
+ @DbColumn(comment = "敏感词")
+ private String word;
+ /** 类型 */
+ @DbColumn(comment = "分类")
+ private String type;
/** 描述 */
+ @DbColumn(comment = "描述")
private String description;
- /**
- * 标签数组
- * 不同的业务场景下,需要启用不同标签的敏感词。
- *
- */
- @TableField(typeHandler = StringListTypeHandler.class)
- private List tags;
/** 是否启用 */
+ @DbColumn(comment = "是否启用")
private Boolean enable;
+ @Schema(description = "是否是白名单名词")
+ private Boolean white;
+
+ /** 创建对象 */
+ public static ChinaWord init(ChinaWordParam in) {
+ return ChinaWordConvert.CONVERT.convert(in);
+ }
+
+ /** 转换成dto */
+ @Override
+ public ChinaWordDto toDto() {
+ return ChinaWordConvert.CONVERT.convert(this);
+ }
}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/service/ChinaWordService.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/service/ChinaWordService.java
new file mode 100644
index 0000000000000000000000000000000000000000..91ecac63308d8a28d1ffbd87f7c95d9e63bfaab3
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/service/ChinaWordService.java
@@ -0,0 +1,171 @@
+package cn.bootx.platform.baseapi.core.chinaword.service;
+
+import cn.bootx.platform.baseapi.core.chinaword.dao.ChinaWordManager;
+import cn.bootx.platform.baseapi.core.chinaword.entity.ChinaWord;
+import cn.bootx.platform.baseapi.core.chinaword.wordfilter.WordContext;
+import cn.bootx.platform.baseapi.core.chinaword.wordfilter.WordFilter;
+import cn.bootx.platform.baseapi.core.chinaword.wordfilter.WordType;
+import cn.bootx.platform.baseapi.dto.chinaword.ChinaWordDto;
+import cn.bootx.platform.baseapi.dto.chinaword.ChinaWordVerifyResult;
+import cn.bootx.platform.baseapi.param.chinaword.ChinaWordImportParam;
+import cn.bootx.platform.baseapi.param.chinaword.ChinaWordParam;
+import cn.bootx.platform.common.core.exception.DataNotExistException;
+import cn.bootx.platform.common.core.rest.PageResult;
+import cn.bootx.platform.common.core.rest.param.PageParam;
+import cn.bootx.platform.common.core.util.ResultConvertUtil;
+import cn.bootx.platform.common.mybatisplus.util.MpUtil;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.event.SyncReadListener;
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.web.context.WebServerInitializedEvent;
+import org.springframework.context.event.EventListener;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * 敏感词服务
+ * @author xxm
+ * @since 2023/8/9
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class ChinaWordService {
+ private final WordContext wordContext;
+ private final WordFilter wordFilter;
+
+ private final ChinaWordManager chinaWordManager;
+
+ /**
+ * 添加
+ */
+ public void add(ChinaWordParam param){
+ ChinaWord chinaWord = ChinaWord.init(param);
+ this.updateWord(chinaWord);
+ chinaWordManager.save(chinaWord);
+
+ }
+
+ /**
+ * 批量导入
+ */
+ @SneakyThrows
+ @Transactional(rollbackFor = Exception.class)
+ public void importBatch(MultipartFile file, String type){
+ InputStream inputStream = file.getInputStream();
+ //同步读取文件内容
+ SyncReadListener syncReadListener = new SyncReadListener();
+ EasyExcel.read(inputStream, syncReadListener)
+ .head(ChinaWordImportParam.class)
+ .sheet().doRead();
+ syncReadListener.getList();
+ }
+
+ /**
+ * 修改
+ */
+ public void update(ChinaWordParam param){
+ ChinaWord ChinaWord = chinaWordManager.findById(param.getId()).orElseThrow(DataNotExistException::new);
+ BeanUtil.copyProperties(param,ChinaWord, CopyOptions.create().ignoreNullValue());
+ refresh();
+ chinaWordManager.updateById(ChinaWord);
+ }
+
+ /**
+ * 分页
+ */
+ public PageResult page(PageParam pageParam, ChinaWordParam query){
+ return MpUtil.convert2DtoPageResult(chinaWordManager.page(pageParam,query));
+ }
+
+ /**
+ * 获取单条
+ */
+ public ChinaWordDto findById(Long id){
+ return chinaWordManager.findById(id).map(ChinaWord::toDto).orElseThrow(DataNotExistException::new);
+ }
+
+ /**
+ * 获取全部
+ */
+ public List findAll(){
+ return ResultConvertUtil.dtoListConvert(chinaWordManager.findAll());
+ }
+
+ /**
+ * 删除
+ */
+ public void delete(Long id){
+ refresh();
+ chinaWordManager.deleteById(id);
+ }
+
+ /**
+ * 测试敏感词效果
+ */
+ public ChinaWordVerifyResult verify(String text, int skip, char symbol){
+ ChinaWordVerifyResult result = new ChinaWordVerifyResult();
+ if (wordFilter.include(text,skip)) {
+ String replaceText = wordFilter.replace(text, skip, symbol);
+ int count = wordFilter.wordCount(text, skip);
+ Set wordList = wordFilter.wordList(text, skip);
+ result.setText(replaceText)
+ .setCount(count)
+ .setSensitiveWords(wordList)
+ .setSensitive(true);
+ }
+ return result;
+ }
+
+ /**
+ * 刷新缓存
+ */
+ public void refresh(){
+ initData();
+ }
+
+ /**
+ * 更新敏感词库
+ */
+ public void updateWord(ChinaWord chinaWord){
+ if (Objects.equals(chinaWord.getEnable(),true)){
+ if (Objects.equals(chinaWord.getWhite(),true)){
+ wordContext.addWord(Collections.singleton(chinaWord.getWord()), WordType.WHITE);
+ } else {
+ wordContext.addWord(Collections.singleton(chinaWord.getWord()), WordType.BLACK);
+ }
+ }
+ }
+
+ /**
+ * 初始化数据
+ */
+ @EventListener(WebServerInitializedEvent.class)
+ public void initData(){
+ List chinaWords = chinaWordManager.findAllByEnable(true);
+ // 黑名单
+ Set black = chinaWords.stream()
+ .filter(o -> Objects.equals(o.getWhite(), false))
+ .map(ChinaWord::getWord)
+ .collect(Collectors.toSet());
+ // 白名单
+ Set white = chinaWords.stream()
+ .filter(o -> Objects.equals(o.getWhite(), true))
+ .map(ChinaWord::getWord)
+ .collect(Collectors.toSet());
+
+ wordContext.initKeyWord(black,white);
+ }
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/FlagIndex.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/FlagIndex.java
index 19d0450e0b71c9bf5af8755f11aa64338b9ce62f..be55975a66b851c40fd2f82af2eb4c4ad9b5f2ba 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/FlagIndex.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/FlagIndex.java
@@ -1,5 +1,8 @@
package cn.bootx.platform.baseapi.core.chinaword.wordfilter;
+import lombok.Getter;
+import lombok.Setter;
+
import java.util.List;
/**
@@ -7,6 +10,8 @@ import java.util.List;
*
* @author minghu.zhang
*/
+@Getter
+@Setter
public class FlagIndex {
/**
@@ -22,27 +27,4 @@ public class FlagIndex {
*/
private List index;
- public boolean isFlag() {
- return flag;
- }
-
- public void setFlag(boolean flag) {
- this.flag = flag;
- }
-
- public List getIndex() {
- return index;
- }
-
- public void setIndex(List index) {
- this.index = index;
- }
-
- public boolean isWhiteWord() {
- return isWhiteWord;
- }
-
- public void setWhiteWord(boolean whiteWord) {
- isWhiteWord = whiteWord;
- }
}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/WordContext.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/WordContext.java
index fe4e49605f5a787b43240ec6f5589eae505d8ea5..8dc6986074a53c7d29a88c56586ed18caaa7a14d 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/WordContext.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/WordContext.java
@@ -1,8 +1,17 @@
package cn.bootx.platform.baseapi.core.chinaword.wordfilter;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.util.*;
+import lombok.Getter;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static cn.bootx.platform.baseapi.code.WordFilterCode.IS_END;
+import static cn.bootx.platform.baseapi.code.WordFilterCode.IS_WHITE_WORD;
+
/**
* 词库上下文环境
*
@@ -10,6 +19,9 @@ import java.util.*;
*
* @author minghu.zhang
*/
+@Getter
+@Service
+@Component
@SuppressWarnings({"rawtypes", "unchecked"})
public class WordContext {
@@ -19,51 +31,15 @@ public class WordContext {
private final Map wordMap = new HashMap(1024);
/**
- * 是否已初始化
- */
- private boolean init;
- /**
- * 黑名单列表
- */
- private final String blackList;
- /**
- * 白名单列表
- */
- private final String whiteList;
-
- public WordContext() {
- this.blackList = "/blacklist.txt";
- this.whiteList = "/whitelist.txt";
- initKeyWord();
- }
-
- public WordContext(String blackList, String whiteList) {
- this.blackList = blackList;
- this.whiteList = whiteList;
- initKeyWord();
- }
-
- /**
- * 获取初始化的敏感词列表
- *
- * @return 敏感词列表
+ * 初始化敏感词库
*/
- public Map getWordMap() {
- return wordMap;
- }
-
- /**
- * 初始化
- */
- private synchronized void initKeyWord() {
+ public synchronized void initKeyWord(Iterable blackList,Iterable whiteList) {
try {
- if (!init) {
- // 将敏感词库加入到HashMap中
- addWord(readWordFile(blackList), WordType.BLACK);
- // 将非敏感词库也加入到HashMap中
- addWord(readWordFile(whiteList), WordType.WHITE);
- }
- init = true;
+ wordMap.clear();
+ // 将敏感词库加入到HashMap中
+ addWord(blackList, WordType.BLACK);
+ // 将非敏感词库也加入到HashMap中
+ addWord(whiteList, WordType.WHITE );
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -75,7 +51,7 @@ public class WordContext {
* isEnd = 1 人 = {isEnd = 0 民 = {isEnd = 1} } 男 = { isEnd = 0 人 = { isEnd = 1 }
* } } } 五 = { isEnd = 0 星 = { isEnd = 0 红 = { isEnd = 0 旗 = { isEnd = 1 } } } }
*/
- public void addWord(Iterable wordList, WordType wordType) {
+ public synchronized void addWord(Iterable wordList, WordType wordType) {
Map nowMap;
Map newWorMap;
// 迭代keyWordSet
@@ -93,15 +69,15 @@ public class WordContext {
// 不存在则构建一个map,同时将isEnd设置为0,因为他不是最后一个
newWorMap = new HashMap<>(4);
// 不是最后一个
- newWorMap.put("isEnd", String.valueOf(EndType.HAS_NEXT.ordinal()));
+ newWorMap.put(IS_END, String.valueOf(EndType.HAS_NEXT.ordinal()));
nowMap.put(keyChar, newWorMap);
nowMap = newWorMap;
}
if (i == key.length() - 1) {
// 最后一个
- nowMap.put("isEnd", String.valueOf(EndType.IS_END.ordinal()));
- nowMap.put("isWhiteWord", String.valueOf(wordType.ordinal()));
+ nowMap.put(IS_END, String.valueOf(EndType.IS_END.ordinal()));
+ nowMap.put(IS_WHITE_WORD, String.valueOf(wordType.ordinal()));
}
}
}
@@ -136,25 +112,25 @@ public class WordContext {
for (int j = cacheList.size() - 1; j >= 0; j--) {
Map cacheMap = cacheList.get(j);
if (j == cacheList.size() - 1) {
- if (String.valueOf(WordType.BLACK.ordinal()).equals(cacheMap.get("isWhiteWord"))) {
+ if (String.valueOf(WordType.BLACK.ordinal()).equals(cacheMap.get(IS_WHITE_WORD))) {
if (wordType == WordType.WHITE) {
return;
}
}
- if (String.valueOf(WordType.WHITE.ordinal()).equals(cacheMap.get("isWhiteWord"))) {
+ if (String.valueOf(WordType.WHITE.ordinal()).equals(cacheMap.get(IS_WHITE_WORD))) {
if (wordType == WordType.BLACK) {
return;
}
}
- cacheMap.remove("isWhiteWord");
- cacheMap.remove("isEnd");
- if (cacheMap.size() == 0) {
+ cacheMap.remove(IS_WHITE_WORD);
+ cacheMap.remove(IS_END);
+ if (cacheMap.isEmpty()) {
cleanable = true;
continue;
}
}
if (cleanable) {
- Object isEnd = cacheMap.get("isEnd");
+ Object isEnd = cacheMap.get(IS_END);
if (String.valueOf(EndType.IS_END.ordinal()).equals(isEnd)) {
cleanable = false;
}
@@ -170,25 +146,4 @@ public class WordContext {
}
}
}
-
- /**
- * 读取敏感词库中的内容,将内容添加到set集合中
- */
- private Set readWordFile(String file) throws Exception {
- Set set;
- // 字符编码
- String encoding = "UTF-8";
- try (InputStreamReader read = new InputStreamReader(
- this.getClass().getResourceAsStream(file), encoding)) {
- set = new HashSet<>();
- BufferedReader bufferedReader = new BufferedReader(read);
- String txt;
- // 读取文件,将文件内容放入到set中
- while ((txt = bufferedReader.readLine()) != null) {
- set.add(txt);
- }
- }
- // 关闭文件流
- return set;
- }
}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/WordFilter.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/WordFilter.java
index 9f871574f73641c744a2a16d8a882d858e815940..f558ceb504b4090e3702cfd00ff8324e08f4c96f 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/WordFilter.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/chinaword/wordfilter/WordFilter.java
@@ -1,30 +1,20 @@
package cn.bootx.platform.baseapi.core.chinaword.wordfilter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
/**
* 敏感词过滤器
*
* @author minghu.zhang
*/
+@Component
+@RequiredArgsConstructor
@SuppressWarnings("rawtypes")
public class WordFilter {
-
- /**
- * 敏感词表
- */
- private final Map wordMap;
-
- /**
- * 构造函数
- */
- public WordFilter(WordContext context) {
- this.wordMap = context.getWordMap();
- }
-
+ private final WordContext context;
/**
* 替换敏感词
*
@@ -36,6 +26,11 @@ public class WordFilter {
/**
* 替换敏感词
+ * 查找敏感词,距离越长,过滤越严格,效率越低,开发者可以根据具体需求设置,
+ * 这里以“紧急”为敏感词举例,以此类推:
+ * 0 匹配紧急
+ * 1 匹配不紧不急,紧x急
+ * 2 匹配紧急,紧x急,紧xx急
*
* @param text 输入文本
* @param symbol 替换符号
@@ -78,7 +73,12 @@ public class WordFilter {
}
/**
- * 是否包含敏感词
+ * 是否包含敏感词, 程序会跳过不同的距离,
+ * 查找敏感词,距离越长,过滤越严格,效率越低,开发者可以根据具体需求设置,
+ * 这里以“紧急”为敏感词举例,以此类推:
+ * 0 匹配紧急
+ * 1 匹配不紧不急,紧x急
+ * 2 匹配紧急,紧x急,紧xx急
*
* @param text 输入文本
* @param skip 文本距离
@@ -136,7 +136,7 @@ public class WordFilter {
*
* @param text 输入文本
*/
- public List wordList(final String text) {
+ public Set wordList(String text) {
return wordList(text, 0);
}
@@ -146,8 +146,8 @@ public class WordFilter {
* @param text 输入文本
* @param skip 文本距离
*/
- public List wordList(final String text, final int skip) {
- List wordList = new ArrayList<>();
+ public Set wordList(final String text, final int skip) {
+ Set wordSet = new LinkedHashSet<>();
char[] charset = text.toCharArray();
for (int i = 0; i < charset.length; i++) {
FlagIndex fi = getFlagIndex(charset, i, skip);
@@ -160,11 +160,11 @@ public class WordFilter {
char word = text.charAt(j);
builder.append(word);
}
- wordList.add(builder.toString());
+ wordSet.add(builder.toString());
}
}
}
- return wordList;
+ return wordSet;
}
/**
@@ -177,7 +177,7 @@ public class WordFilter {
private FlagIndex getFlagIndex(final char[] charset, final int begin, final int skip) {
FlagIndex fi = new FlagIndex();
- Map current = wordMap;
+ Map current = context.getWordMap();
boolean flag = false;
int count = 0;
List index = new ArrayList<>();
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/keyvalue/entity/SysKeyValue.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/keyvalue/entity/SysKeyValue.java
index 45e0258bff9f44a9fd7ed8e8cf45624f5625e44c..8efc40adeb625bf8c6a83d888b72349a1a7fdcba 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/keyvalue/entity/SysKeyValue.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/keyvalue/entity/SysKeyValue.java
@@ -1,7 +1,7 @@
package cn.bootx.platform.baseapi.core.keyvalue.entity;
import cn.bootx.platform.common.core.rest.dto.KeyValue;
-import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
+import cn.bootx.platform.common.mybatisplus.base.MpDelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -21,7 +21,7 @@ import lombok.experimental.Accessors;
@AllArgsConstructor
@Accessors(chain = true)
@TableName("base_key_value")
-public class SysKeyValue extends MpBaseEntity {
+public class SysKeyValue extends MpDelEntity {
/**
* key值
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/keyvalue/service/SysKeyValueService.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/keyvalue/service/SysKeyValueService.java
index c994548d6b0f0b3507c3fadacbad3d39839f8375..d0f958c4013c609248cc6e5fb28c231ab67dc5b5 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/keyvalue/service/SysKeyValueService.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/keyvalue/service/SysKeyValueService.java
@@ -7,6 +7,7 @@ import cn.bootx.platform.baseapi.core.keyvalue.entity.SysKeyValue;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
@@ -54,11 +55,15 @@ public class SysKeyValueService implements SystemKeyValueService {
}
/**
- * 设置多个
+ * 保存多个值
*/
@Override
+ @Transactional(rollbackFor = Exception.class)
public void setupBatch(List list) {
-
+ List collect = list.stream()
+ .map(SysKeyValue::init)
+ .collect(Collectors.toList());
+ sysKeyValueManager.saveAll(collect);
}
}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/parameter/service/SystemParamService.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/parameter/service/SystemParamService.java
index fa75fe8c41b74ea3a36adfc81a63987580f20ba3..8ba49202392636aac0a7fe99e00e459d15286a97 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/parameter/service/SystemParamService.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/parameter/service/SystemParamService.java
@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Objects;
+import java.util.Optional;
/**
* 系统参数
@@ -117,7 +118,11 @@ public class SystemParamService implements ParamService {
*/
@Override
public String getValue(String key) {
- return systemParamManager.findByParamKey(key).map(SystemParameter::getValue).orElse(null);
+ Optional opt = systemParamManager.findByParamKey(key);
+ if (opt.isPresent()&&Objects.equals(opt.get().getEnable(), true)) {
+ return opt.map(SystemParameter::getValue).orElse(null);
+ }
+ return null;
}
}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/convert/GeneralTemplateConvert.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/convert/GeneralTemplateConvert.java
new file mode 100644
index 0000000000000000000000000000000000000000..8e54a50ffe73cd5c1a3ed870d47cca5ee776244a
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/convert/GeneralTemplateConvert.java
@@ -0,0 +1,22 @@
+package cn.bootx.platform.baseapi.core.template.convert;
+
+import cn.bootx.platform.baseapi.core.template.entity.GeneralTemplate;
+import cn.bootx.platform.baseapi.dto.template.GeneralTemplateDto;
+import cn.bootx.platform.baseapi.param.template.GeneralTemplateParam;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * 通用模板管理
+ * @author xxm
+ * @since 2023-08-12
+ */
+@Mapper
+public interface GeneralTemplateConvert {
+ GeneralTemplateConvert CONVERT = Mappers.getMapper(GeneralTemplateConvert.class);
+
+ GeneralTemplate convert(GeneralTemplateParam in);
+
+ GeneralTemplateDto convert(GeneralTemplate in);
+
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/dao/GeneralTemplateManager.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/dao/GeneralTemplateManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..ab25026e1098a2a777a8a5294ac799cbf3277913
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/dao/GeneralTemplateManager.java
@@ -0,0 +1,47 @@
+package cn.bootx.platform.baseapi.core.template.dao;
+
+import cn.bootx.platform.baseapi.core.template.entity.GeneralTemplate;
+import cn.bootx.platform.baseapi.param.template.GeneralTemplateParam;
+import cn.bootx.platform.common.core.rest.param.PageParam;
+import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
+import cn.bootx.platform.common.mybatisplus.util.MpUtil;
+import cn.bootx.platform.common.query.generator.QueryGenerator;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Repository;
+
+import java.util.Optional;
+
+/**
+ * 通用模板管理
+ * @author xxm
+ * @since 2023-08-12
+ */
+@Repository
+@RequiredArgsConstructor
+public class GeneralTemplateManager extends BaseManager {
+
+ /**
+ * 分页
+ */
+ public Page page(PageParam pageParam, GeneralTemplateParam param) {
+ Page mpPage = MpUtil.getMpPage(pageParam, GeneralTemplate.class);
+ QueryWrapper wrapper = QueryGenerator.generator(param, this.getEntityClass());
+ wrapper.select(this.getEntityClass(),MpUtil::excludeBigField)
+ .orderByDesc(MpUtil.getColumnName(GeneralTemplate::getId));
+ return this.page(mpPage,wrapper);
+ }
+
+ public Optional findByCode(String code){
+ return findByField(GeneralTemplate::getCode,code);
+ }
+
+ public boolean existsByCode(String code) {
+ return existedByField(GeneralTemplate::getCode, code);
+ }
+
+ public boolean existsByCode(String code, Long id) {
+ return existedByField(GeneralTemplate::getCode, code, id);
+ }
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/dao/GeneralTemplateMapper.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/dao/GeneralTemplateMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..02b6a9a1d281fb5a83e18f46974cc36bb2aa4083
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/dao/GeneralTemplateMapper.java
@@ -0,0 +1,14 @@
+package cn.bootx.platform.baseapi.core.template.dao;
+
+import cn.bootx.platform.baseapi.core.template.entity.GeneralTemplate;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 通用模板管理
+ * @author xxm
+ * @since 2023-08-12
+ */
+@Mapper
+public interface GeneralTemplateMapper extends BaseMapper {
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/entity/GeneralTemplate.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/entity/GeneralTemplate.java
new file mode 100644
index 0000000000000000000000000000000000000000..96754c0c66ef0195ea02487966fe6aed76ad5288
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/entity/GeneralTemplate.java
@@ -0,0 +1,79 @@
+package cn.bootx.platform.baseapi.core.template.entity;
+
+import cn.bootx.mybatis.table.modify.annotation.DbComment;
+import cn.bootx.mybatis.table.modify.annotation.DbTable;
+import cn.bootx.platform.baseapi.core.template.convert.GeneralTemplateConvert;
+import cn.bootx.platform.baseapi.dto.template.GeneralTemplateDto;
+import cn.bootx.platform.baseapi.param.template.GeneralTemplateParam;
+import cn.bootx.platform.common.core.function.EntityBaseFunction;
+import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * 通用模板管理
+ * @author xxm
+ * @since 2023/8/12
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+//@DbTable(comment = "通用模板管理")
+@Accessors(chain = true)
+@TableName("base_general_template")
+public class GeneralTemplate extends MpBaseEntity implements EntityBaseFunction {
+
+ /** 模板名称 */
+ @DbComment("模板名称")
+ private String name;
+
+ /** 模板代码 */
+ @DbComment("模板代码")
+ private String code;
+
+ /**
+ * 使用类型(导入/导出)
+ * @see cn.bootx.platform.baseapi.code.GeneralTemplateCode
+ */
+ @DbComment("使用类型(导入/导出)")
+ private String useType;
+
+ /** 模板类型 */
+ @DbComment("模板类型")
+ private String fileType;
+
+ /** 模板后缀名 */
+ @DbComment("模板后缀名")
+ private String fileSuffix;
+
+ /**
+ * 状态
+ * @see cn.bootx.platform.baseapi.code.GeneralTemplateCode
+ */
+ @DbComment("状态")
+ private String state;
+
+ /** 文件ID */
+ @DbComment("文件ID")
+ @TableField(updateStrategy = FieldStrategy.IGNORED)
+ private Long fileId;
+
+ /** 备注 */
+ @DbComment("备注")
+ private String remark;
+
+
+ /** 创建对象 */
+ public static GeneralTemplate init(GeneralTemplateParam in) {
+ return GeneralTemplateConvert.CONVERT.convert(in);
+ }
+
+ /** 转换成dto */
+ @Override
+ public GeneralTemplateDto toDto() {
+ return GeneralTemplateConvert.CONVERT.convert(this);
+ }
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/service/GeneralTemplateService.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/service/GeneralTemplateService.java
new file mode 100644
index 0000000000000000000000000000000000000000..f9761f82b4928137cd534dd9e72e183bf77ea113
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/core/template/service/GeneralTemplateService.java
@@ -0,0 +1,112 @@
+package cn.bootx.platform.baseapi.core.template.service;
+
+import cn.bootx.platform.baseapi.core.template.dao.GeneralTemplateManager;
+import cn.bootx.platform.baseapi.core.template.entity.GeneralTemplate;
+import cn.bootx.platform.baseapi.dto.template.GeneralTemplateDto;
+import cn.bootx.platform.baseapi.param.template.GeneralTemplateParam;
+import cn.bootx.platform.common.core.exception.BizException;
+import cn.bootx.platform.common.core.exception.DataNotExistException;
+import cn.bootx.platform.common.core.rest.PageResult;
+import cn.bootx.platform.common.core.rest.param.PageParam;
+import cn.bootx.platform.common.core.util.ResultConvertUtil;
+import cn.bootx.platform.common.mybatisplus.util.MpUtil;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 通用模板管理
+ * @author xxm
+ * @since 2023-08-12
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GeneralTemplateService {
+ private final GeneralTemplateManager generalTemplateManager;
+
+ /**
+ * 添加
+ */
+ public void add(GeneralTemplateParam param){
+ if (generalTemplateManager.existsByCode(param.getCode())) {
+ throw new BizException("code重复");
+ }
+ GeneralTemplate generalTemplate = GeneralTemplate.init(param);
+ generalTemplateManager.save(generalTemplate);
+ }
+
+ /**
+ * 修改
+ */
+ public void update(GeneralTemplateParam param){
+ if (generalTemplateManager.existsByCode(param.getCode(),param.getId())) {
+ throw new BizException("code重复");
+ }
+ GeneralTemplate generalTemplate = generalTemplateManager.findById(param.getId()).orElseThrow(DataNotExistException::new);
+ BeanUtil.copyProperties(param,generalTemplate, CopyOptions.create().ignoreNullValue());
+ generalTemplateManager.updateById(generalTemplate);
+ }
+
+ /**
+ * 分页
+ */
+ public PageResult page(PageParam pageParam,GeneralTemplateParam query){
+ return MpUtil.convert2DtoPageResult(generalTemplateManager.page(pageParam,query));
+ }
+
+ /**
+ * 获取单条
+ */
+ public GeneralTemplateDto findById(Long id){
+ return generalTemplateManager.findById(id).map(GeneralTemplate::toDto).orElseThrow(DataNotExistException::new);
+ }
+
+ /**
+ * 根据编码获取
+ */
+ public GeneralTemplateDto findByCode(String code){
+ return generalTemplateManager.findByCode(code).map(GeneralTemplate::toDto).orElseThrow(DataNotExistException::new);
+ }
+
+ /**
+ * 获取全部
+ */
+ public List findAll(){
+ return ResultConvertUtil.dtoListConvert(generalTemplateManager.findAll());
+ }
+
+
+ /**
+ * code是否存在
+ */
+ public boolean existsByCode(String code) {
+ return generalTemplateManager.existsByCode(code);
+ }
+
+ /**
+ * code是否存在
+ */
+ public boolean existsByCode(String code, Long id) {
+ return generalTemplateManager.existsByCode(code, id);
+ }
+
+ /**
+ * 删除
+ */
+ public void delete(Long id){
+ generalTemplateManager.deleteById(id);
+ }
+
+ /**
+ * 批量删除
+ */
+ public void deleteBatch(List ids){
+ generalTemplateManager.deleteByIds(ids);
+ }
+
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/captcha/CaptchaDataResult.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/captcha/CaptchaDataResult.java
index 936dd5f60804853d8ade5db7f11782db725c0a4a..234324a14a48525ef2064c205faab9ae0d0aab87 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/captcha/CaptchaDataResult.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/captcha/CaptchaDataResult.java
@@ -1,6 +1,5 @@
package cn.bootx.platform.baseapi.dto.captcha;
-import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
@@ -16,7 +15,7 @@ import lombok.experimental.Accessors;
@Schema(title = "验证码数据")
public class CaptchaDataResult {
- @Schema(description = "验证码标示")
+ @Schema(description = "验证码标识KEY")
private String captchaKey;
@Schema(description = "验证码base64数据")
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/app/AppVersionDto.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/chinaword/ChinaWordDto.java
similarity index 40%
rename from bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/app/AppVersionDto.java
rename to bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/chinaword/ChinaWordDto.java
index cf511e756983eed5fb2a30a88f6b606050d21d0d..f31a395b9328079f8fd0dff4ed455448fc788d43 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/app/AppVersionDto.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/chinaword/ChinaWordDto.java
@@ -1,4 +1,4 @@
-package cn.bootx.platform.baseapi.dto.app;
+package cn.bootx.platform.baseapi.dto.chinaword;
import cn.bootx.platform.common.core.rest.dto.BaseDto;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -6,33 +6,25 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
-import java.io.Serializable;
-
/**
+ * 敏感词
* @author xxm
- * @since 2021/8/9
+ * @since 2023-08-09
*/
@EqualsAndHashCode(callSuper = true)
@Data
+@Schema(title = "敏感词")
@Accessors(chain = true)
-@Schema(title = "app版本")
-public class AppVersionDto extends BaseDto implements Serializable {
-
- private static final long serialVersionUID = -7287549085443499458L;
-
- /** app版本 */
- private String appVersion;
-
- /** 下载地址 */
- private String url;
+public class ChinaWordDto extends BaseDto {
- /** 密码 */
- private String password;
-
- /** 包名 */
- private String bundleId;
-
- /** 说明 */
+ @Schema(description = "敏感词")
+ private String word;
+ @Schema(description = "分类")
+ private String type;
+ @Schema(description = "描述")
private String description;
-
+ @Schema(description = "是否启用")
+ private Boolean enable;
+ @Schema(description = "是否是白名单名词")
+ private Boolean white;
}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/chinaword/ChinaWordVerifyResult.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/chinaword/ChinaWordVerifyResult.java
new file mode 100644
index 0000000000000000000000000000000000000000..dc8887f5974961b7f6ed59923e32b4540b9cc605
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/chinaword/ChinaWordVerifyResult.java
@@ -0,0 +1,27 @@
+package cn.bootx.platform.baseapi.dto.chinaword;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.Set;
+
+/**
+ * 敏感词验证结果
+ * @author xxm
+ * @since 2023/8/9
+ */
+@Data
+@Accessors(chain = true)
+@Schema(title = "敏感词验证结果")
+public class ChinaWordVerifyResult {
+
+ @Schema(description = "是否敏感")
+ private boolean sensitive;
+ @Schema(description = "敏感词数量")
+ private int count;
+ @Schema(description = "去重后的敏感词列表")
+ private Set sensitiveWords;
+ @Schema(description = "脱敏后的文本")
+ private String text;
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/template/GeneralTemplateDto.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/template/GeneralTemplateDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..cb2ccfc7332f7ab62d9ffdad88cfa645842b6b9d
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/dto/template/GeneralTemplateDto.java
@@ -0,0 +1,41 @@
+package cn.bootx.platform.baseapi.dto.template;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.LocalDate;
+
+import cn.bootx.platform.common.core.rest.dto.BaseDto;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * 通用模板管理
+ * @author xxm
+ * @since 2023-08-12
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Schema(title = "通用模板管理")
+@Accessors(chain = true)
+public class GeneralTemplateDto extends BaseDto {
+
+ @Schema(description = "模板名称")
+ private String name;
+ @Schema(description = "模板代码")
+ private String code;
+ @Schema(description = "使用类型(导入/导出)")
+ private String useType;
+ @Schema(description = "模板类型")
+ private String fileType;
+ @Schema(description = "模板后缀名")
+ private String fileSuffix;
+ @Schema(description = "状态")
+ private String state;
+ @Schema(description = "文件ID")
+ private Long fileId;
+ @Schema(description = "备注")
+ private String remark;
+
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/chinaword/ChinaWordImportParam.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/chinaword/ChinaWordImportParam.java
new file mode 100644
index 0000000000000000000000000000000000000000..5edd178b8ce976696cf4279654210680fffda7ff
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/chinaword/ChinaWordImportParam.java
@@ -0,0 +1,19 @@
+package cn.bootx.platform.baseapi.param.chinaword;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+/**
+ * 敏感词导入参数
+ * @author xxm
+ * @since 2023/8/12
+ */
+@Data
+public class ChinaWordImportParam {
+ @ExcelProperty(value = "类型")
+ private String type;
+ @ExcelProperty("黑/白名单")
+ private String whiteOrBlack;
+ @ExcelProperty("敏感词")
+ private String word;
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/app/AppVersionParam.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/chinaword/ChinaWordParam.java
similarity index 31%
rename from bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/app/AppVersionParam.java
rename to bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/chinaword/ChinaWordParam.java
index 8bca41b164c04fde66e0de5a2636f93cbb3b748f..3e5c1fc78ae2d0760740a62746660597ebdfca0d 100644
--- a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/app/AppVersionParam.java
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/chinaword/ChinaWordParam.java
@@ -1,35 +1,31 @@
-package cn.bootx.platform.baseapi.param.app;
+package cn.bootx.platform.baseapi.param.chinaword;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
/**
- * app版本参数
- *
+ * 敏感词
* @author xxm
- * @since 2021/8/9
+ * @since 2023-08-09
*/
@Data
+@Schema(title = "敏感词")
@Accessors(chain = true)
-@Schema(title = "app版本参数")
-public class AppVersionParam {
+public class ChinaWordParam {
+ @Schema(description= "主键")
private Long id;
- /** app版本 */
- private String appVersion;
-
- /** 下载地址 */
- private String url;
-
- /** 密码 */
- private String password;
-
- /** 包名 */
- private String bundleId;
-
- /** 说明 */
+ @Schema(description = "敏感词")
+ private String word;
+ @Schema(description = "分类")
+ private String type;
+ @Schema(description = "描述")
private String description;
+ @Schema(description = "是否启用")
+ private Boolean enable;
+ @Schema(description = "白名单名词")
+ private Boolean white;
}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/chinaword/ChinaWordVerifyParam.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/chinaword/ChinaWordVerifyParam.java
new file mode 100644
index 0000000000000000000000000000000000000000..46d2465a6e30132e5588f970f2f5c063de29ae96
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/chinaword/ChinaWordVerifyParam.java
@@ -0,0 +1,24 @@
+package cn.bootx.platform.baseapi.param.chinaword;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * 敏感词验证参数类
+ * @author xxm
+ * @since 2023/8/10
+ */
+@Data
+@Accessors(chain = true)
+@Schema(title = "敏感词验证参数类")
+public class ChinaWordVerifyParam {
+ @Schema(description = "文本")
+ private String text;
+
+ @Schema(description = "间隔距离")
+ private int skip = 0;
+
+ @Schema(description = "替换字符")
+ private char symbol = '*';
+}
diff --git a/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/template/GeneralTemplateParam.java b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/template/GeneralTemplateParam.java
new file mode 100644
index 0000000000000000000000000000000000000000..b5f7fbdf0a609a2a3bbac3031ff061e42559ea3d
--- /dev/null
+++ b/bootx-services/service-baseapi/src/main/java/cn/bootx/platform/baseapi/param/template/GeneralTemplateParam.java
@@ -0,0 +1,37 @@
+package cn.bootx.platform.baseapi.param.template;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * 通用模板管理
+ * @author xxm
+ * @since 2023-08-12
+ */
+@Data
+@Schema(title = "通用模板管理")
+@Accessors(chain = true)
+public class GeneralTemplateParam {
+
+ @Schema(description= "主键")
+ private Long id;
+
+ @Schema(description = "模板名称")
+ private String name;
+ @Schema(description = "模板代码")
+ private String code;
+ @Schema(description = "使用类型(导入/导出)")
+ private String useType;
+ @Schema(description = "模板类型")
+ private String fileType;
+ @Schema(description = "模板后缀名")
+ private String fileSuffix;
+ @Schema(description = "状态")
+ private String state;
+ @Schema(description = "文件ID")
+ private Long fileId;
+ @Schema(description = "备注")
+ private String remark;
+
+}
diff --git a/bootx-services/service-iam/pom.xml b/bootx-services/service-iam/pom.xml
index 0a92ea4c9a8eef2be175ebda1121229798a5855f..e31de0c6b5cc1fd1d06851677b01bc3e9aa06e27 100644
--- a/bootx-services/service-iam/pom.xml
+++ b/bootx-services/service-iam/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-services
- 1.3.3
+ 1.3.4
4.0.0
@@ -38,6 +38,12 @@
service-baseapi
${bootx-platform.version}
+
+
+ cn.bootx.platform
+ service-platform
+ ${bootx-platform.version}
+
cn.bootx.platform
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/controller/UserAdminController.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/controller/UserAdminController.java
index 227513d3224169e7c9fb89a763cc72666195f290..53250294d769eeec1082f82b324a09f30836c8b0 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/controller/UserAdminController.java
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/controller/UserAdminController.java
@@ -83,6 +83,15 @@ public class UserAdminController {
return Res.ok();
}
+ @Operation(summary = "批量重置密码")
+ @OperateLog(title = "批量重置密码", businessType = OperateLog.BusinessType.UPDATE, saveParam = true)
+ @PostMapping("/restartPasswordBatch")
+ public ResResult restartPasswordBatch(@NotEmpty(message = "用户不可为空") @RequestBody List userIds,
+ @NotBlank(message = "新密码不能为空") String newPassword) {
+ userAdminService.restartPasswordBatch(userIds, newPassword);
+ return Res.ok();
+ }
+
@OperateLog(title = "锁定用户", businessType = OperateLog.BusinessType.UPDATE, saveParam = true)
@Operation(summary = "锁定用户")
@PostMapping("/lock")
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/login/PasswordLoginHandler.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/login/PasswordLoginHandler.java
index 83cd5d891c41ba917f02f3c679a1c0b9a4e9d143..45a00ae611e16c795a34039d1b0b7b3e2d9819da 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/login/PasswordLoginHandler.java
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/login/PasswordLoginHandler.java
@@ -1,10 +1,13 @@
package cn.bootx.platform.iam.core.auth.login;
+import cn.bootx.platform.baseapi.core.captcha.service.CaptchaService;
import cn.bootx.platform.common.core.entity.UserDetail;
import cn.bootx.platform.common.core.exception.BizException;
import cn.bootx.platform.common.core.util.RegexUtil;
+import cn.bootx.platform.iam.code.UserStatusCode;
import cn.bootx.platform.iam.core.user.service.UserAdminService;
import cn.bootx.platform.iam.core.user.service.UserQueryService;
+import cn.bootx.platform.iam.dto.user.UserInfoDto;
import cn.bootx.platform.starter.auth.authentication.UsernamePasswordAuthentication;
import cn.bootx.platform.starter.auth.entity.AuthInfoResult;
import cn.bootx.platform.starter.auth.entity.AuthLoginType;
@@ -12,9 +15,6 @@ import cn.bootx.platform.starter.auth.entity.LoginAuthContext;
import cn.bootx.platform.starter.auth.exception.LoginFailureException;
import cn.bootx.platform.starter.auth.exception.UserNotFoundException;
import cn.bootx.platform.starter.auth.util.PasswordEncoder;
-import cn.bootx.platform.baseapi.core.captcha.service.CaptchaService;
-import cn.bootx.platform.iam.code.UserStatusCode;
-import cn.bootx.platform.iam.dto.user.UserInfoDto;
import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/login/WeChatAppletLoginHandler.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/login/WeChatAppletLoginHandler.java
new file mode 100644
index 0000000000000000000000000000000000000000..448fe580e869f67e04bd687139c6a608679e4641
--- /dev/null
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/login/WeChatAppletLoginHandler.java
@@ -0,0 +1,139 @@
+package cn.bootx.platform.iam.core.auth.login;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
+import cn.bootx.platform.common.core.exception.BizException;
+import cn.bootx.platform.common.jackson.util.JacksonUtil;
+import cn.bootx.platform.iam.core.third.dao.UserThirdManager;
+import cn.bootx.platform.iam.core.third.entity.UserThird;
+import cn.bootx.platform.iam.core.third.entity.UserThirdInfo;
+import cn.bootx.platform.iam.core.third.service.UserTiredOperateService;
+import cn.bootx.platform.iam.core.user.dao.UserInfoManager;
+import cn.bootx.platform.iam.core.user.entity.UserInfo;
+import cn.bootx.platform.starter.auth.authentication.OpenIdAuthentication;
+import cn.bootx.platform.starter.auth.code.AuthLoginTypeCode;
+import cn.bootx.platform.starter.auth.configuration.AuthProperties;
+import cn.bootx.platform.starter.auth.entity.AuthInfoResult;
+import cn.bootx.platform.starter.auth.entity.LoginAuthContext;
+import cn.bootx.platform.starter.auth.entity.ThirdAuthCode;
+import cn.bootx.platform.starter.auth.exception.LoginFailureException;
+import cn.bootx.platform.starter.auth.util.SecurityUtil;
+import cn.bootx.platform.starter.wechat.core.user.service.WeChatUserService;
+import cn.hutool.http.HttpUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult;
+import me.zhyd.oauth.model.AuthCallback;
+import me.zhyd.oauth.model.AuthUser;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class WeChatAppletLoginHandler implements OpenIdAuthentication {
+
+
+ private final UserTiredOperateService userTiredOperateService;
+ private final WxMaService wxMaService;
+
+ private final UserThirdManager userThirdManager;
+
+ private final UserInfoManager userInfoManager;
+
+
+ private final WeChatUserService weChatUserService;
+
+ @Override
+ public String getLoginType() {
+ return AuthLoginTypeCode.WE_CHAT_APPLET;
+ }
+
+ @Override
+ public boolean adaptation(String loginType) {
+ return OpenIdAuthentication.super.adaptation(loginType);
+ }
+
+ @Override
+ public void authenticationBefore(LoginAuthContext context) {
+ OpenIdAuthentication.super.authenticationBefore(context);
+ }
+
+ @Override
+ public AuthInfoResult attemptAuthentication(LoginAuthContext context) {
+
+ String authCode = context.getRequest().getParameter(AuthLoginTypeCode.WE_CHAT_APPLET);
+
+ AuthUser authUser = this.getAuthUser(authCode, null);
+
+ // 获取企微关联的用户id
+ UserThird userThird = userThirdManager.findByField(UserThird::getWeChatId, authUser.getUuid())
+ .orElseThrow(() -> new LoginFailureException("微信没有找到绑定的用户"));
+
+ // 获取用户信息
+ UserInfo userInfo = userInfoManager.findById(userThird.getUserId())
+ .orElseThrow(() -> new LoginFailureException("用户不存在"));
+
+ return new AuthInfoResult().setUserDetail(userInfo.toUserDetail()).setId(userInfo.getId());
+ }
+
+ @Override
+ public void authenticationAfter(AuthInfoResult authInfoResult, LoginAuthContext context) {
+ OpenIdAuthentication.super.authenticationAfter(authInfoResult, context);
+ }
+
+ @Override
+ public AuthInfoResult authentication(LoginAuthContext context) {
+ return OpenIdAuthentication.super.authentication(context);
+ }
+
+ @Override
+ public String getLoginUrl() {
+ return OpenIdAuthentication.super.getLoginUrl();
+ }
+
+ @Override
+ public ThirdAuthCode getAuthCode(AuthCallback callback) {
+ return OpenIdAuthentication.super.getAuthCode(callback);
+ }
+
+ @Override
+ public AuthUser getAuthUser(String authCode, String state) {
+ try {
+ WxMaJscode2SessionResult result = wxMaService.getUserService().getSessionInfo(authCode);
+ log.debug("微信服务器返回的用户信息:{}", JacksonUtil.toJson(result));
+ return AuthUser.builder()
+ .avatar("")
+ .uuid(result.getOpenid()).
+ nickname("未知")
+ .username("未知")
+ .avatar("未知")
+ .build();
+ } catch (WxErrorException e) {
+ log.error("请求微信服务器异常:{}", e.getError());
+ throw new RuntimeException(e);
+ }
+
+ }
+
+ @Override
+ public void bindUser(String authCode, String state) {
+ Long userId = SecurityUtil.getUserId();
+ AuthUser authUser = this.getAuthUser(authCode, state);
+ userTiredOperateService.checkOpenIdBind(authUser.getUuid(), UserThird::getWeChatId);
+ userTiredOperateService.bindOpenId(userId, authUser.getUuid(), UserThird::setWeChatId);
+
+ UserThirdInfo userThirdInfo = new UserThirdInfo().setUserId(userId)
+ .setClientCode(AuthLoginTypeCode.WE_CHAT)
+ .setUsername(authUser.getUsername())
+ .setNickname(authUser.getNickname())
+ .setAvatar(authUser.getAvatar())
+ .setThirdUserId(authUser.getUuid());
+ userTiredOperateService.bindOpenInfo(userThirdInfo);
+ }
+}
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/service/AuthAssistService.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/service/AuthAssistService.java
index abbbc9518821d2dc461350a4e8352a5f0c53e839..43645283a225cf2194635779d0d1aa8a8d52ca1c 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/service/AuthAssistService.java
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/service/AuthAssistService.java
@@ -1,11 +1,13 @@
package cn.bootx.platform.iam.core.auth.service;
+import cn.bootx.platform.baseapi.core.captcha.service.CaptchaService;
import cn.bootx.platform.common.core.exception.BizException;
+import cn.bootx.platform.iam.code.UserStatusCode;
import cn.bootx.platform.iam.core.user.dao.UserInfoManager;
import cn.bootx.platform.iam.core.user.entity.UserInfo;
+import cn.bootx.platform.iam.dto.auth.LoginContentResult;
import cn.bootx.platform.iam.exception.user.UserInfoNotExistsException;
-import cn.bootx.platform.baseapi.core.captcha.service.CaptchaService;
-import cn.bootx.platform.iam.code.UserStatusCode;
+import cn.bootx.platform.iam.param.auth.LoginContentParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -41,4 +43,18 @@ public class AuthAssistService {
captchaService.sendSmsCaptcha(phone, 5 * 60, smsCaptchaType);
}
+ /**
+ * 登录⻚上下⽂信息
+ */
+ public LoginContentResult getLoginContent(LoginContentParam param){
+ return null;
+ }
+
+ /**
+ * 二次校验信息
+ */
+ public void getSecondCheck(){
+
+ }
+
}
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/handler/GetAuthClientServiceImpl.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/service/GetAuthClientServiceImpl.java
similarity index 95%
rename from bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/handler/GetAuthClientServiceImpl.java
rename to bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/service/GetAuthClientServiceImpl.java
index 0cb474d8e96c7550bf594a1d8d1c31820377d86d..31fda77285f8130f4d61cf229e867e35aeae4c1c 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/handler/GetAuthClientServiceImpl.java
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/service/GetAuthClientServiceImpl.java
@@ -1,4 +1,4 @@
-package cn.bootx.platform.iam.core.auth.handler;
+package cn.bootx.platform.iam.core.auth.service;
import cn.bootx.platform.iam.core.client.dao.ClientManager;
import cn.bootx.platform.iam.core.client.entity.Client;
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/handler/GetAuthLoginTypeServiceImpl.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/service/GetAuthLoginTypeServiceImpl.java
similarity index 95%
rename from bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/handler/GetAuthLoginTypeServiceImpl.java
rename to bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/service/GetAuthLoginTypeServiceImpl.java
index a8f59643a1d1f20696c88bc476aafab5d824795c..07b581f2c2286366b915d689142417480a290c37 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/handler/GetAuthLoginTypeServiceImpl.java
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/auth/service/GetAuthLoginTypeServiceImpl.java
@@ -1,4 +1,4 @@
-package cn.bootx.platform.iam.core.auth.handler;
+package cn.bootx.platform.iam.core.auth.service;
import cn.bootx.platform.iam.core.client.dao.LoginTypeManager;
import cn.bootx.platform.iam.core.client.entity.LonginType;
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/client/entity/Client.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/client/entity/Client.java
index 69d2d316d685fbce92e980da7f46c8b01582e28e..3f3ba7a762f5a15c5634305408c0200dadfab3f4 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/client/entity/Client.java
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/client/entity/Client.java
@@ -1,12 +1,11 @@
package cn.bootx.platform.iam.core.client.entity;
import cn.bootx.mybatis.table.modify.annotation.DbColumn;
-import cn.bootx.mybatis.table.modify.annotation.DbTable;
import cn.bootx.platform.common.core.function.EntityBaseFunction;
-import cn.bootx.platform.iam.core.client.convert.ClientConvert;
-import cn.bootx.platform.iam.param.client.ClientParam;
import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
+import cn.bootx.platform.iam.core.client.convert.ClientConvert;
import cn.bootx.platform.iam.dto.client.ClientDto;
+import cn.bootx.platform.iam.param.client.ClientParam;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.TableField;
@@ -27,7 +26,7 @@ import java.util.stream.Collectors;
*/
@EqualsAndHashCode(callSuper = true)
@Data
-@DbTable(comment = "认证终端",isAppend = true)
+//@DbTable(comment = "认证终端",isAppend = true)
@TableName("iam_client")
@Accessors(chain = true)
public class Client extends MpBaseEntity implements EntityBaseFunction {
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/client/entity/LonginType.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/client/entity/LonginType.java
index fefb4fe2421fab1c5e6fa0ee96947b490edac44a..f7d76f2f9425aee92e93885ca16cde896ee8370f 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/client/entity/LonginType.java
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/client/entity/LonginType.java
@@ -37,16 +37,13 @@ public class LonginType extends MpBaseEntity implements EntityBaseFunction o.adaptation(clientCode))
- .findFirst()
- .orElseThrow(() -> new LoginFailureException("未找到对应的终端认证器"));
+ .filter(o -> o.adaptation(clientCode))
+ .findFirst()
+ .orElseThrow(() -> new LoginFailureException("未找到对应的终端认证器"));
}
}
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/third/service/UserThirdQueryService.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/third/service/UserThirdQueryService.java
index 4fb19099eb5089e6fd310efc8124c4e4cbbe9bb6..56e3b5743722c40dd5ac6bbc0d458eaad2ea51b6 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/third/service/UserThirdQueryService.java
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/third/service/UserThirdQueryService.java
@@ -64,6 +64,7 @@ public class UserThirdQueryService {
userThirdBindInfo.setWeChatOpen(getBindInfo(thirdInfoMap, AuthLoginTypeCode.WE_CHAT_OPEN));
userThirdBindInfo.setWeCom(getBindInfo(thirdInfoMap, AuthLoginTypeCode.WE_COM));
userThirdBindInfo.setDingTalk(getBindInfo(thirdInfoMap, AuthLoginTypeCode.DING_TALK));
+
return userThirdBindInfo;
}
@@ -76,6 +77,7 @@ public class UserThirdQueryService {
if (Objects.nonNull(userThirdInfo)) {
bindInfo.setBind(true);
bindInfo.setUsername(userThirdInfo.getUsername());
+ bindInfo.setThirdUserId(userThirdInfo.getThirdUserId());
}
return bindInfo;
}
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/third/service/UserTiredOperateService.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/third/service/UserTiredOperateService.java
index f0474293243367b1a1d8b69d10de9b14e6ffbf66..6f19003cea0f2790933268e6ddf1214201833d74 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/third/service/UserTiredOperateService.java
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/core/third/service/UserTiredOperateService.java
@@ -81,9 +81,11 @@ public class UserTiredOperateService {
*/
@Transactional(rollbackFor = Exception.class)
public void bindOpenInfo(UserThirdInfo userThirdInfo) {
- // 详细信息 存在就删除重新添加
+
userThirdInfoManager.deleteByUserAndClientCode(userThirdInfo.getUserId(), userThirdInfo.getClientCode());
+
userThirdInfoManager.save(userThirdInfo);
+
}
}
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/auth/AuthInfoResult.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/auth/AuthInfoResult.java
deleted file mode 100644
index 56b5a0b3c2a136d21fa71e486b3ed4ccf02adb90..0000000000000000000000000000000000000000
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/auth/AuthInfoResult.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package cn.bootx.platform.iam.dto.auth;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import java.time.LocalDateTime;
-
-/**
- * @author xxm
- * @since 2021/6/3
- */
-@Data
-@Accessors(chain = true)
-@Schema(title = "认证返回消息")
-public class AuthInfoResult {
-
- /** 用户id */
- private Long uid;
-
- /** 租户 */
- private Long tid;
-
- /** 名称 */
- private String name;
-
- /** 账号 */
- private String username;
-
- /** 邮件 */
- private String email;
-
- /** 手机号 */
- private String phone;
-
- /** 是否超级管理员 */
- private boolean admin;
-
- /** 登录时间 */
- private LocalDateTime loginTime;
-
- /** 终端 */
- private String client;
-
- /** token */
- private String token;
-
-}
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/auth/LoginContentResult.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/auth/LoginContentResult.java
new file mode 100644
index 0000000000000000000000000000000000000000..7ab92950a430895d5fb11d0dcea0cb3ace4e9a56
--- /dev/null
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/auth/LoginContentResult.java
@@ -0,0 +1,29 @@
+package cn.bootx.platform.iam.dto.auth;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+/**
+ * 登录页上下⽂信息
+ * @author xxm
+ * @since 2023/8/17
+ */
+@Data
+@Accessors(chain = true)
+@Schema(title = "登录页上下⽂信息")
+public class LoginContentResult {
+
+ /** 支持登录方式 */
+ @Schema(description = "支持登录方式")
+ private List loginTypes;
+
+ @Schema(description = "是否启用验证码")
+ private boolean enableCaptcha;
+
+ @Schema(description = "密码是否加密传输")
+ private boolean passwordEncrypted;
+
+}
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/user/UserThirdBindInfo.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/user/UserThirdBindInfo.java
index 86174d2631961aa800ef5a84f50ceba2cd501931..52c1d75d96f3b6370ca92edf8c943063bcd7e3fe 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/user/UserThirdBindInfo.java
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/user/UserThirdBindInfo.java
@@ -29,6 +29,10 @@ public class UserThirdBindInfo {
@Schema(description = "钉钉绑定信息")
private BindInfo dingTalk;
+ @Schema(description = "钉钉绑定信息")
+ private BindInfo weChatApplet;
+
+
@Getter
@Setter
@Schema(title = "用户信息")
@@ -40,6 +44,9 @@ public class UserThirdBindInfo {
@Schema(description = "名称")
private String username;
+ @Schema(description = "第三方UUID")
+ private String thirdUserId;
+
}
}
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/param/auth/LoginContentParam.java b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/param/auth/LoginContentParam.java
new file mode 100644
index 0000000000000000000000000000000000000000..7f3c9670997b20a3dc62768b18317314a5c6c79f
--- /dev/null
+++ b/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/param/auth/LoginContentParam.java
@@ -0,0 +1,23 @@
+package cn.bootx.platform.iam.param.auth;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * 前端登录页信息
+ * @author xxm
+ * @since 2023/8/17
+ */
+@Data
+@Accessors(chain = true)
+@Schema(title = "登录页信息")
+public class LoginContentParam {
+
+ @Schema(description = "终端Code")
+ private String clientId;
+
+ @Schema(description = "账号")
+ private String username;
+
+}
diff --git a/bootx-services/service-miniapp/pom.xml b/bootx-services/service-miniapp/pom.xml
index d93bb8f1714ffa2edcf17c714666f99f472a3f46..e81da96e82213874307469e26e8bfbae48e9287a 100644
--- a/bootx-services/service-miniapp/pom.xml
+++ b/bootx-services/service-miniapp/pom.xml
@@ -6,7 +6,7 @@
cn.bootx.platform
bootx-services
- 1.3.3
+ 1.3.4
service-miniapp
diff --git a/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/controller/FeedbackInfoController.java b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/controller/FeedbackInfoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..ed195a6a574f97fa90071e634e5e639b7410370f
--- /dev/null
+++ b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/controller/FeedbackInfoController.java
@@ -0,0 +1,81 @@
+package cn.bootx.platform.miniapp.controller;
+
+import cn.bootx.platform.common.core.exception.BizException;
+import cn.bootx.platform.common.core.rest.PageResult;
+import cn.bootx.platform.common.core.rest.Res;
+import cn.bootx.platform.common.core.rest.ResResult;
+import cn.bootx.platform.common.core.rest.param.PageParam;
+import cn.bootx.platform.miniapp.core.feedback.service.FeedbackInfoService;
+import cn.bootx.platform.miniapp.dto.feedback.FeedbackInfoDto;
+import cn.bootx.platform.miniapp.param.feedback.FeedbackInfoParam;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.springframework.validation.BindException;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 用户反馈信息
+ * @author xxm
+ * @since 2023-08-15
+ */
+@Tag(name ="用户反馈信息")
+@RestController
+@RequestMapping("/feedback")
+@RequiredArgsConstructor
+public class FeedbackInfoController {
+ private final FeedbackInfoService feedbackInfoService;
+
+ @Operation( summary = "添加")
+ @PostMapping(value = "/add")
+ public ResResult add(@Validated @RequestBody FeedbackInfoParam param, BindingResult bindingResult){
+ if (bindingResult.hasErrors()){
+ throw new BizException("参数绑定异常");
+ }
+ feedbackInfoService.add(param);
+ return Res.ok();
+ }
+
+ @Operation( summary = "修改")
+ @PostMapping(value = "/update")
+ public ResResult update(@RequestBody FeedbackInfoParam param){
+ feedbackInfoService.update(param);
+ return Res.ok();
+ }
+
+ @Operation( summary = "删除")
+ @DeleteMapping(value = "/delete")
+ public ResResult delete(Long id){
+ feedbackInfoService.delete(id);
+ return Res.ok();
+ }
+
+ @Operation(summary = "批量删除")
+ @DeleteMapping("/deleteBatch")
+ public ResResult deleteBatch(@RequestBody List ids) {
+ feedbackInfoService.deleteBatch(ids);
+ return Res.ok();
+ }
+
+ @Operation( summary = "通过ID查询")
+ @GetMapping(value = "/findById")
+ public ResResult findById(Long id){
+ return Res.ok(feedbackInfoService.findById(id));
+ }
+
+ @Operation( summary = "查询所有")
+ @GetMapping(value = "/findAll")
+ public ResResult> findAll(){
+ return Res.ok(feedbackInfoService.findAll());
+ }
+
+ @Operation( summary = "分页查询")
+ @GetMapping(value = "/page")
+ public ResResult> page(PageParam pageParam, FeedbackInfoParam query){
+ return Res.ok(feedbackInfoService.page(pageParam,query));
+ }
+}
diff --git a/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/convert/FeedbackInfoConvert.java b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/convert/FeedbackInfoConvert.java
new file mode 100644
index 0000000000000000000000000000000000000000..8281bfad0dcfbd53e888df711cf72933df56ea15
--- /dev/null
+++ b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/convert/FeedbackInfoConvert.java
@@ -0,0 +1,22 @@
+package cn.bootx.platform.miniapp.core.feedback.convert;
+
+import cn.bootx.platform.miniapp.core.feedback.entity.FeedbackInfo;
+import cn.bootx.platform.miniapp.dto.feedback.FeedbackInfoDto;
+import cn.bootx.platform.miniapp.param.feedback.FeedbackInfoParam;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * 用户反馈信息
+ * @author xxm
+ * @since 2023-08-15
+ */
+@Mapper
+public interface FeedbackInfoConvert {
+ FeedbackInfoConvert CONVERT = Mappers.getMapper(FeedbackInfoConvert.class);
+
+ FeedbackInfo convert(FeedbackInfoParam in);
+
+ FeedbackInfoDto convert(FeedbackInfo in);
+
+}
diff --git a/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/dao/FeedbackInfoManager.java b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/dao/FeedbackInfoManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..1dcbd8b680670cf09fcbd24d04fedf1df3a4eac2
--- /dev/null
+++ b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/dao/FeedbackInfoManager.java
@@ -0,0 +1,33 @@
+package cn.bootx.platform.miniapp.core.feedback.dao;
+
+import cn.bootx.platform.common.core.rest.param.PageParam;
+import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
+import cn.bootx.platform.common.mybatisplus.util.MpUtil;
+import cn.bootx.platform.common.query.generator.QueryGenerator;
+import cn.bootx.platform.miniapp.core.feedback.entity.FeedbackInfo;
+import cn.bootx.platform.miniapp.param.feedback.FeedbackInfoParam;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 用户反馈信息
+ * @author xxm
+ * @since 2023-08-15
+ */
+@Repository
+@RequiredArgsConstructor
+public class FeedbackInfoManager extends BaseManager {
+
+ /**
+ * 分页
+ */
+ public Page page(PageParam pageParam, FeedbackInfoParam param) {
+ Page mpPage = MpUtil.getMpPage(pageParam, FeedbackInfo.class);
+ QueryWrapper wrapper = QueryGenerator.generator(param, this.getEntityClass());
+ wrapper.select(this.getEntityClass(),MpUtil::excludeBigField)
+ .orderByDesc(MpUtil.getColumnName(FeedbackInfo::getId));
+ return this.page(mpPage,wrapper);
+ }
+}
diff --git a/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/dao/FeedbackInfoMapper.java b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/dao/FeedbackInfoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..17534f6c535612b10cf8ddc207acf4e2606cac5a
--- /dev/null
+++ b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/dao/FeedbackInfoMapper.java
@@ -0,0 +1,14 @@
+package cn.bootx.platform.miniapp.core.feedback.dao;
+
+import cn.bootx.platform.miniapp.core.feedback.entity.FeedbackInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 用户反馈信息
+ * @author xxm
+ * @since 2023-08-15
+ */
+@Mapper
+public interface FeedbackInfoMapper extends BaseMapper {
+}
diff --git a/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/entity/FeedbackInfo.java b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/entity/FeedbackInfo.java
new file mode 100644
index 0000000000000000000000000000000000000000..7d7d2e3546f289fbecadca1d44f92129dabe7555
--- /dev/null
+++ b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/entity/FeedbackInfo.java
@@ -0,0 +1,63 @@
+package cn.bootx.platform.miniapp.core.feedback.entity;
+
+import cn.bootx.mybatis.table.modify.annotation.DbComment;
+import cn.bootx.mybatis.table.modify.annotation.DbTable;
+import cn.bootx.platform.common.core.function.EntityBaseFunction;
+import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
+import cn.bootx.platform.miniapp.core.feedback.convert.FeedbackInfoConvert;
+import cn.bootx.platform.miniapp.dto.feedback.FeedbackInfoDto;
+import cn.bootx.platform.miniapp.param.feedback.FeedbackInfoParam;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.time.LocalDateTime;
+
+/**
+ * 用户反馈信息
+ * @author xxm
+ * @since 2023/8/15
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Accessors(chain = true)
+//@DbTable(comment = "用户反馈信息")
+@TableName("miniapp_feedback_info")
+public class FeedbackInfo extends MpBaseEntity implements EntityBaseFunction {
+
+ /** 问题分类 */
+ @DbComment("问题分类")
+ private String classify;
+
+ /** 时间 */
+ @DbComment("时间")
+ private LocalDateTime time;
+
+ /** 联系方式 */
+ @DbComment("联系方式")
+ private String contact;
+
+ /** 姓名 */
+ @DbComment("姓名")
+ private String name;
+
+ /** 反馈用户ID */
+ @DbComment("反馈用户ID")
+ private Long userId;
+
+ /** 内容 */
+ @DbComment("内容")
+ private String content;
+
+ /** 创建对象 */
+ public static FeedbackInfo init(FeedbackInfoParam in) {
+ return FeedbackInfoConvert.CONVERT.convert(in);
+ }
+
+ /** 转换成dto */
+ @Override
+ public FeedbackInfoDto toDto() {
+ return FeedbackInfoConvert.CONVERT.convert(this);
+ }
+}
diff --git a/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/service/FeedbackInfoService.java b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/service/FeedbackInfoService.java
new file mode 100644
index 0000000000000000000000000000000000000000..d1e665333746fb4648945f88f362394627fc2544
--- /dev/null
+++ b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/core/feedback/service/FeedbackInfoService.java
@@ -0,0 +1,84 @@
+package cn.bootx.platform.miniapp.core.feedback.service;
+
+import cn.bootx.platform.common.core.exception.DataNotExistException;
+import cn.bootx.platform.common.core.rest.PageResult;
+import cn.bootx.platform.common.core.rest.param.PageParam;
+import cn.bootx.platform.common.core.util.ResultConvertUtil;
+import cn.bootx.platform.common.mybatisplus.util.MpUtil;
+import cn.bootx.platform.miniapp.core.feedback.dao.FeedbackInfoManager;
+import cn.bootx.platform.miniapp.core.feedback.entity.FeedbackInfo;
+import cn.bootx.platform.miniapp.dto.feedback.FeedbackInfoDto;
+import cn.bootx.platform.miniapp.param.feedback.FeedbackInfoParam;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 用户反馈信息
+ * @author xxm
+ * @since 2023-08-15
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class FeedbackInfoService {
+ private final FeedbackInfoManager feedbackInfoManager;
+
+ /**
+ * 添加
+ */
+ public void add(FeedbackInfoParam param){
+ FeedbackInfo feedbackInfo = FeedbackInfo.init(param);
+ feedbackInfoManager.save(feedbackInfo);
+ }
+
+ /**
+ * 修改
+ */
+ public void update(FeedbackInfoParam param){
+ FeedbackInfo feedbackInfo = feedbackInfoManager.findById(param.getId()).orElseThrow(DataNotExistException::new);
+
+ BeanUtil.copyProperties(param,feedbackInfo, CopyOptions.create().ignoreNullValue());
+ feedbackInfoManager.updateById(feedbackInfo);
+ }
+
+ /**
+ * 分页
+ */
+ public PageResult page(PageParam pageParam,FeedbackInfoParam query){
+ return MpUtil.convert2DtoPageResult(feedbackInfoManager.page(pageParam,query));
+ }
+
+ /**
+ * 获取单条
+ */
+ public FeedbackInfoDto findById(Long id){
+ return feedbackInfoManager.findById(id).map(FeedbackInfo::toDto).orElseThrow(DataNotExistException::new);
+ }
+
+ /**
+ * 获取全部
+ */
+ public List findAll(){
+ return ResultConvertUtil.dtoListConvert(feedbackInfoManager.findAll());
+ }
+
+ /**
+ * 删除
+ */
+ public void delete(Long id){
+ feedbackInfoManager.deleteById(id);
+ }
+
+
+ /**
+ * 批量删除
+ */
+ public void deleteBatch(List ids){
+ feedbackInfoManager.deleteByIds(ids);
+ }
+}
diff --git a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/auth/AuthPasswordDto.java b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/dto/feedback/FeedbackInfoDto.java
similarity index 36%
rename from bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/auth/AuthPasswordDto.java
rename to bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/dto/feedback/FeedbackInfoDto.java
index 80496eac76af3618c8b9358cb3d23ba5b84c0c32..5c6735357ea8e7f6bec0e7a282d61438f9093e74 100644
--- a/bootx-services/service-iam/src/main/java/cn/bootx/platform/iam/dto/auth/AuthPasswordDto.java
+++ b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/dto/feedback/FeedbackInfoDto.java
@@ -1,4 +1,4 @@
-package cn.bootx.platform.iam.dto.auth;
+package cn.bootx.platform.miniapp.dto.feedback;
import cn.bootx.platform.common.core.rest.dto.BaseDto;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -6,28 +6,30 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
-import java.io.Serializable;
import java.time.LocalDateTime;
/**
+ * 用户反馈信息
* @author xxm
- * @since 2020/4/25 17:27
+ * @since 2023-08-15
*/
@EqualsAndHashCode(callSuper = true)
@Data
+@Schema(title = "用户反馈信息")
@Accessors(chain = true)
-@Schema(title = "密码认证信息")
-public class AuthPasswordDto extends BaseDto implements Serializable {
-
- private static final long serialVersionUID = -131891945146840339L;
-
- @Schema(description = "用户主键", required = true)
- private Long uid;
-
- @Schema(description = "用户密码", required = true)
- private String password;
-
- @Schema(description = "最后登录时间")
- private LocalDateTime lastLoginTime;
+public class FeedbackInfoDto extends BaseDto {
+
+ @Schema(description = "问题分类")
+ private String classify;
+ @Schema(description = "时间")
+ private LocalDateTime time;
+ @Schema(description = "联系方式")
+ private String contact;
+ @Schema(description = "姓名")
+ private String name;
+ @Schema(description = "反馈用户ID")
+ private Long userId;
+ @Schema(description = "内容")
+ private String content;
}
diff --git a/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/param/feedback/FeedbackInfoParam.java b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/param/feedback/FeedbackInfoParam.java
new file mode 100644
index 0000000000000000000000000000000000000000..c80e8795fdfcad52c63346176655a9d7a9e40843
--- /dev/null
+++ b/bootx-services/service-miniapp/src/main/java/cn/bootx/platform/miniapp/param/feedback/FeedbackInfoParam.java
@@ -0,0 +1,37 @@
+package cn.bootx.platform.miniapp.param.feedback;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Length;
+
+import java.time.LocalDateTime;
+
+/**
+ * 用户反馈信息
+ * @author xxm
+ * @since 2023-08-15
+ */
+@Data
+@Schema(title = "用户反馈信息")
+@Accessors(chain = true)
+public class FeedbackInfoParam {
+
+ @Schema(description= "主键")
+ private Long id;
+
+ @Schema(description = "问题分类")
+ private String classify;
+ @Schema(description = "时间")
+ private LocalDateTime time;
+ @Schema(description = "联系方式")
+ private String contact;
+ @Schema(description = "姓名")
+ private String name;
+ @Schema(description = "反馈用户ID")
+ private Long userId;
+ @Length(max = 200,min = 1,message = "反馈内容长度应处于1到1000之间")
+ @Schema(description = "内容")
+ private String content;
+
+}
diff --git a/bootx-services/service-notice/pom.xml b/bootx-services/service-notice/pom.xml
index 6fe77931f839f7bb48f532b5cc6ff650652772f6..c5539b0a72097f4f9a2fefe708d9a08b6a4ee3a4 100644
--- a/bootx-services/service-notice/pom.xml
+++ b/bootx-services/service-notice/pom.xml
@@ -5,7 +5,7 @@
bootx-services
cn.bootx.platform
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/controller/SiteMessageController.java b/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/controller/SiteMessageController.java
index 3106d874ceed0eec48cfd0c76a1e023a51b04e99..8be46dca42b8fcdfff0b7bf0cd44c76436ded004 100644
--- a/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/controller/SiteMessageController.java
+++ b/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/controller/SiteMessageController.java
@@ -13,6 +13,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
/**
* @author xxm
* @since 2021/8/8
@@ -83,5 +85,9 @@ public class SiteMessageController {
siteMessageService.read(id);
return Res.ok();
}
-
+ @Operation(summary = "小程序获取未读的接收消息标题列表")
+ @GetMapping("/listByReceiveNotRead")
+ public ResResult> listByReceiveNotRead(SiteMessageInfo query) {
+ return Res.ok(siteMessageService.listByReceiveNotRead(query));
+ }
}
diff --git a/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/dingtalk/entity/msg/DingVoiceMsg.java b/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/dingtalk/entity/msg/DingVoiceMsg.java
index 860b8df6b5c70782b75cb0da0911ac537a4e60ac..879b95cb88bd9873a0e9971f27e6d3a9b5b5fa7a 100644
--- a/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/dingtalk/entity/msg/DingVoiceMsg.java
+++ b/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/dingtalk/entity/msg/DingVoiceMsg.java
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
-@Schema(title = "声音消息")
+@Schema(title = "声音工作通知消息")
public class DingVoiceMsg implements DingMsg {
@Schema(description = "媒体文件id")
diff --git a/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/site/dao/SiteMessageManager.java b/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/site/dao/SiteMessageManager.java
index e2749ce503db35606dd81f5b0a61d36ce48b9ad2..7df9a5dde7d0e2a41d3b19a2e2ff7393485f3442 100644
--- a/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/site/dao/SiteMessageManager.java
+++ b/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/site/dao/SiteMessageManager.java
@@ -15,7 +15,9 @@ import lombok.val;
import org.springframework.stereotype.Repository;
import java.time.LocalDate;
+import java.util.List;
import java.util.Objects;
+import java.util.stream.Collectors;
import static cn.bootx.platform.notice.code.SiteMessageCode.STATE_SENT;
@@ -37,15 +39,15 @@ public class SiteMessageManager extends BaseManager()
- .and(o -> o
- .and(p -> p.eq(SiteMessageInfo::getReceiveType, SiteMessageCode.RECEIVE_ALL)
- .gt(SiteMessageInfo::getEfficientTime, LocalDate.now()))
- .or()
- .eq(SiteMessageInfo::getReceiveId, userId))
- .eq(SiteMessageInfo::getSendState, STATE_SENT)
- .eq(StrUtil.isNotBlank(query.getTitle()), SiteMessageInfo::getTitle, query.getTitle())
- .orderByAsc(SiteMessageInfo::getHaveRead)
- .orderByDesc(SiteMessageInfo::getReadTime);
+ .and(o -> o
+ .and(p -> p.eq(SiteMessageInfo::getReceiveType, SiteMessageCode.RECEIVE_ALL)
+ .gt(SiteMessageInfo::getEfficientTime, LocalDate.now()))
+ .or()
+ .eq(SiteMessageInfo::getReceiveId, userId))
+ .eq(SiteMessageInfo::getSendState, STATE_SENT)
+ .eq(StrUtil.isNotBlank(query.getTitle()), SiteMessageInfo::getTitle, query.getTitle())
+ .orderByAsc(SiteMessageInfo::getHaveRead)
+ .orderByDesc(SiteMessageInfo::getReadTime);
if (Objects.equals(query.getHaveRead(), true)) {
wrapper.eq(SiteMessageInfo::getHaveRead, query.getHaveRead());
}
@@ -63,30 +65,48 @@ public class SiteMessageManager extends BaseManager()
- .and(o -> o
- .and(p -> p.eq(SiteMessageInfo::getReceiveType, SiteMessageCode.RECEIVE_ALL)
- .gt(SiteMessageInfo::getEfficientTime, LocalDate.now()))
- .or()
- .eq(SiteMessageInfo::getReceiveId, userId))
- .and(o -> o.eq(SiteMessageInfo::getHaveRead, false).or().isNull(SiteMessageInfo::getHaveRead))
- .eq(SiteMessageInfo::getSendState, STATE_SENT)
- .orderByAsc(SiteMessageInfo::getHaveRead)
- .orderByDesc(SiteMessageInfo::getReadTime);
+ .and(o -> o
+ .and(p -> p.eq(SiteMessageInfo::getReceiveType, SiteMessageCode.RECEIVE_ALL)
+ .gt(SiteMessageInfo::getEfficientTime, LocalDate.now()))
+ .or()
+ .eq(SiteMessageInfo::getReceiveId, userId))
+ .and(o -> o.eq(SiteMessageInfo::getHaveRead, false).or().isNull(SiteMessageInfo::getHaveRead))
+ .eq(SiteMessageInfo::getSendState, STATE_SENT)
+ .orderByAsc(SiteMessageInfo::getHaveRead)
+ .orderByDesc(SiteMessageInfo::getReadTime);
return baseMapper.countMassage(wrapper);
}
+ public List listByReceiveNotRead(Long userId) {
+ Page page = new Page<>();
+ page.setSize(5);
+ page.setSize(1);
+ val wrapper = new LambdaQueryWrapper()
+ .and(o -> o
+ .and(p -> p.eq(SiteMessageInfo::getReceiveType, SiteMessageCode.RECEIVE_ALL)
+ .gt(SiteMessageInfo::getEfficientTime, LocalDate.now()))
+ .or()
+ .eq(SiteMessageInfo::getReceiveId, userId))
+ .and(o -> o.eq(SiteMessageInfo::getHaveRead, false).or().isNull(SiteMessageInfo::getHaveRead))
+ .eq(SiteMessageInfo::getSendState, STATE_SENT)
+ .orderByAsc(SiteMessageInfo::getHaveRead)
+ .orderByDesc(SiteMessageInfo::getReadTime);
+ return baseMapper.pageMassage(page, wrapper).getRecords().stream()
+ .map(SiteMessageInfo::getTitle).collect(Collectors.toList());
+ }
+
/**
* 发送人消息分页
*/
public Page pageBySender(PageParam pageParam, SiteMessageInfo query, Long userId) {
Page mpPage = MpUtil.getMpPage(pageParam, SiteMessage.class);
return lambdaQuery().select(SiteMessage.class, MpUtil::excludeBigField)
- .eq(SiteMessage::getSenderId, userId)
- .like(StrUtil.isNotBlank(query.getTitle()), SiteMessage::getSenderId, query.getTitle())
- .eq(StrUtil.isNotBlank(query.getSendState()), SiteMessage::getSendState, query.getSendState())
- .eq(StrUtil.isNotBlank(query.getReceiveType()), SiteMessage::getReceiveType, query.getReceiveType())
- .orderByDesc(SiteMessage::getId)
- .page(mpPage);
+ .eq(SiteMessage::getSenderId, userId)
+ .like(StrUtil.isNotBlank(query.getTitle()), SiteMessage::getSenderId, query.getTitle())
+ .eq(StrUtil.isNotBlank(query.getSendState()), SiteMessage::getSendState, query.getSendState())
+ .eq(StrUtil.isNotBlank(query.getReceiveType()), SiteMessage::getReceiveType, query.getReceiveType())
+ .orderByDesc(SiteMessage::getId)
+ .page(mpPage);
}
}
diff --git a/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/site/service/SiteMessageService.java b/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/site/service/SiteMessageService.java
index cc2bea1709acbc561a250b44b75d646e85b65668..320060828a3858b42ed2e13052cdaada301c4665 100644
--- a/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/site/service/SiteMessageService.java
+++ b/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/site/service/SiteMessageService.java
@@ -60,30 +60,29 @@ public class SiteMessageService {
SiteMessage siteMessage;
if (Objects.nonNull(param.getId())) {
siteMessage = siteMessageManager.findById(param.getId())
- .orElseThrow(() -> new DataNotExistException("站内信信息不存在"));
+ .orElseThrow(() -> new DataNotExistException("站内信信息不存在"));
BeanUtil.copyProperties(param, siteMessage, CopyOptions.create().ignoreNullValue());
- }
- else {
+ } else {
siteMessage = new SiteMessage().setTitle(param.getTitle())
- .setSendState(STATE_DRAFT)
- .setContent(param.getContent())
- .setReceiveType(param.getReceiveType())
- .setEfficientTime(param.getEfficientTime())
- .setSenderTime(LocalDateTime.now());
+ .setSendState(STATE_DRAFT)
+ .setContent(param.getContent())
+ .setReceiveType(param.getReceiveType())
+ .setEfficientTime(param.getEfficientTime())
+ .setSenderTime(LocalDateTime.now());
// 添加消息关联人信息 暂时这段逻辑用不到, 现在发布的都是全体用户信心
if (Objects.equals(RECEIVE_USER, param.getReceiveType())) {
List siteMessageUsers = param.getReceiveIds()
- .stream()
- .map(userId -> new SiteMessageUser().setMessageId(param.getId()).setReceiveId(userId))
- .collect(Collectors.toList());
+ .stream()
+ .map(userId -> new SiteMessageUser().setMessageId(param.getId()).setReceiveId(userId))
+ .collect(Collectors.toList());
siteMessageUserManager.saveAll(siteMessageUsers);
}
}
// 新增或更新站内信内容
val userDetail = SecurityUtil.getCurrentUser();
siteMessage.setTitle(param.getTitle())
- .setSenderId(userDetail.map(UserDetail::getId).orElse(DesensitizedUtil.userId()))
- .setSenderName(userDetail.map(UserDetail::getName).orElse("未知"));
+ .setSenderId(userDetail.map(UserDetail::getId).orElse(DesensitizedUtil.userId()))
+ .setSenderName(userDetail.map(UserDetail::getName).orElse("未知"));
siteMessageManager.saveOrUpdate(siteMessage);
}
@@ -94,14 +93,14 @@ public class SiteMessageService {
@Transactional(rollbackFor = Exception.class)
public void send(Long id) {
SiteMessage siteMessage = siteMessageManager.findById(id)
- .orElseThrow(() -> new DataNotExistException("站内信信息不存在"));
+ .orElseThrow(() -> new DataNotExistException("站内信信息不存在"));
val userDetail = SecurityUtil.getCurrentUser();
// 新增站内信内容
siteMessage.setSenderId(userDetail.map(UserDetail::getId).orElse(DesensitizedUtil.userId()))
- .setSendState(STATE_SENT)
- .setSenderName(userDetail.map(UserDetail::getName).orElse("未知"))
- .setSenderTime(LocalDateTime.now());
+ .setSendState(STATE_SENT)
+ .setSenderName(userDetail.map(UserDetail::getName).orElse("未知"))
+ .setSenderTime(LocalDateTime.now());
siteMessageManager.updateById(siteMessage);
userWsNoticeService.sendMessageByAll(WsRes.eventNotice(EVENT_MESSAGE_UPDATE));
}
@@ -114,21 +113,21 @@ public class SiteMessageService {
// 新增站内信内容
SiteMessage siteMessage = new SiteMessage().setTitle(param.getTitle())
- .setContent(param.getContent())
- .setSendState(STATE_SENT)
- .setReceiveType(param.getReceiveType())
- .setEfficientTime(param.getEfficientTime())
- .setSenderId(param.getSenderId())
- .setSenderName(param.getSenderName())
- .setSenderTime(LocalDateTime.now());
+ .setContent(param.getContent())
+ .setSendState(STATE_SENT)
+ .setReceiveType(param.getReceiveType())
+ .setEfficientTime(param.getEfficientTime())
+ .setSenderId(param.getSenderId())
+ .setSenderName(param.getSenderName())
+ .setSenderTime(LocalDateTime.now());
siteMessageManager.save(siteMessage);
// 添加消息关联人信息
if (Objects.equals(RECEIVE_USER, param.getReceiveType())) {
List siteMessageUsers = param.getReceiveIds()
- .stream()
- .map(userId -> new SiteMessageUser().setMessageId(siteMessage.getId()).setReceiveId(userId))
- .collect(Collectors.toList());
+ .stream()
+ .map(userId -> new SiteMessageUser().setMessageId(siteMessage.getId()).setReceiveId(userId))
+ .collect(Collectors.toList());
siteMessageUserManager.saveAll(siteMessageUsers);
userWsNoticeService.sendMessageByUsers(WsRes.eventNotice(EVENT_MESSAGE_UPDATE), param.getReceiveIds());
}
@@ -139,11 +138,11 @@ public class SiteMessageService {
*/
public void sendSingleUserBySystem(String title, String content, Long userId) {
val param = new SendSiteMessageParam().setTitle(title)
- .setContent(content)
- .setSenderId(CommonCode.SYSTEM_DEFAULT_USERID)
- .setSenderName(CommonCode.SYSTEM_DEFAULT_USERNAME)
- .setReceiveType(RECEIVE_USER)
- .setReceiveIds(Collections.singletonList(userId));
+ .setContent(content)
+ .setSenderId(CommonCode.SYSTEM_DEFAULT_USERID)
+ .setSenderName(CommonCode.SYSTEM_DEFAULT_USERNAME)
+ .setReceiveType(RECEIVE_USER)
+ .setReceiveIds(Collections.singletonList(userId));
this.send(param);
}
@@ -152,11 +151,11 @@ public class SiteMessageService {
*/
public void sendMultiUserBySystem(String title, String content, List userIds) {
val param = new SendSiteMessageParam().setTitle(title)
- .setContent(content)
- .setSenderId(CommonCode.SYSTEM_DEFAULT_USERID)
- .setSenderName(CommonCode.SYSTEM_DEFAULT_USERNAME)
- .setReceiveType(RECEIVE_USER)
- .setReceiveIds(userIds);
+ .setContent(content)
+ .setSenderId(CommonCode.SYSTEM_DEFAULT_USERID)
+ .setSenderName(CommonCode.SYSTEM_DEFAULT_USERNAME)
+ .setReceiveType(RECEIVE_USER)
+ .setReceiveIds(userIds);
this.send(param);
}
@@ -166,7 +165,7 @@ public class SiteMessageService {
@Transactional(rollbackFor = Exception.class)
public void cancel(Long messageId) {
SiteMessage siteMessage = siteMessageManager.findById(messageId)
- .orElseThrow(() -> new DataNotExistException("站内信不存在"));
+ .orElseThrow(() -> new DataNotExistException("站内信不存在"));
siteMessage.setCancelTime(LocalDateTime.now()).setSendState(STATE_CANCEL);
siteMessageManager.updateById(siteMessage);
userWsNoticeService.sendMessageByAll(WsRes.eventNotice(EVENT_MESSAGE_UPDATE));
@@ -178,7 +177,7 @@ public class SiteMessageService {
@Transactional(rollbackFor = Exception.class)
public void delete(Long messageId) {
SiteMessage siteMessage = siteMessageManager.findById(messageId)
- .orElseThrow(() -> new DataNotExistException("站内信不存在"));
+ .orElseThrow(() -> new DataNotExistException("站内信不存在"));
if (!CollUtil.toList(STATE_CANCEL, STATE_DRAFT).contains(siteMessage.getSendState())) {
throw new BizException("站内信不是撤回或草稿状态,无法被删除");
}
@@ -225,9 +224,13 @@ public class SiteMessageService {
Long userId = SecurityUtil.getUserId();
// Long userId = 0L;
SiteMessageUser siteMessageUser = siteMessageUserManager.findByMessageId(messageId)
- .orElse(new SiteMessageUser().setReceiveId(userId).setMessageId(messageId));
+ .orElse(new SiteMessageUser().setReceiveId(userId).setMessageId(messageId));
siteMessageUser.setHaveRead(true).setReadTime(LocalDateTime.now());
siteMessageUserManager.saveOrUpdate(siteMessageUser);
}
+ public List listByReceiveNotRead(SiteMessageInfo query) {
+ Long userId = SecurityUtil.getUserId();
+ return siteMessageManager.listByReceiveNotRead(userId);
+ }
}
diff --git a/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/sms/entity/SmsChannelConfig.java b/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/sms/entity/SmsChannelConfig.java
index aeb73cf73012400006e2a38a0081f9e55f2712d5..c6a792e7fda7a95ede81726ec39be224ab9dcaae 100644
--- a/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/sms/entity/SmsChannelConfig.java
+++ b/bootx-services/service-notice/src/main/java/cn/bootx/platform/notice/core/sms/entity/SmsChannelConfig.java
@@ -26,7 +26,7 @@ import static com.baomidou.mybatisplus.annotation.FieldStrategy.IGNORED;
*/
@EqualsAndHashCode(callSuper = true)
@Data
-@DbTable(comment = "短信渠道配置")
+//@DbTable(comment = "短信渠道配置")
@Accessors(chain = true)
@TableName("notice_sms_channel_config")
public class SmsChannelConfig extends MpBaseEntity implements EntityBaseFunction {
diff --git a/bootx-services/service-platform/pom.xml b/bootx-services/service-platform/pom.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b758429a8eaab2295320a61cdea878d27757cd13
--- /dev/null
+++ b/bootx-services/service-platform/pom.xml
@@ -0,0 +1,42 @@
+
+
+ 4.0.0
+
+ cn.bootx.platform
+ bootx-services
+ 1.3.4
+
+
+ service-platform
+ jar
+
+
+
+
+ com.mysql
+ mysql-connector-j
+ runtime
+
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+
+
+
+
+ cn.bootx.platform
+ service-baseapi
+ ${bootx-platform.version}
+
+
+
+ cn.bootx.platform
+ common-starter-audit-log
+
+
+
+
diff --git a/bootx-services/service-visualization/pom.xml b/bootx-services/service-visualization/pom.xml
index da1f19463a26b3a87658120bdc23fefacfef4dc7..b6bb2d2e6f811ce86e2af8235ff25ad1e261861c 100644
--- a/bootx-services/service-visualization/pom.xml
+++ b/bootx-services/service-visualization/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-services
- 1.3.3
+ 1.3.4
4.0.0
diff --git a/bootx-services/service-visualization/src/main/java/cn/bootx/platform/visualization/core/service/ProjectInfoService.java b/bootx-services/service-visualization/src/main/java/cn/bootx/platform/visualization/core/service/ProjectInfoService.java
index b4483ecf98d52d6ebf359434a4980935f6b234c7..85b7e9408d67faa225efadb726397129a32fc65a 100644
--- a/bootx-services/service-visualization/src/main/java/cn/bootx/platform/visualization/core/service/ProjectInfoService.java
+++ b/bootx-services/service-visualization/src/main/java/cn/bootx/platform/visualization/core/service/ProjectInfoService.java
@@ -2,6 +2,7 @@ package cn.bootx.platform.visualization.core.service;
import cn.bootx.platform.common.core.exception.BizException;
import cn.bootx.platform.common.core.exception.DataNotExistException;
+import cn.bootx.platform.common.core.function.ParamService;
import cn.bootx.platform.common.core.rest.PageResult;
import cn.bootx.platform.common.core.rest.param.PageParam;
import cn.bootx.platform.common.mybatisplus.util.MpUtil;
@@ -51,6 +52,8 @@ public class ProjectInfoService {
private final ProjectInfoPublishManager publishManager;
+ private final ParamService paramService;
+
/**
* 获取文件上传oss信息
*/
@@ -265,7 +268,12 @@ public class ProjectInfoService {
* GoView服务地址
*/
public String getGoViewUrl() {
- return visualizationProperties.getGoViewUrl();
+ String serverUrl = paramService.getValue("FileServerUrl");
+ if (StrUtil.isBlank(serverUrl)) {
+ serverUrl = visualizationProperties.getGoViewUrl();
+ }
+ return serverUrl;
+
}
}
diff --git a/bootx-start/pom.xml b/bootx-start/pom.xml
index b451e350d8b9d9144000613d68d4b8dc173c5022..43edb8085037334722b304be6aa84a0f3221d676 100644
--- a/bootx-start/pom.xml
+++ b/bootx-start/pom.xml
@@ -5,7 +5,7 @@
cn.bootx.platform
bootx-platform-parent
- 1.3.3
+ 1.3.4
4.0.0
bootx-start
diff --git a/bootx-start/src/main/resources/application-dev.yml b/bootx-start/src/main/resources/application-dev.yml
index b1a4b6ecd2ebab3c82f37b83dae5043dc6db6c61..c010075ac8f8d4374ce7b1c3a565e9bf6da2cf81 100644
--- a/bootx-start/src/main/resources/application-dev.yml
+++ b/bootx-start/src/main/resources/application-dev.yml
@@ -93,7 +93,7 @@ bootx:
swagger:
enabled: true
author: bootx
- version: 1.3.3
+ version: 1.3.4
title: bootx开发平台单体版
description: bootx-platform开发平台单体版
# basic认证
@@ -145,6 +145,7 @@ bootx:
ding-talk:
app-key: ??
app-secret: ??
+ agent-id: 1001
#微信(公众平台)
wechat:
app-id: ??
@@ -158,6 +159,10 @@ bootx:
corp-secret: ??
token: ??
encoding-aes-key: ??
+ # 微信小程序
+ wechat-applet:
+ app-id: ??
+ app-secret: ??
# 认证
auth:
default-password: 123456
@@ -220,6 +225,17 @@ bootx:
access-secret: password
# 存储桶 需要至少三位
bucket: bootx
+ tencent-oss:
+ # 标识
+ secret-id: ''
+ # 密钥
+ secret-key: ''
+ # 地域
+ region: ''
+ # 会话token
+ session-token:
+ # 存储桶名称
+ bucket: bootx
# 数据权限
data-perm:
field-decrypt-key: "UCrtxSCwYZNCIlav"
diff --git a/docker-compose.yml b/docker-compose.yml
index 41e894c3621f2280773a1847b2916f4342b41b49..f5bbce79dcfe948be9fe20b09958033970d045c5 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,8 +5,10 @@ services:
restart: always
ports:
- "8080:8080"
+ environment:
+ - JAVA_OPTS= -Xms256m -Xmx1G -Dlogging.config=./logback-spring.xml
volumes:
# 读取外部化配置文件(根据实际服务器环境做修改), 宿主机目录:容器目录
- - /data/logs/dax-start:/logs # 日志
- - /root/dax-pay/application-dev.yml:/application-dev.yml # 配置
- - /root/dax-pay/logback-spring.xml:/logback-spring.xml # 日志框架
+ - /data/logs/:/logs # 日志
+ - /root/bootx-start/application-dev.yml:/application-dev.yml # 配置
+ - /root/dax-paydax-pay/logback-spring.xml:/logback-spring.xml # 日志框架
diff --git a/pom.xml b/pom.xml
index 4d2635aabef18bcb59910fc3fc58578812115e33..fb28fecbdc4d2d82b0d11942db45b48a9b0ee662 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
cn.bootx.platform
bootx-platform-parent
pom
- 1.3.3
+ 1.3.4
bootx-platform
@@ -47,16 +47,18 @@
https://gitee.com/bootx/bootx-platform
+
+ bootx-common-core
+ bootx-common-starters
+ bootx-commons
+ bootx-services
+
noDeploy
- bootx-common-core
- bootx-common-starters
- bootx-commons
- bootx-services
bootx-start
bootx-demo
@@ -64,16 +66,6 @@
true
-
-
- deploy
-
- bootx-common-core
- bootx-common-starters
- bootx-commons
- bootx-services
-
-
@@ -83,7 +75,7 @@
1.8
- 1.3.3
+ 1.3.4
5.8.20
6.4.4
@@ -109,8 +101,7 @@
1.34.0
1.16.5
8.5.4
-
- 3.5.3.1
+ 3.5.3.2
3.6.1
1.6.15
3.23.0