diff --git a/README.md b/README.md
index 12d2d395e6614936bc00a3a2f7c880ff0b0d7650..487fba3700273017a55a062e528ace14aa6fdfe0 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,3 @@
-
@@ -9,7 +8,9 @@
开 箱 即 用 的 Spring 快 速 开 发 平 台
- [预 览](http://boot.pearadmin.com) | [官 网](http://www.pearadmin.com/) | [群聊](https://jq.qq.com/?_wv=1027&k=5OdSmve) | [社区](http://forum.pearadmin.com/) | [更新](http://forum.pearadmin.com/posts/fb16cb02ba2347a6ac236c434e07f8e1/detail)
+[预 览](http://boot.pearadmin.com) | [官 网](http://www.pearadmin.com/)
+| [群聊](https://jq.qq.com/?_wv=1027&k=5OdSmve) | [社区](http://forum.pearadmin.com/)
+| [更新](http://forum.pearadmin.com/posts/fb16cb02ba2347a6ac236c434e07f8e1/detail)
@@ -28,12 +29,11 @@
-
-#### 项目介绍 :jack_o_lantern:
+#### 项目介绍 :jack_o_lantern:
Spring Boot + Security + MyBatis + Thymeleaf + Activiti 快速开发平台
- 项目不定时更新,建议 Star watch 一份
+项目不定时更新,建议 Star watch 一份
#### 模块划分
@@ -45,13 +45,13 @@ Spring Boot + Security + MyBatis + Thymeleaf + Activiti 快速开发平台
#### 内置功能
-1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
-2. 权限管理:配置系统菜单,操作权限,按钮权限标识等。
-3. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
-4. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
-5. 参数管理:对系统动态配置常用参数。
-6. 通知公告:系统通知公告信息发布维护。
-7. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
+1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
+2. 权限管理:配置系统菜单,操作权限,按钮权限标识等。
+3. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
+4. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
+5. 参数管理:对系统动态配置常用参数。
+6. 通知公告:系统通知公告信息发布维护。
+7. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
8. 登录日志:系统登录日志记录查询包含登录异常。
9. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
10. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。
diff --git a/annex/schedule.sql b/annex/schedule.sql
index 6b9d65fccc51d4d5641ac8c9964250a8e2b924a6..461273f484ccb60cafff2d641a0921f67d4dcfb1 100644
--- a/annex/schedule.sql
+++ b/annex/schedule.sql
@@ -15,20 +15,22 @@
*/
SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
+SET
+FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for schedule_blob_triggers
-- ----------------------------
DROP TABLE IF EXISTS `schedule_blob_triggers`;
-CREATE TABLE `schedule_blob_triggers` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `BLOB_DATA` blob NULL,
- PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
- INDEX `SCHED_NAME`(`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
- CONSTRAINT `schedule_blob_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `schedule_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
+CREATE TABLE `schedule_blob_triggers`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `BLOB_DATA` blob NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ INDEX `SCHED_NAME`(`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ CONSTRAINT `schedule_blob_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `schedule_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -39,11 +41,12 @@ CREATE TABLE `schedule_blob_triggers` (
-- Table structure for schedule_calendars
-- ----------------------------
DROP TABLE IF EXISTS `schedule_calendars`;
-CREATE TABLE `schedule_calendars` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `CALENDAR_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `CALENDAR` blob NOT NULL,
- PRIMARY KEY (`SCHED_NAME`, `CALENDAR_NAME`) USING BTREE
+CREATE TABLE `schedule_calendars`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `CALENDAR_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `CALENDAR` blob NOT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `CALENDAR_NAME`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -54,14 +57,15 @@ CREATE TABLE `schedule_calendars` (
-- Table structure for schedule_cron_triggers
-- ----------------------------
DROP TABLE IF EXISTS `schedule_cron_triggers`;
-CREATE TABLE `schedule_cron_triggers` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `CRON_EXPRESSION` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TIME_ZONE_ID` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
- CONSTRAINT `schedule_cron_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `schedule_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
+CREATE TABLE `schedule_cron_triggers`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `CRON_EXPRESSION` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TIME_ZONE_ID` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ CONSTRAINT `schedule_cron_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `schedule_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -72,27 +76,28 @@ CREATE TABLE `schedule_cron_triggers` (
-- Table structure for schedule_fired_triggers
-- ----------------------------
DROP TABLE IF EXISTS `schedule_fired_triggers`;
-CREATE TABLE `schedule_fired_triggers` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `ENTRY_ID` varchar(95) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `INSTANCE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `FIRED_TIME` bigint(20) NOT NULL,
- `SCHED_TIME` bigint(20) NOT NULL,
- `PRIORITY` int(11) NOT NULL,
- `STATE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- `IS_NONCONCURRENT` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- `REQUESTS_RECOVERY` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- PRIMARY KEY (`SCHED_NAME`, `ENTRY_ID`) USING BTREE,
- INDEX `IDX_QRTZ_FT_TRIG_INST_NAME`(`SCHED_NAME`, `INSTANCE_NAME`) USING BTREE,
- INDEX `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY`(`SCHED_NAME`, `INSTANCE_NAME`, `REQUESTS_RECOVERY`) USING BTREE,
- INDEX `IDX_QRTZ_FT_J_G`(`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE,
- INDEX `IDX_QRTZ_FT_JG`(`SCHED_NAME`, `JOB_GROUP`) USING BTREE,
- INDEX `IDX_QRTZ_FT_T_G`(`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
- INDEX `IDX_QRTZ_FT_TG`(`SCHED_NAME`, `TRIGGER_GROUP`) USING BTREE
+CREATE TABLE `schedule_fired_triggers`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `ENTRY_ID` varchar(95) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `INSTANCE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `FIRED_TIME` bigint(20) NOT NULL,
+ `SCHED_TIME` bigint(20) NOT NULL,
+ `PRIORITY` int(11) NOT NULL,
+ `STATE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `IS_NONCONCURRENT` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `REQUESTS_RECOVERY` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `ENTRY_ID`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_TRIG_INST_NAME`(`SCHED_NAME`, `INSTANCE_NAME`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY`(`SCHED_NAME`, `INSTANCE_NAME`, `REQUESTS_RECOVERY`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_J_G`(`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_JG`(`SCHED_NAME`, `JOB_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_T_G`(`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_TG`(`SCHED_NAME`, `TRIGGER_GROUP`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -103,16 +108,17 @@ CREATE TABLE `schedule_fired_triggers` (
-- Table structure for schedule_job
-- ----------------------------
DROP TABLE IF EXISTS `schedule_job`;
-CREATE TABLE `schedule_job` (
- `job_id` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务id',
- `bean_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'spring bean名称',
- `params` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数',
- `cron_expression` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'cron表达式',
- `status` tinyint(4) NULL DEFAULT NULL COMMENT '任务状态 0:正常 1:暂停',
- `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
- `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
- `job_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- PRIMARY KEY (`job_id`) USING BTREE
+CREATE TABLE `schedule_job`
+(
+ `job_id` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务id',
+ `bean_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'spring bean名称',
+ `params` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数',
+ `cron_expression` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'cron表达式',
+ `status` tinyint(4) NULL DEFAULT NULL COMMENT '任务状态 0:正常 1:暂停',
+ `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
+ `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `job_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`job_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务' ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -123,20 +129,21 @@ CREATE TABLE `schedule_job` (
-- Table structure for schedule_job_details
-- ----------------------------
DROP TABLE IF EXISTS `schedule_job_details`;
-CREATE TABLE `schedule_job_details` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `DESCRIPTION` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- `JOB_CLASS_NAME` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `IS_DURABLE` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `IS_NONCONCURRENT` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `IS_UPDATE_DATA` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `REQUESTS_RECOVERY` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `JOB_DATA` blob NULL,
- PRIMARY KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE,
- INDEX `IDX_QRTZ_J_REQ_RECOVERY`(`SCHED_NAME`, `REQUESTS_RECOVERY`) USING BTREE,
- INDEX `IDX_QRTZ_J_GRP`(`SCHED_NAME`, `JOB_GROUP`) USING BTREE
+CREATE TABLE `schedule_job_details`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `DESCRIPTION` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `JOB_CLASS_NAME` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `IS_DURABLE` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `IS_NONCONCURRENT` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `IS_UPDATE_DATA` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `REQUESTS_RECOVERY` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_DATA` blob NULL,
+ PRIMARY KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_J_REQ_RECOVERY`(`SCHED_NAME`, `REQUESTS_RECOVERY`) USING BTREE,
+ INDEX `IDX_QRTZ_J_GRP`(`SCHED_NAME`, `JOB_GROUP`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -147,10 +154,11 @@ CREATE TABLE `schedule_job_details` (
-- Table structure for schedule_locks
-- ----------------------------
DROP TABLE IF EXISTS `schedule_locks`;
-CREATE TABLE `schedule_locks` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `LOCK_NAME` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- PRIMARY KEY (`SCHED_NAME`, `LOCK_NAME`) USING BTREE
+CREATE TABLE `schedule_locks`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `LOCK_NAME` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `LOCK_NAME`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -161,17 +169,18 @@ CREATE TABLE `schedule_locks` (
-- Table structure for schedule_log
-- ----------------------------
DROP TABLE IF EXISTS `schedule_log`;
-CREATE TABLE `schedule_log` (
- `log_id` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务日志id',
- `job_id` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务id',
- `bean_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'spring bean名称',
- `params` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数',
- `status` tinyint(4) NOT NULL COMMENT '任务状态 0:成功 1:失败',
- `error` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '失败信息',
- `times` int(11) NOT NULL COMMENT '耗时(单位:毫秒)',
- `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
- PRIMARY KEY (`log_id`) USING BTREE,
- INDEX `job_id`(`job_id`) USING BTREE
+CREATE TABLE `schedule_log`
+(
+ `log_id` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务日志id',
+ `job_id` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务id',
+ `bean_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'spring bean名称',
+ `params` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数',
+ `status` tinyint(4) NOT NULL COMMENT '任务状态 0:成功 1:失败',
+ `error` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '失败信息',
+ `times` int(11) NOT NULL COMMENT '耗时(单位:毫秒)',
+ `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`log_id`) USING BTREE,
+ INDEX `job_id`(`job_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务日志' ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -182,10 +191,11 @@ CREATE TABLE `schedule_log` (
-- Table structure for schedule_paused_trigger_grps
-- ----------------------------
DROP TABLE IF EXISTS `schedule_paused_trigger_grps`;
-CREATE TABLE `schedule_paused_trigger_grps` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- PRIMARY KEY (`SCHED_NAME`, `TRIGGER_GROUP`) USING BTREE
+CREATE TABLE `schedule_paused_trigger_grps`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_GROUP`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -196,12 +206,13 @@ CREATE TABLE `schedule_paused_trigger_grps` (
-- Table structure for schedule_scheduler_state
-- ----------------------------
DROP TABLE IF EXISTS `schedule_scheduler_state`;
-CREATE TABLE `schedule_scheduler_state` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `INSTANCE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `LAST_CHECKIN_TIME` bigint(20) NOT NULL,
- `CHECKIN_INTERVAL` bigint(20) NOT NULL,
- PRIMARY KEY (`SCHED_NAME`, `INSTANCE_NAME`) USING BTREE
+CREATE TABLE `schedule_scheduler_state`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `INSTANCE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `LAST_CHECKIN_TIME` bigint(20) NOT NULL,
+ `CHECKIN_INTERVAL` bigint(20) NOT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `INSTANCE_NAME`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -212,15 +223,16 @@ CREATE TABLE `schedule_scheduler_state` (
-- Table structure for schedule_simple_triggers
-- ----------------------------
DROP TABLE IF EXISTS `schedule_simple_triggers`;
-CREATE TABLE `schedule_simple_triggers` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `REPEAT_COUNT` bigint(20) NOT NULL,
- `REPEAT_INTERVAL` bigint(20) NOT NULL,
- `TIMES_TRIGGERED` bigint(20) NOT NULL,
- PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
- CONSTRAINT `schedule_simple_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `schedule_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
+CREATE TABLE `schedule_simple_triggers`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `REPEAT_COUNT` bigint(20) NOT NULL,
+ `REPEAT_INTERVAL` bigint(20) NOT NULL,
+ `TIMES_TRIGGERED` bigint(20) NOT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ CONSTRAINT `schedule_simple_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `schedule_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -231,23 +243,24 @@ CREATE TABLE `schedule_simple_triggers` (
-- Table structure for schedule_simprop_triggers
-- ----------------------------
DROP TABLE IF EXISTS `schedule_simprop_triggers`;
-CREATE TABLE `schedule_simprop_triggers` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `STR_PROP_1` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- `STR_PROP_2` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- `STR_PROP_3` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- `INT_PROP_1` int(11) NULL DEFAULT NULL,
- `INT_PROP_2` int(11) NULL DEFAULT NULL,
- `LONG_PROP_1` bigint(20) NULL DEFAULT NULL,
- `LONG_PROP_2` bigint(20) NULL DEFAULT NULL,
- `DEC_PROP_1` decimal(13, 4) NULL DEFAULT NULL,
- `DEC_PROP_2` decimal(13, 4) NULL DEFAULT NULL,
- `BOOL_PROP_1` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- `BOOL_PROP_2` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
- CONSTRAINT `schedule_simprop_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `schedule_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
+CREATE TABLE `schedule_simprop_triggers`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `STR_PROP_1` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `STR_PROP_2` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `STR_PROP_3` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `INT_PROP_1` int(11) NULL DEFAULT NULL,
+ `INT_PROP_2` int(11) NULL DEFAULT NULL,
+ `LONG_PROP_1` bigint(20) NULL DEFAULT NULL,
+ `LONG_PROP_2` bigint(20) NULL DEFAULT NULL,
+ `DEC_PROP_1` decimal(13, 4) NULL DEFAULT NULL,
+ `DEC_PROP_2` decimal(13, 4) NULL DEFAULT NULL,
+ `BOOL_PROP_1` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `BOOL_PROP_2` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ CONSTRAINT `schedule_simprop_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `schedule_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
@@ -258,41 +271,43 @@ CREATE TABLE `schedule_simprop_triggers` (
-- Table structure for schedule_triggers
-- ----------------------------
DROP TABLE IF EXISTS `schedule_triggers`;
-CREATE TABLE `schedule_triggers` (
- `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `DESCRIPTION` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- `NEXT_FIRE_TIME` bigint(20) NULL DEFAULT NULL,
- `PREV_FIRE_TIME` bigint(20) NULL DEFAULT NULL,
- `PRIORITY` int(11) NULL DEFAULT NULL,
- `TRIGGER_STATE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `TRIGGER_TYPE` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- `START_TIME` bigint(20) NOT NULL,
- `END_TIME` bigint(20) NULL DEFAULT NULL,
- `CALENDAR_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
- `MISFIRE_INSTR` smallint(6) NULL DEFAULT NULL,
- `JOB_DATA` blob NULL,
- PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
- INDEX `IDX_QRTZ_T_J`(`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE,
- INDEX `IDX_QRTZ_T_JG`(`SCHED_NAME`, `JOB_GROUP`) USING BTREE,
- INDEX `IDX_QRTZ_T_C`(`SCHED_NAME`, `CALENDAR_NAME`) USING BTREE,
- INDEX `IDX_QRTZ_T_G`(`SCHED_NAME`, `TRIGGER_GROUP`) USING BTREE,
- INDEX `IDX_QRTZ_T_STATE`(`SCHED_NAME`, `TRIGGER_STATE`) USING BTREE,
- INDEX `IDX_QRTZ_T_N_STATE`(`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`, `TRIGGER_STATE`) USING BTREE,
- INDEX `IDX_QRTZ_T_N_G_STATE`(`SCHED_NAME`, `TRIGGER_GROUP`, `TRIGGER_STATE`) USING BTREE,
- INDEX `IDX_QRTZ_T_NEXT_FIRE_TIME`(`SCHED_NAME`, `NEXT_FIRE_TIME`) USING BTREE,
- INDEX `IDX_QRTZ_T_NFT_ST`(`SCHED_NAME`, `TRIGGER_STATE`, `NEXT_FIRE_TIME`) USING BTREE,
- INDEX `IDX_QRTZ_T_NFT_MISFIRE`(`SCHED_NAME`, `MISFIRE_INSTR`, `NEXT_FIRE_TIME`) USING BTREE,
- INDEX `IDX_QRTZ_T_NFT_ST_MISFIRE`(`SCHED_NAME`, `MISFIRE_INSTR`, `NEXT_FIRE_TIME`, `TRIGGER_STATE`) USING BTREE,
- INDEX `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP`(`SCHED_NAME`, `MISFIRE_INSTR`, `NEXT_FIRE_TIME`, `TRIGGER_GROUP`, `TRIGGER_STATE`) USING BTREE,
- CONSTRAINT `schedule_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `schedule_job_details` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
+CREATE TABLE `schedule_triggers`
+(
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `DESCRIPTION` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `NEXT_FIRE_TIME` bigint(20) NULL DEFAULT NULL,
+ `PREV_FIRE_TIME` bigint(20) NULL DEFAULT NULL,
+ `PRIORITY` int(11) NULL DEFAULT NULL,
+ `TRIGGER_STATE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_TYPE` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `START_TIME` bigint(20) NOT NULL,
+ `END_TIME` bigint(20) NULL DEFAULT NULL,
+ `CALENDAR_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `MISFIRE_INSTR` smallint(6) NULL DEFAULT NULL,
+ `JOB_DATA` blob NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_T_J`(`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_T_JG`(`SCHED_NAME`, `JOB_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_T_C`(`SCHED_NAME`, `CALENDAR_NAME`) USING BTREE,
+ INDEX `IDX_QRTZ_T_G`(`SCHED_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_T_STATE`(`SCHED_NAME`, `TRIGGER_STATE`) USING BTREE,
+ INDEX `IDX_QRTZ_T_N_STATE`(`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`, `TRIGGER_STATE`) USING BTREE,
+ INDEX `IDX_QRTZ_T_N_G_STATE`(`SCHED_NAME`, `TRIGGER_GROUP`, `TRIGGER_STATE`) USING BTREE,
+ INDEX `IDX_QRTZ_T_NEXT_FIRE_TIME`(`SCHED_NAME`, `NEXT_FIRE_TIME`) USING BTREE,
+ INDEX `IDX_QRTZ_T_NFT_ST`(`SCHED_NAME`, `TRIGGER_STATE`, `NEXT_FIRE_TIME`) USING BTREE,
+ INDEX `IDX_QRTZ_T_NFT_MISFIRE`(`SCHED_NAME`, `MISFIRE_INSTR`, `NEXT_FIRE_TIME`) USING BTREE,
+ INDEX `IDX_QRTZ_T_NFT_ST_MISFIRE`(`SCHED_NAME`, `MISFIRE_INSTR`, `NEXT_FIRE_TIME`, `TRIGGER_STATE`) USING BTREE,
+ INDEX `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP`(`SCHED_NAME`, `MISFIRE_INSTR`, `NEXT_FIRE_TIME`, `TRIGGER_GROUP`, `TRIGGER_STATE`) USING BTREE,
+ CONSTRAINT `schedule_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `schedule_job_details` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of schedule_triggers
-- ----------------------------
-SET FOREIGN_KEY_CHECKS = 1;
+SET
+FOREIGN_KEY_CHECKS = 1;
diff --git a/pear-common/pom.xml b/pear-common/pom.xml
index a66b10a6e00aae690fec9b82821d4e3b232bd84a..c6ff258b1e7d0645d78a82c87df94694dd6a3ceb 100644
--- a/pear-common/pom.xml
+++ b/pear-common/pom.xml
@@ -1,5 +1,5 @@
-
4.0.0
diff --git a/pear-common/src/main/java/com/pearadmin/common/config/CoreConfig.java b/pear-common/src/main/java/com/pearadmin/common/config/CoreConfig.java
index d771528a01476ca6d75424b2f27d18aed08b2c4b..ac378950b565ccf684c3628ec9f33ae36a58cabb 100644
--- a/pear-common/src/main/java/com/pearadmin/common/config/CoreConfig.java
+++ b/pear-common/src/main/java/com/pearadmin/common/config/CoreConfig.java
@@ -14,15 +14,18 @@ import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactor
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
+
import javax.annotation.Resource;
import java.io.Serializable;
-import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
+/**
+ * @author 就 眠 仪 式
+ */
@Configuration
public class CoreConfig {
@@ -33,7 +36,7 @@ public class CoreConfig {
public MailAccount mailAccount() {
MailAccount mailAccount = new MailAccount();
mailAccount.setHost(sysContext.getConfig(ConfigurationConstant.MAIN_HOST));
- mailAccount.setPort(sysContext.getConfig(ConfigurationConstant.MAIN_PORT)==""?0000: Integer.parseInt(sysContext.getConfig(ConfigurationConstant.MAIN_PORT)));
+ mailAccount.setPort(sysContext.getConfig(ConfigurationConstant.MAIN_PORT) == "" ? 0000 : Integer.parseInt(sysContext.getConfig(ConfigurationConstant.MAIN_PORT)));
mailAccount.setFrom(sysContext.getConfig(ConfigurationConstant.MAIN_FROM));
mailAccount.setUser(sysContext.getConfig(ConfigurationConstant.MAIN_USER));
mailAccount.setPass(sysContext.getConfig(ConfigurationConstant.MAIN_PASS));
@@ -53,7 +56,7 @@ public class CoreConfig {
}
@Bean
- public Module dateTime(){
+ public Module dateTime() {
JavaTimeModule javaTimeModule = new JavaTimeModule();
javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
javaTimeModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
diff --git a/pear-common/src/main/java/com/pearadmin/common/config/QuartzConfig.java b/pear-common/src/main/java/com/pearadmin/common/config/QuartzConfig.java
index 5edd8327a4daacece00583d59cdadd1345bfd032..bd5ffc0e0fc9b95d2d26e833f5e52e29beff4cb4 100644
--- a/pear-common/src/main/java/com/pearadmin/common/config/QuartzConfig.java
+++ b/pear-common/src/main/java/com/pearadmin/common/config/QuartzConfig.java
@@ -5,15 +5,15 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import javax.annotation.Resource;
-import javax.annotation.sql.DataSourceDefinition;
import javax.sql.DataSource;
import java.util.Properties;
/**
* Describe: 定 时 任 务 配 置 文 件
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Configuration
public class QuartzConfig {
@@ -24,7 +24,7 @@ public class QuartzConfig {
* Describe: 定时任务工厂
* Param: DataSource
* Return: ScheduleFactoryBean
- * */
+ */
@Bean
public SchedulerFactoryBean schedulerFactoryBean() {
Properties prop = new Properties();
diff --git a/pear-common/src/main/java/com/pearadmin/common/config/SwaggerConfig.java b/pear-common/src/main/java/com/pearadmin/common/config/SwaggerConfig.java
index 456f1fdc7a1bb66ca1c9c9b47f716e2248dc0e2e..5cce276fafd4c08b9f82414ff3e97aa780c08d66 100644
--- a/pear-common/src/main/java/com/pearadmin/common/config/SwaggerConfig.java
+++ b/pear-common/src/main/java/com/pearadmin/common/config/SwaggerConfig.java
@@ -1,25 +1,27 @@
package com.pearadmin.common.config;
-import lombok.extern.slf4j.Slf4j;
import com.pearadmin.common.config.proprety.SwaggerProperty;
-import org.springframework.context.annotation.Configuration;
-import springfox.documentation.builders.RequestHandlerSelectors;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.spi.DocumentationType;
import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
import javax.annotation.Resource;
import java.util.ArrayList;
/**
* Describe: 接 口 文 档 配 置 文 件
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Slf4j
@Configuration
@EnableSwagger2
@@ -31,7 +33,7 @@ public class SwaggerConfig {
private SwaggerProperty documentAutoProperties;
@Bean
- public Docket docker(){
+ public Docket docker() {
log.info("Read document configuration information");
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
@@ -42,13 +44,13 @@ public class SwaggerConfig {
.build();
}
- private ApiInfo apiInfo(){
+ private ApiInfo apiInfo() {
return new ApiInfo(
documentAutoProperties.getTitle(),
- documentAutoProperties.getDescribe() ,
+ documentAutoProperties.getDescribe(),
documentAutoProperties.getVersion(),
- documentAutoProperties.getTermsOfServiceUrl(),documentAutoProperties.getContact(),documentAutoProperties.getLicence(),documentAutoProperties.getLicenceUrl(),
+ documentAutoProperties.getTermsOfServiceUrl(), documentAutoProperties.getContact(), documentAutoProperties.getLicence(), documentAutoProperties.getLicenceUrl(),
new ArrayList<>()
);
}
-}
\ No newline at end of file
+}
diff --git a/pear-common/src/main/java/com/pearadmin/common/config/proprety/SecurityProperty.java b/pear-common/src/main/java/com/pearadmin/common/config/proprety/SecurityProperty.java
index cfca895f1c91e69514d5b06f59f795efc20ba339..0e8db7a67c06da64b6644d6d48b36ee120e7e778 100644
--- a/pear-common/src/main/java/com/pearadmin/common/config/proprety/SecurityProperty.java
+++ b/pear-common/src/main/java/com/pearadmin/common/config/proprety/SecurityProperty.java
@@ -5,36 +5,37 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Describe: 系 统 权 限 配 置 类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
@ConfigurationProperties("pear.security")
public class SecurityProperty {
/**
* 超级管理员不认证
- * */
+ */
private boolean superAuthOpen;
/**
* 不验证权限用户名
- * */
+ */
private String superAdmin;
/**
* 记住密码标识
- * */
+ */
private String rememberKey;
/**
* 开放接口列表
- * */
+ */
private String[] openApi;
/**
* 是否允许多账号在线
- * */
+ */
private Integer maximum = 1;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/config/proprety/SwaggerProperty.java b/pear-common/src/main/java/com/pearadmin/common/config/proprety/SwaggerProperty.java
index b0030b546c3dbce3978d067c062e02355ef7aa2c..aeca694497c96388dd2ae9be9c39a126a1ddf158 100644
--- a/pear-common/src/main/java/com/pearadmin/common/config/proprety/SwaggerProperty.java
+++ b/pear-common/src/main/java/com/pearadmin/common/config/proprety/SwaggerProperty.java
@@ -6,41 +6,62 @@ import springfox.documentation.service.Contact;
/**
* Describe: 接 口 文 档 配 置 类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
@ConfigurationProperties("pear.swagger")
public class SwaggerProperty {
- /** 是 否 开 启 */
+ /**
+ * 是 否 开 启
+ */
private Boolean enable = true;
- /** 分 组 名 称 */
+ /**
+ * 分 组 名 称
+ */
private String groupName;
- /** 系 统 标 题 */
+ /**
+ * 系 统 标 题
+ */
private String title;
- /** 描 述 信 息 */
+ /**
+ * 描 述 信 息
+ */
private String describe;
- /** 版 本 信 息 */
+ /**
+ * 版 本 信 息
+ */
private String version;
- /** 扫 描 路 径 */
+ /**
+ * 扫 描 路 径
+ */
private String scanPackage;
- /** 扩 展 信 息 */
+ /**
+ * 扩 展 信 息
+ */
private Contact contact;
- /** 协 议 */
+ /**
+ * 协 议
+ */
private String licence;
- /** 协 议 链 接 */
+ /**
+ * 协 议 链 接
+ */
private String licenceUrl;
- /** 组 织 链 接 */
+ /**
+ * 组 织 链 接
+ */
private String termsOfServiceUrl;
-}
\ No newline at end of file
+}
diff --git a/pear-common/src/main/java/com/pearadmin/common/config/proprety/TemplateProperty.java b/pear-common/src/main/java/com/pearadmin/common/config/proprety/TemplateProperty.java
index 5e898911d84fe8825b49b0cb086d5a68f1b1f574..3a516c1075427ad89066c311edf373fc0c6a24a5 100644
--- a/pear-common/src/main/java/com/pearadmin/common/config/proprety/TemplateProperty.java
+++ b/pear-common/src/main/java/com/pearadmin/common/config/proprety/TemplateProperty.java
@@ -8,28 +8,29 @@ import java.io.File;
/**
* Describe: 接 口 文 档 配 置 类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
@Component
@ConfigurationProperties("pear.upload")
public class TemplateProperty {
/**
- * windows 系统文件上传路径
- * */
+ * windows 系统文件上传路径
+ */
private String windowsPath;
/**
* linux 系统文件上传路径
- * */
+ */
private String linuxPath;
/**
* upload path 根据系统环境获取上传路径
- * */
- public String getUploadPath(){
+ */
+ public String getUploadPath() {
return '\\' == File.separatorChar ? this.windowsPath : this.linuxPath;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/constant/ConfigurationConstant.java b/pear-common/src/main/java/com/pearadmin/common/constant/ConfigurationConstant.java
index 83a5cfd3fae407e06cc025f82118f77dfc1fa473..5c5caf3cdb2f93800c0fcc3a191df9c480029b18 100644
--- a/pear-common/src/main/java/com/pearadmin/common/constant/ConfigurationConstant.java
+++ b/pear-common/src/main/java/com/pearadmin/common/constant/ConfigurationConstant.java
@@ -1,5 +1,8 @@
package com.pearadmin.common.constant;
+/**
+ * @author 就眠仪式
+ */
public class ConfigurationConstant {
public final static String MAIN_HOST = "main_host";
diff --git a/pear-common/src/main/java/com/pearadmin/common/constant/ControllerConstant.java b/pear-common/src/main/java/com/pearadmin/common/constant/ControllerConstant.java
index d4f80a78e05ba6d654902d9d8ae4739c24d0c0a2..1ae0eec14877595dc9fa3e25a9e63361a99c39ce 100644
--- a/pear-common/src/main/java/com/pearadmin/common/constant/ControllerConstant.java
+++ b/pear-common/src/main/java/com/pearadmin/common/constant/ControllerConstant.java
@@ -2,28 +2,29 @@ package com.pearadmin.common.constant;
/**
* Describe: 接 口 静 态 常 量
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public class ControllerConstant {
/**
* 系统业务基础路径
- * */
+ */
public final static String API_SYSTEM_PREFIX = "/system/";
/**
* 代码生成基础路径
- * */
+ */
public final static String API_GENERATOR_PREFIX = "/generate/";
/**
* 定时任务基础路径
- * */
+ */
public final static String API_SCHEDULE_PREFIX = "/schedule/";
/**
* 工作流程基础路径
- * */
+ */
public final static String API_PROCESS_PREFIX = "/process/";
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/constant/GenerateConstant.java b/pear-common/src/main/java/com/pearadmin/common/constant/GenerateConstant.java
index 431bb9b8a679ceab5a2bfe428ba35212f043b743..c8672eb8a15ab431983e8af9c4e492216984c55a 100644
--- a/pear-common/src/main/java/com/pearadmin/common/constant/GenerateConstant.java
+++ b/pear-common/src/main/java/com/pearadmin/common/constant/GenerateConstant.java
@@ -2,107 +2,169 @@ package com.pearadmin.common.constant;
/**
* Describe: 代 码 生 成 通 用 常 量
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
-public class GenerateConstant
-{
+ */
+public class GenerateConstant {
- /** 单表(增删改查) */
+ /**
+ * 单表(增删改查)
+ */
public static final String TPL_CRUD = "crud";
- /** 树表(增删改查) */
+ /**
+ * 树表(增删改查)
+ */
public static final String TPL_TREE = "tree";
- /** 主子表(增删改查) */
+ /**
+ * 主子表(增删改查)
+ */
public static final String TPL_SUB = "sub";
- /** 树编码字段 */
+ /**
+ * 树编码字段
+ */
public static final String TREE_CODE = "treeCode";
- /** 树父编码字段 */
+ /**
+ * 树父编码字段
+ */
public static final String TREE_PARENT_CODE = "treeParentCode";
- /** 树名称字段 */
+ /**
+ * 树名称字段
+ */
public static final String TREE_NAME = "treeName";
- /** 上级菜单ID字段 */
+ /**
+ * 上级菜单ID字段
+ */
public static final String PARENT_MENU_ID = "parentMenuId";
- /** 上级菜单名称字段 */
+ /**
+ * 上级菜单名称字段
+ */
public static final String PARENT_MENU_NAME = "parentMenuName";
- /** 数据库字符串类型 */
- public static final String[] COLUMNTYPE_STR = { "char", "varchar", "narchar", "varchar2", "tinytext", "text",
- "mediumtext", "longtext" };
-
- /** 数据库时间类型 */
- public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
-
- /** 数据库数字类型 */
- public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
- "bigint", "float", "float", "double", "decimal" };
-
- /** 页面不需要编辑字段 */
- public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
-
- /** 页面不需要显示的列表字段 */
- public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by",
- "update_time" };
-
- /** 页面不需要查询字段 */
- public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by",
- "update_time", "remark" };
-
- /** Entity基类字段 */
- public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" };
-
- /** Tree基类字段 */
- public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors" };
-
- /** 文本框 */
+ /**
+ * 数据库字符串类型
+ */
+ public static final String[] COLUMNTYPE_STR = {"char", "varchar", "narchar", "varchar2", "tinytext", "text",
+ "mediumtext", "longtext"};
+
+ /**
+ * 数据库时间类型
+ */
+ public static final String[] COLUMNTYPE_TIME = {"datetime", "time", "date", "timestamp"};
+
+ /**
+ * 数据库数字类型
+ */
+ public static final String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "number", "integer",
+ "bigint", "float", "float", "double", "decimal"};
+
+ /**
+ * 页面不需要编辑字段
+ */
+ public static final String[] COLUMNNAME_NOT_EDIT = {"id", "create_by", "create_time", "del_flag"};
+
+ /**
+ * 页面不需要显示的列表字段
+ */
+ public static final String[] COLUMNNAME_NOT_LIST = {"id", "create_by", "create_time", "del_flag", "update_by",
+ "update_time"};
+
+ /**
+ * 页面不需要查询字段
+ */
+ public static final String[] COLUMNNAME_NOT_QUERY = {"id", "create_by", "create_time", "del_flag", "update_by",
+ "update_time", "remark"};
+
+ /**
+ * Entity基类字段
+ */
+ public static final String[] BASE_ENTITY = {"createBy", "createTime", "updateBy", "updateTime", "remark"};
+
+ /**
+ * Tree基类字段
+ */
+ public static final String[] TREE_ENTITY = {"parentName", "parentId", "orderNum", "ancestors"};
+
+ /**
+ * 文本框
+ */
public static final String HTML_INPUT = "input";
- /** 文本域 */
+ /**
+ * 文本域
+ */
public static final String HTML_TEXTAREA = "textarea";
- /** 下拉框 */
+ /**
+ * 下拉框
+ */
public static final String HTML_SELECT = "select";
- /** 单选框 */
+ /**
+ * 单选框
+ */
public static final String HTML_RADIO = "radio";
- /** 复选框 */
+ /**
+ * 复选框
+ */
public static final String HTML_CHECKBOX = "checkbox";
- /** 日期控件 */
+ /**
+ * 日期控件
+ */
public static final String HTML_DATETIME = "datetime";
- /** 上传控件 */
+ /**
+ * 上传控件
+ */
public static final String HTML_UPLOAD = "upload";
- /** 字符串类型 */
+ /**
+ * 字符串类型
+ */
public static final String TYPE_STRING = "String";
- /** 整型 */
+ /**
+ * 整型
+ */
public static final String TYPE_INTEGER = "Integer";
- /** 长整型 */
+ /**
+ * 长整型
+ */
public static final String TYPE_LONG = "Long";
- /** 浮点型 */
+ /**
+ * 浮点型
+ */
public static final String TYPE_DOUBLE = "Double";
- /** 高精度计算类型 */
+ /**
+ * 高精度计算类型
+ */
public static final String TYPE_BIGDECIMAL = "BigDecimal";
- /** 时间类型 */
+ /**
+ * 时间类型
+ */
public static final String TYPE_DATE = "Date";
- /** 模糊查询 */
+ /**
+ * 模糊查询
+ */
public static final String QUERY_LIKE = "LIKE";
- /** 需要 */
+ /**
+ * 需要
+ */
public static final String REQUIRE = "1";
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/constant/SystemConstant.java b/pear-common/src/main/java/com/pearadmin/common/constant/SystemConstant.java
index f0ab77cb60b6d8b7fcbe3a7a0603fcf6d08de6fd..06e2365d2dd33b8536c6cbc6874cc23116e2d9c3 100644
--- a/pear-common/src/main/java/com/pearadmin/common/constant/SystemConstant.java
+++ b/pear-common/src/main/java/com/pearadmin/common/constant/SystemConstant.java
@@ -2,33 +2,30 @@ package com.pearadmin.common.constant;
/**
* Describe: 系 统 常 量
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public class SystemConstant {
/**
* Windows 系统常量标识
- * */
+ */
public static String WINDOWS = "windows";
-
- /**
- * Linux 系统常量标识
- * */
- private static String Linux = "linux";
-
/**
* UTF-8 编码格式
- * */
- public static String UTF8 ="UTF-8";
-
+ */
+ public static String UTF8 = "UTF-8";
/**
* GBK 编码格式
- * */
+ */
public static String GBK = "GBK";
-
/**
* 空串
- * */
+ */
public static String EMPTY = "";
+ /**
+ * Linux 系统常量标识
+ */
+ private static String Linux = "linux";
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/exception/GlobalExceptionHandler.java b/pear-common/src/main/java/com/pearadmin/common/exception/GlobalExceptionHandler.java
index 2af08371a752d070e00932693a4c688cc073d5b8..da02ce5ad3062ad9a9dd874a6647f09d2d0dd06e 100644
--- a/pear-common/src/main/java/com/pearadmin/common/exception/GlobalExceptionHandler.java
+++ b/pear-common/src/main/java/com/pearadmin/common/exception/GlobalExceptionHandler.java
@@ -2,7 +2,6 @@ package com.pearadmin.common.exception;
import com.pearadmin.common.exception.base.BusinessException;
import com.pearadmin.common.tools.servlet.ServletUtil;
-import com.pearadmin.common.web.base.BaseController;
import com.pearadmin.common.web.domain.response.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.AccessDeniedException;
@@ -10,23 +9,25 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.ModelAndView;
+
import javax.servlet.http.HttpServletRequest;
/**
* Describe: 全局异常处理类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
/**
* 不 支 持 的 请 求 类 型
- * */
+ */
@ExceptionHandler({HttpRequestMethodNotSupportedException.class})
- public Result handleException(HttpRequestMethodNotSupportedException e){
- log.error(e.getMessage(),e);
+ public Result handleException(HttpRequestMethodNotSupportedException e) {
+ log.error(e.getMessage(), e);
return Result.failure("不支持' " + e.getMethod() + "'请求");
}
@@ -34,20 +35,18 @@ public class GlobalExceptionHandler {
* 拦 截 未 知 的 运 行 时 异 常
*/
@ExceptionHandler({RuntimeException.class})
- public Result notFount(RuntimeException e)
- {
+ public Result notFount(RuntimeException e) {
log.error("运行时异常:", e);
return Result.failure("运行时异常:" + e.getMessage());
}
/**
* 权 限 异 常 处 理
- * */
+ */
@ExceptionHandler({AccessDeniedException.class})
- public Object access(HttpServletRequest request,AccessDeniedException e){
+ public Object access(HttpServletRequest request, AccessDeniedException e) {
e.printStackTrace();
- if (ServletUtil.isAjax(request))
- {
+ if (ServletUtil.isAjax(request)) {
return Result.failure("暂无权限");
} else {
@@ -62,8 +61,7 @@ public class GlobalExceptionHandler {
* 系统异常
*/
@ExceptionHandler(Exception.class)
- public Result handleException(Exception e)
- {
+ public Result handleException(Exception e) {
log.error(e.getMessage(), e);
return Result.failure("服务器错误,请联系管理员");
}
@@ -72,15 +70,11 @@ public class GlobalExceptionHandler {
* 业务异常
*/
@ExceptionHandler(BusinessException.class)
- public Object businessException(HttpServletRequest request, BusinessException e)
- {
+ public Object businessException(HttpServletRequest request, BusinessException e) {
log.error(e.getMessage(), e);
- if (ServletUtil.isAjax(request))
- {
+ if (ServletUtil.isAjax(request)) {
return Result.failure(e.getMessage());
- }
- else
- {
+ } else {
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("errorMessage", e.getMessage());
modelAndView.setViewName("error/500");
diff --git a/pear-common/src/main/java/com/pearadmin/common/exception/auth/CaptchaException.java b/pear-common/src/main/java/com/pearadmin/common/exception/auth/CaptchaException.java
index d4f01132baaad454cc83498f041a1d6b66611d6f..5274b18913fbb5851380c60a1bde15ff12c2fc60 100644
--- a/pear-common/src/main/java/com/pearadmin/common/exception/auth/CaptchaException.java
+++ b/pear-common/src/main/java/com/pearadmin/common/exception/auth/CaptchaException.java
@@ -4,15 +4,16 @@ import org.springframework.security.core.AuthenticationException;
/**
* Describe: 验 证 码 异 常 类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public class CaptchaException extends AuthenticationException {
/**
* 验 证 码 异 常
- * */
- public CaptchaException(String message){
+ */
+ public CaptchaException(String message) {
super(message);
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/exception/base/BusinessException.java b/pear-common/src/main/java/com/pearadmin/common/exception/base/BusinessException.java
index 353437ad36d7492b0dfba386ac57142e316dde78..f9d7597f2691a58a1c03991fe5715e1bb3a27737 100644
--- a/pear-common/src/main/java/com/pearadmin/common/exception/base/BusinessException.java
+++ b/pear-common/src/main/java/com/pearadmin/common/exception/base/BusinessException.java
@@ -2,26 +2,27 @@ package com.pearadmin.common.exception.base;
/**
* Describe: 业 务 异 常
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public class BusinessException extends RuntimeException {
/**
* 异常消息
- * */
+ */
protected final String message;
/**
* 业务异常
- * */
- public BusinessException(String message){
+ */
+ public BusinessException(String message) {
this.message = message;
}
/**
* 异常获取
- * */
+ */
@Override
public String getMessage() {
return message;
diff --git a/pear-common/src/main/java/com/pearadmin/common/listener/SetupMailConfigListener.java b/pear-common/src/main/java/com/pearadmin/common/listener/SetupMailConfigListener.java
index b23807deae14041cf4fd40c6839a684a740b07f6..7b160faec7f3fee8b0436f0630f129c7451684b2 100644
--- a/pear-common/src/main/java/com/pearadmin/common/listener/SetupMailConfigListener.java
+++ b/pear-common/src/main/java/com/pearadmin/common/listener/SetupMailConfigListener.java
@@ -10,10 +10,10 @@ import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
-
/**
* Describe: 邮 件 配 置 监 听 器
- * Author: BoscoKuo
+ *
+ * @author BoscoKuo
* CreateTime: 2021/2/4 11:22
*/
@Component
diff --git a/pear-common/src/main/java/com/pearadmin/common/listener/event/MailConfigEvent.java b/pear-common/src/main/java/com/pearadmin/common/listener/event/MailConfigEvent.java
index b09e87c6c70a550250afa80f8c5a09bd60a44359..0b8e9de7e1dd1ac4f33099475004563ec0ddacb2 100644
--- a/pear-common/src/main/java/com/pearadmin/common/listener/event/MailConfigEvent.java
+++ b/pear-common/src/main/java/com/pearadmin/common/listener/event/MailConfigEvent.java
@@ -7,7 +7,8 @@ import java.util.Map;
/**
* Describe: 添 加 邮 箱 配 置 之 后,发 布 邮 箱 配 置 事 件
- * Author: BoscoKuo
+ *
+ * @author BoscoKuo
* CreateTime: 2021/2/4 11:23
*/
public class MailConfigEvent extends ApplicationEvent {
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/LoggingAspect.java b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/LoggingAspect.java
index 8e9eb3f47609521b1d0cb6624084855609537b33..7d240ef85e0f84a1ee906e993be8efd360ce7706 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/LoggingAspect.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/LoggingAspect.java
@@ -1,9 +1,9 @@
package com.pearadmin.common.plugins.logging.aop;
import com.pearadmin.common.plugins.logging.aop.annotation.Logging;
-import com.pearadmin.common.plugins.system.domain.SysBaseLog;
import com.pearadmin.common.plugins.logging.aop.enums.LoggingType;
import com.pearadmin.common.plugins.logging.async.LoggingFactory;
+import com.pearadmin.common.plugins.system.domain.SysBaseLog;
import com.pearadmin.common.tools.sequence.SequenceUtil;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
@@ -11,14 +11,16 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
+
import javax.annotation.Resource;
import java.lang.reflect.Method;
/**
* Describe: 日 志 切 面 实 现
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Aspect
@Component
public class LoggingAspect {
@@ -28,16 +30,16 @@ public class LoggingAspect {
/**
* 切 面 编 程
- * */
+ */
@Pointcut("@annotation(com.pearadmin.common.plugins.logging.aop.annotation.Logging) || @within(com.pearadmin.common.plugins.logging.aop.annotation.Logging)")
- public void dsPointCut() { }
+ public void dsPointCut() {
+ }
/**
* 处 理 系 统 日 志
- * */
+ */
@Around("dsPointCut()")
- private Object around(ProceedingJoinPoint joinPoint) throws Throwable
- {
+ private Object around(ProceedingJoinPoint joinPoint) throws Throwable {
SysBaseLog sysLog = new SysBaseLog();
Object result;
try {
@@ -50,11 +52,11 @@ public class LoggingAspect {
sysLog.setSuccess(true);
sysLog.setLoggingType(LoggingType.OPERATE);
result = joinPoint.proceed();
- }catch (Exception exception){
+ } catch (Exception exception) {
sysLog.setSuccess(false);
sysLog.setErrorMsg(exception.getMessage());
throw exception;
- }finally {
+ } finally {
loggingFactory.record(sysLog);
}
return result;
@@ -62,12 +64,12 @@ public class LoggingAspect {
/**
* 获 取 注 解
- * */
+ */
public com.pearadmin.common.plugins.logging.aop.annotation.Logging getLogging(ProceedingJoinPoint point) {
MethodSignature signature = (MethodSignature) point.getSignature();
Class extends Object> targetClass = point.getTarget().getClass();
com.pearadmin.common.plugins.logging.aop.annotation.Logging targetLogging = targetClass.getAnnotation(com.pearadmin.common.plugins.logging.aop.annotation.Logging.class);
- if ( targetLogging != null) {
+ if (targetLogging != null) {
return targetLogging;
} else {
Method method = signature.getMethod();
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/annotation/Logging.java b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/annotation/Logging.java
index 610753b4ce2fa548b82344eae9f3acdf6f03cb37..fbef5d491b62fcd974d58296c18dfa1478e03c0b 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/annotation/Logging.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/annotation/Logging.java
@@ -6,9 +6,10 @@ import java.lang.annotation.*;
/**
* Describe: 系 统 日 志 注 解
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Documented
@@ -16,21 +17,21 @@ public @interface Logging {
/**
* 默认无参输入
- * */
+ */
String value() default "暂无标题";
/**
* Title 默认输入
- * */
+ */
String title() default "暂无标题";
/**
* Describe 默认输入
- * */
+ */
String describe() default "暂无介绍";
/**
* 业 务 类 型 默认Query
- * */
+ */
BusinessType type() default BusinessType.QUERY;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/BusinessType.java b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/BusinessType.java
index 77c5aea1efc9f6382b5f88001a99cf9b2b91831d..54314a2a3ff8d84dddcf7db774e006ed3dfc27c6 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/BusinessType.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/BusinessType.java
@@ -2,38 +2,39 @@ package com.pearadmin.common.plugins.logging.aop.enums;
/**
* Describe: 日 志 业 务 类 型
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
-public enum BusinessType {
+ */
+public enum BusinessType {
- /**
- * 新增
- * */
- ADD,
+ /**
+ * 新增
+ */
+ ADD,
/**
* 修改
- * */
- EDIT,
+ */
+ EDIT,
/**
* 删除
- * */
- REMOVE,
+ */
+ REMOVE,
/**
* 查询
- * */
- QUERY,
+ */
+ QUERY,
/**
* 导出
- * */
- EXPORT,
+ */
+ EXPORT,
/**
* 其他
- * */
- OTHER;
+ */
+ OTHER;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/LoggingType.java b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/LoggingType.java
index c30deb395d0cf82ce96203d7360f6dda38ec1ff2..13238eb27a03e3c831267ea278ccb5cf342350f4 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/LoggingType.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/LoggingType.java
@@ -2,18 +2,19 @@ package com.pearadmin.common.plugins.logging.aop.enums;
/**
* Describe: 日 志 类 型
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public enum LoggingType {
/**
* 操 作 日 志
- * */
+ */
OPERATE,
/**
* 登 录 日 志
- * */
+ */
LOGIN
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/RequestMethod.java b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/RequestMethod.java
index 6c534f913e67cb809c79b012b7df9a016014c75e..3f8e63c8b1fd6d4a2122be358db2c7b8a3be19fa 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/RequestMethod.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/aop/enums/RequestMethod.java
@@ -2,29 +2,30 @@ package com.pearadmin.common.plugins.logging.aop.enums;
/**
* Describe: 请 求 方 式
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
-public enum RequestMethod {
+ */
+public enum RequestMethod {
/**
* Get 请求
- * */
+ */
GET,
/**
* Post 请求
- * */
+ */
POST,
/**
* Put 请求
- * */
+ */
PUT,
/**
* Delete 请求
- * */
+ */
DELETE;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/async/LoggingFactory.java b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/async/LoggingFactory.java
index c71620393fa07d77291e548592792c4b4186d569..33a3d8820ca018c5ba23a476c4a95a1adb93753b 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/logging/async/LoggingFactory.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/logging/async/LoggingFactory.java
@@ -4,27 +4,29 @@ import com.pearadmin.common.plugins.system.domain.SysBaseLog;
import com.pearadmin.common.plugins.system.service.SysContext;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
+
import javax.annotation.Resource;
/**
* Describe: 日 志 异 步 工 厂
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Component
public class LoggingFactory {
/**
* 引 入 日 志 服 务
- * */
+ */
@Resource
private SysContext sysContext;
/**
* 执 行 日 志 入 库 操 作
- * */
+ */
@Async
- public void record(SysBaseLog sysLog){
+ public void record(SysBaseLog sysLog) {
sysContext.saveLog(sysLog);
}
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/RepeatSubmitInterceptor.java b/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/RepeatSubmitInterceptor.java
index 69d712ce362a5ea2ebb54fa82c100ecef194ed50..9e480647061406e007b7674976fb9acc884c0bc4 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/RepeatSubmitInterceptor.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/RepeatSubmitInterceptor.java
@@ -6,47 +6,42 @@ import com.pearadmin.common.web.domain.response.Result;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
/**
* Describe: 防止重复提交拦截器
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Component
-public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter
-{
+public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter {
/**
* 前置拦截,进入处理活力前判断当前提交的内容是否重复
- * */
+ */
@Override
- public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
- {
- if (handler instanceof HandlerMethod)
- {
+ public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+ if (handler instanceof HandlerMethod) {
HandlerMethod handlerMethod = (HandlerMethod) handler;
Method method = handlerMethod.getMethod();
RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
- if (annotation != null)
- {
- if (this.isRepeatSubmit(request))
- {
+ if (annotation != null) {
+ if (this.isRepeatSubmit(request)) {
Result result = new Result();
result.setSuccess(false);
result.setMsg("不允许重复提交,请稍后再试");
result.setCode(500);
- response.setHeader("Content-type","application/json;charset=UTF-8");
+ response.setHeader("Content-type", "application/json;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
response.getWriter().write(JSON.toJSONString(result));
return false;
}
}
return true;
- }
- else
- {
+ } else {
return super.preHandle(request, response, handler);
}
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/annotation/RepeatSubmit.java b/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/annotation/RepeatSubmit.java
index d84457761c9b7b08d82513e894464b23ce8b5bf2..c6f2675ec3d6d80f7efe51e76407b80f78bf5f97 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/annotation/RepeatSubmit.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/annotation/RepeatSubmit.java
@@ -4,13 +4,14 @@ import java.lang.annotation.*;
/**
* Describe: 表单重复提交注解
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RepeatSubmit {
// @annotation
-}
\ No newline at end of file
+}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/impl/SameUrlDataInterceptor.java b/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/impl/SameUrlDataInterceptor.java
index a073ea57edee543873c5d824ce09f14bcb7498a2..fa21f614bd5e96da2e307e344a1f37cfd8e3591d 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/impl/SameUrlDataInterceptor.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/repeat/impl/SameUrlDataInterceptor.java
@@ -3,6 +3,7 @@ package com.pearadmin.common.plugins.repeat.impl;
import com.alibaba.fastjson.JSONObject;
import com.pearadmin.common.plugins.repeat.RepeatSubmitInterceptor;
import org.springframework.stereotype.Component;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
@@ -10,15 +11,15 @@ import java.util.Map;
/**
* Describe: 判断请求url和数据是否和上一次相同,如果和上次相同,则是重复提交表单。 有效时间为10秒内。
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Component
-public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
-{
+public class SameUrlDataInterceptor extends RepeatSubmitInterceptor {
/**
* 常用字符串标识
- * */
+ */
public final String REPEAT_PARAMS = "repeatParams";
public final String REPEAT_TIME = "repeatTime";
@@ -27,19 +28,17 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
/**
* 间隔时间,单位:秒 默认10秒
- *
+ *
* 两次相同参数的请求,如果间隔时间大于该参数,系统不会认定为重复提交的数据
*/
private int intervalTime = 10;
- public void setIntervalTime(int intervalTime)
- {
+ public void setIntervalTime(int intervalTime) {
this.intervalTime = intervalTime;
}
@Override
- public boolean isRepeatSubmit(HttpServletRequest request)
- {
+ public boolean isRepeatSubmit(HttpServletRequest request) {
// 本次参数及系统时间
String nowParams = JSONObject.toJSONString(request.getParameterMap());
Map nowDataMap = new HashMap();
@@ -51,14 +50,11 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
HttpSession session = request.getSession();
Object sessionObj = session.getAttribute(SESSION_REPEAT_KEY);
- if (sessionObj != null)
- {
+ if (sessionObj != null) {
Map sessionMap = (Map) sessionObj;
- if (sessionMap.containsKey(url))
- {
+ if (sessionMap.containsKey(url)) {
Map preDataMap = (Map) sessionMap.get(url);
- if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap))
- {
+ if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap)) {
return true;
}
}
@@ -71,12 +67,12 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
/**
* 判断参数是否相同
+ *
* @param nowMap 本次参数
* @param preMap 上次参数
* @return boolean 是否相同
*/
- private boolean compareParams(Map nowMap, Map preMap)
- {
+ private boolean compareParams(Map nowMap, Map preMap) {
String nowParams = (String) nowMap.get(REPEAT_PARAMS);
String preParams = (String) preMap.get(REPEAT_PARAMS);
return nowParams.equals(preParams);
@@ -84,12 +80,12 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
/**
* 判断两次间隔时间
+ *
* @param nowMap 本次时间
* @param preMap 上次时间
* @return 注释
*/
- private boolean compareTime(Map nowMap, Map preMap)
- {
+ private boolean compareTime(Map nowMap, Map preMap) {
long time1 = (Long) nowMap.get(REPEAT_TIME);
long time2 = (Long) preMap.get(REPEAT_TIME);
return (time1 - time2) < (this.intervalTime * 1000L);
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseConfig.java b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseConfig.java
index 7638833b21d81ba3b7241fa5a20db02c8d7fe2f8..7ee671784cfb74ae8da942b245b9fc2f12f2e7bd 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseConfig.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseConfig.java
@@ -4,27 +4,27 @@ public class SysBaseConfig {
/**
* 配置标识
- * */
+ */
private String configId;
/**
* 配置名称
- * */
+ */
private String configName;
/**
* 配置类型
- * */
+ */
private String configType;
/**
* 配置标识
- * */
+ */
private String configCode;
/**
* 配置值
- * */
+ */
private String configValue;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseDict.java b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseDict.java
index b424de87210444040e9fa85a4791b52d498321ec..a68fa33b3afe1004a1aba5dc99905876ec0344c5 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseDict.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseDict.java
@@ -5,40 +5,41 @@ import lombok.Data;
/**
* Describe: 字典值领域模型
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
public class SysBaseDict extends BaseDomain {
/**
- * id 编号
- * */
+ * id 编号
+ */
private String dataId;
/**
- * 字典显示
- * */
+ * 字典显示
+ */
private String dataLabel;
/**
* 字典值
- * */
+ */
private String dataValue;
/**
* 字典类型
- * */
+ */
private String typeCode;
/**
* 是否为默认
- * */
+ */
private String isDefault;
/**
* 是否启用
- * */
+ */
private String enable;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseLog.java b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseLog.java
index 4193882a0403316d7a311d5901fef23b03191cb3..9c258aa2704e5e8c8e32ee03a8de02ff4dc39a81 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseLog.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseLog.java
@@ -4,6 +4,7 @@ import com.pearadmin.common.plugins.logging.aop.enums.BusinessType;
import com.pearadmin.common.plugins.logging.aop.enums.LoggingType;
import com.pearadmin.common.plugins.logging.aop.enums.RequestMethod;
import lombok.Data;
+
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBasePower.java b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBasePower.java
index d36ebe06808463c2f69c08d42270aacce11efaf4..b3a5ed7406a01c5c1c9e7deeb601fac3470c06d7 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBasePower.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBasePower.java
@@ -5,65 +5,66 @@ import lombok.Data;
/**
* Describe: 权限领域模型
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
public class SysBasePower extends BaseDomain {
/**
* 编号
- * */
+ */
private String powerId;
/**
* 权限名称
- * */
+ */
private String powerName;
/**
* 类型
- * */
+ */
private String powerType;
/**
* 标识
- * */
+ */
private String powerCode;
/**
* 路径
- * */
+ */
private String powerUrl;
/**
* 打开方式
- * */
+ */
private String openType;
/**
* 父级编号
- * */
+ */
private String parentId;
/**
* 图标
- * */
+ */
private String icon;
/**
* 排序
- * */
+ */
private Integer sort;
/**
* 开启
- * */
+ */
private Boolean enable;
/**
* 计算列 提供给前端组件
- * */
+ */
private String checkArr = "0";
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseRole.java b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseRole.java
index 78ccd170bb417d536fa32db12f803b68837a9390..a8f6dd637c35527b2651c9f0b14ee482e1046dfc 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseRole.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseRole.java
@@ -5,30 +5,31 @@ import lombok.Data;
/**
* Describe: 角色领域模型
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
public class SysBaseRole extends BaseDomain {
/**
* 编号
- * */
+ */
private String roleId;
/**
* 角色名称
- * */
+ */
private String roleName;
/**
* 角色值
- * */
+ */
private String roleCode;
/**
* 状态
- * */
+ */
private String enable;
/**
@@ -38,11 +39,11 @@ public class SysBaseRole extends BaseDomain {
/**
* 排序
- * */
+ */
private Integer sort;
/**
* 提供前端 显示
- * */
+ */
private boolean checked = false;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseUser.java b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseUser.java
index ca15810f92b052abd1f9b8a24a6569d406dcefb1..0d320920e3510ae3ed959fea32a516e97a02212c 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseUser.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/system/domain/SysBaseUser.java
@@ -1,103 +1,102 @@
package com.pearadmin.common.plugins.system.domain;
+import com.pearadmin.common.web.base.BaseDomain;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
-import com.pearadmin.common.web.base.BaseDomain;
+
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;
/**
* Describe: 用户领域模型
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
public class SysBaseUser extends BaseDomain implements UserDetails {
/**
* 编号
- * */
+ */
private String userId;
/**
* 账户
- * */
+ */
private String username;
/**
* 密码
- * */
+ */
private String password;
/**
* 盐
- * */
+ */
private String salt;
/**
* 状态
- * */
+ */
private String status;
/**
* 姓名
- * */
+ */
private String realName;
/**
* 邮箱
- * */
+ */
private String email;
/**
* 头像
- * */
+ */
private String avatar;
/**
* 性别
- * */
+ */
private String sex;
/**
* 电话
- * */
+ */
private String phone;
/**
* 所属部门
- * */
+ */
private String deptId;
/**
* 是否启用
- * */
+ */
private String enable;
/**
* 是否登录
- * */
+ */
private String login;
/**
* 计算列
- * */
+ */
private String roleIds;
/**
* 最后一次登录时间
- *
- * */
+ */
private LocalDateTime lastTime;
/**
- *
* 权限 这里暂时不用 security 的 Authorities
- *
*/
private List powerList;
@@ -113,7 +112,7 @@ public class SysBaseUser extends BaseDomain implements UserDetails {
@Override
public boolean isAccountNonLocked() {
- return "1".equals(this.getStatus())?true:false;
+ return "1".equals(this.getStatus()) ? true : false;
}
@Override
@@ -123,7 +122,7 @@ public class SysBaseUser extends BaseDomain implements UserDetails {
@Override
public boolean isEnabled() {
- return "1".equals(this.getEnable())?true:false;
+ return "1".equals(this.getEnable()) ? true : false;
}
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/plugins/system/service/SysContext.java b/pear-common/src/main/java/com/pearadmin/common/plugins/system/service/SysContext.java
index 6739bbe7c469ad2915d7cf2f036111bf9e0e1b12..7c74af3dfcdc3bee905b13dd63f4096d894a2584 100644
--- a/pear-common/src/main/java/com/pearadmin/common/plugins/system/service/SysContext.java
+++ b/pear-common/src/main/java/com/pearadmin/common/plugins/system/service/SysContext.java
@@ -1,85 +1,95 @@
package com.pearadmin.common.plugins.system.service;
-import com.pearadmin.common.plugins.logging.aop.enums.BusinessType;
-import com.pearadmin.common.plugins.logging.aop.enums.LoggingType;
-import com.pearadmin.common.plugins.system.domain.*;
+import com.pearadmin.common.plugins.system.domain.SysBaseDict;
+import com.pearadmin.common.plugins.system.domain.SysBaseLog;
+import com.pearadmin.common.plugins.system.domain.SysBaseRole;
+import com.pearadmin.common.plugins.system.domain.SysBaseUser;
+
import java.util.List;
/**
* Describe: 系统基础 API
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public interface SysContext {
-
- /**
- * 根据用户账号查询用户信息
- * @param username
- * @return
- */
- SysBaseUser getUserByName(String username);
+ /**
+ * 根据用户账号查询用户信息
+ *
+ * @param username
+ * @return
+ */
+ SysBaseUser getUserByName(String username);
+
+
+ /**
+ * 根据用户id查询用户信息
+ *
+ * @param id
+ * @return
+ */
+ SysBaseUser getUserById(String id);
- /**
- * 根据用户id查询用户信息
- * @param id
- * @return
- */
- SysBaseUser getUserById(String id);
-
- /**
- * 通过用户账号查询角色集合
- * @param username
- * @return
- */
- List getRolesByUsername(String username);
+ /**
+ * 通过用户账号查询角色集合
+ *
+ * @param username
+ * @return
+ */
+ List getRolesByUsername(String username);
- /**
- * 根据字典code获取可用的字典列表数据
- * @param typeCode
- * @return
- */
- List selectDictByCode(String typeCode);
+ /**
+ * 根据字典code获取可用的字典列表数据
+ *
+ * @param typeCode
+ * @return
+ */
+ List selectDictByCode(String typeCode);
- /**
- * 查询表字典通过查询指定table的 text code key 获取字典值
- * @param table 表名
- * @param text label
- * @param code value
- * @return
- */
+ /**
+ * 查询表字典通过查询指定table的 text code key 获取字典值
+ *
+ * @param table 表名
+ * @param text label
+ * @param code value
+ * @return
+ */
List queryTableDictItemsByCode(String table, String text, String code);
- /**
- * 查询表字典 通过查询指定table的 text code 获取字典(指定查询条件)
- * @param table 表名
- * @param text label
- * @param code value
- * @return
- */
- List queryTableDictItemsByCodeAndFilter(String table, String text, String code, String filterSql);
+ /**
+ * 查询表字典 通过查询指定table的 text code 获取字典(指定查询条件)
+ *
+ * @param table 表名
+ * @param text label
+ * @param code value
+ * @return
+ */
+ List queryTableDictItemsByCodeAndFilter(String table, String text, String code, String filterSql);
- /**
- * 查询表字典 通过查询指定table的 text code key 获取字典值,包含value
- * @param table 表名
- * @param text label
- * @param code value
- * @param keyArray values
- * @return
- */
- ListqueryTableDictByKeys(String table, String text, String code, String[] keyArray);
+ /**
+ * 查询表字典 通过查询指定table的 text code key 获取字典值,包含value
+ *
+ * @param table 表名
+ * @param text label
+ * @param code value
+ * @param keyArray values
+ * @return
+ */
+ List queryTableDictByKeys(String table, String text, String code, String[] keyArray);
- /**
- * 查询系统配置
- *
- * @param code
- * */
- String getConfig(String code);
+ /**
+ * 查询系统配置
+ *
+ * @param code
+ */
+ String getConfig(String code);
- /**
- * 存储日志
- * */
- Boolean saveLog(SysBaseLog log);
+ /**
+ * 存储日志
+ */
+ Boolean saveLog(SysBaseLog log);
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/common/FileUtil.java b/pear-common/src/main/java/com/pearadmin/common/tools/common/FileUtil.java
index 9c9369cc8d8405f21557945b71c270968815e5ef..f42ab65595c78c041e281a22b951881c684f9bfe 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/common/FileUtil.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/common/FileUtil.java
@@ -2,9 +2,10 @@ package com.pearadmin.common.tools.common;
/**
* Describe: 文 件 工 具 类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public class FileUtil {
public static String getPrintSize(long size) {
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/database/SqlInjectionUtil.java b/pear-common/src/main/java/com/pearadmin/common/tools/database/SqlInjectionUtil.java
index ebe6902f7c2c8f79b34b5888fc98305aecd37a0a..341cdbbe084c0d8242cc3cb41ab477fde810176d 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/database/SqlInjectionUtil.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/database/SqlInjectionUtil.java
@@ -12,153 +12,150 @@ import java.security.MessageDigest;
*/
@Slf4j
public class SqlInjectionUtil {
- /**
- * sign 用于表字典加签的盐值【SQL漏洞】
- * (上线修改值 20200501,同步修改前端的盐值)
- */
- private final static String TABLE_DICT_SIGN_SALT = "20200501";
- private final static String xssStr = "'|and |exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|or |+|,";
+ /**
+ * sign 用于表字典加签的盐值【SQL漏洞】
+ * (上线修改值 20200501,同步修改前端的盐值)
+ */
+ private final static String TABLE_DICT_SIGN_SALT = "20200501";
+ private final static String xssStr = "'|and |exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|or |+|,";
- /*
- * 针对表字典进行额外的sign签名校验(增加安全机制)
- * @param dictCode:
- * @param sign:
- * @param request:
- * @Return: void
- */
- public static void checkDictTableSign(String dictCode, String sign, HttpServletRequest request) {
- //表字典SQL注入漏洞,签名校验
- String accessToken = request.getHeader("X-Access-Token");
- String signStr = dictCode + SqlInjectionUtil.TABLE_DICT_SIGN_SALT + accessToken;
- String javaSign = MD5(signStr.getBytes());
- if (!javaSign.equals(sign)) {
- log.error("表字典,SQL注入漏洞签名校验失败 :" + sign + "!=" + javaSign+ ",dictCode=" + dictCode);
- throw new RuntimeException("无权限访问!");
- }
- log.info(" 表字典,SQL注入漏洞签名校验成功!sign=" + sign + ",dictCode=" + dictCode);
- }
+ /*
+ * 针对表字典进行额外的sign签名校验(增加安全机制)
+ * @param dictCode:
+ * @param sign:
+ * @param request:
+ * @Return: void
+ */
+ public static void checkDictTableSign(String dictCode, String sign, HttpServletRequest request) {
+ //表字典SQL注入漏洞,签名校验
+ String accessToken = request.getHeader("X-Access-Token");
+ String signStr = dictCode + SqlInjectionUtil.TABLE_DICT_SIGN_SALT + accessToken;
+ String javaSign = MD5(signStr.getBytes());
+ if (!javaSign.equals(sign)) {
+ log.error("表字典,SQL注入漏洞签名校验失败 :" + sign + "!=" + javaSign + ",dictCode=" + dictCode);
+ throw new RuntimeException("无权限访问!");
+ }
+ log.info(" 表字典,SQL注入漏洞签名校验成功!sign=" + sign + ",dictCode=" + dictCode);
+ }
- /** 字节数组,计算MD5值 */
- public static String MD5(byte[] data)
- {
- try
- {
- // 获取data的MD5摘要
- MessageDigest digest = MessageDigest.getInstance("MD5");
- // mdInst.update(content.getBytes());
- digest.update(data);
- byte[] array = digest.digest();
+ /**
+ * 字节数组,计算MD5值
+ */
+ public static String MD5(byte[] data) {
+ try {
+ // 获取data的MD5摘要
+ MessageDigest digest = MessageDigest.getInstance("MD5");
+ // mdInst.update(content.getBytes());
+ digest.update(data);
+ byte[] array = digest.digest();
- // 转换为十六进制的字符串形式
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < array.length; i++)
- {
- String shaHex = Integer.toHexString(array[i] & 0xFF);
- if (shaHex.length() < 2)
- {
- buf.append(0);
- }
- buf.append(shaHex);
- }
- return buf.toString();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return "";
- }
- }
- /**
- * sql注入过滤处理,遇到注入关键字抛异常
- *
- * @param value
- * @return
- */
- public static void filterContent(String value) {
- if (value == null || "".equals(value)) {
- return;
- }
- // 统一转为小写
- value = value.toLowerCase();
- String[] xssArr = xssStr.split("\\|");
- for (String s : xssArr) {
- if (value.contains(s)) {
- log.error("请注意,存在SQL注入关键词---> {}", s);
- log.error("请注意,值可能存在SQL注入风险!---> {}", value);
- throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
- }
- }
- }
+ // 转换为十六进制的字符串形式
+ StringBuffer buf = new StringBuffer();
+ for (int i = 0; i < array.length; i++) {
+ String shaHex = Integer.toHexString(array[i] & 0xFF);
+ if (shaHex.length() < 2) {
+ buf.append(0);
+ }
+ buf.append(shaHex);
+ }
+ return buf.toString();
+ } catch (Exception e) {
+ e.printStackTrace();
+ return "";
+ }
+ }
- /**
- * sql注入过滤处理,遇到注入关键字抛异常
- *
- * @param values
- * @return
- */
- public static void filterContent(String[] values) {
- String[] xssArr = xssStr.split("\\|");
- for (String value : values) {
- if (value == null || "".equals(value)) {
- return;
- }
- // 统一转为小写
- value = value.toLowerCase();
- for (String s : xssArr) {
- if (value.contains(s)) {
- log.error("请注意,存在SQL注入关键词---> {}", s);
- log.error("请注意,值可能存在SQL注入风险!---> {}", value);
- throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
- }
- }
- }
- }
+ /**
+ * sql注入过滤处理,遇到注入关键字抛异常
+ *
+ * @param value
+ * @return
+ */
+ public static void filterContent(String value) {
+ if (value == null || "".equals(value)) {
+ return;
+ }
+ // 统一转为小写
+ value = value.toLowerCase();
+ String[] xssArr = xssStr.split("\\|");
+ for (String s : xssArr) {
+ if (value.contains(s)) {
+ log.error("请注意,存在SQL注入关键词---> {}", s);
+ log.error("请注意,值可能存在SQL注入风险!---> {}", value);
+ throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
+ }
+ }
+ }
- /**
- * @特殊方法(不通用) 仅用于字典条件SQL参数,注入过滤
- * @param value
- * @return
- */
+ /**
+ * sql注入过滤处理,遇到注入关键字抛异常
+ *
+ * @param values
+ * @return
+ */
+ public static void filterContent(String[] values) {
+ String[] xssArr = xssStr.split("\\|");
+ for (String value : values) {
+ if (value == null || "".equals(value)) {
+ return;
+ }
+ // 统一转为小写
+ value = value.toLowerCase();
+ for (String s : xssArr) {
+ if (value.contains(s)) {
+ log.error("请注意,存在SQL注入关键词---> {}", s);
+ log.error("请注意,值可能存在SQL注入风险!---> {}", value);
+ throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
+ }
+ }
+ }
+ }
- public static void specialFilterContent(String value) {
- String specialXssStr = " exec | insert | select | delete | update | drop | count | chr | mid | master | truncate | char | declare |;|+|";
- String[] xssArr = specialXssStr.split("\\|");
- if (value == null || "".equals(value)) {
- return;
- }
- // 统一转为小写
- value = value.toLowerCase();
- for (String s : xssArr) {
- if (value.contains(s) || value.startsWith(s.trim())) {
- log.error("请注意,存在SQL注入关键词---> {}", s);
- log.error("请注意,值可能存在SQL注入风险!---> {}", value);
- throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
- }
- }
- }
+ /**
+ * @param value
+ * @return
+ * @特殊方法(不通用) 仅用于字典条件SQL参数,注入过滤
+ */
+
+ public static void specialFilterContent(String value) {
+ String specialXssStr = " exec | insert | select | delete | update | drop | count | chr | mid | master | truncate | char | declare |;|+|";
+ String[] xssArr = specialXssStr.split("\\|");
+ if (value == null || "".equals(value)) {
+ return;
+ }
+ // 统一转为小写
+ value = value.toLowerCase();
+ for (String s : xssArr) {
+ if (value.contains(s) || value.startsWith(s.trim())) {
+ log.error("请注意,存在SQL注入关键词---> {}", s);
+ log.error("请注意,值可能存在SQL注入风险!---> {}", value);
+ throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
+ }
+ }
+ }
/**
- * @特殊方法(不通用) 仅用于Online报表SQL解析,注入过滤
* @param value
* @return
+ * @特殊方法(不通用) 仅用于Online报表SQL解析,注入过滤
*/
- @Deprecated
- public static void specialFilterContentForOnlineReport(String value) {
- String specialXssStr = " exec | insert | delete | update | drop | chr | mid | master | truncate | char | declare |";
- String[] xssArr = specialXssStr.split("\\|");
- if (value == null || "".equals(value)) {
- return;
- }
- // 统一转为小写
- value = value.toLowerCase();
- for (String s : xssArr) {
- if (value.contains(s) || value.startsWith(s.trim())) {
- log.error("请注意,存在SQL注入关键词---> {}", s);
- log.error("请注意,值可能存在SQL注入风险!---> {}", value);
- throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
- }
- }
- }
+ @Deprecated
+ public static void specialFilterContentForOnlineReport(String value) {
+ String specialXssStr = " exec | insert | delete | update | drop | chr | mid | master | truncate | char | declare |";
+ String[] xssArr = specialXssStr.split("\\|");
+ if (value == null || "".equals(value)) {
+ return;
+ }
+ // 统一转为小写
+ value = value.toLowerCase();
+ for (String s : xssArr) {
+ if (value.contains(s) || value.startsWith(s.trim())) {
+ log.error("请注意,存在SQL注入关键词---> {}", s);
+ log.error("请注意,值可能存在SQL注入风险!---> {}", value);
+ throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
+ }
+ }
+ }
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/datetime/DateUtil.java b/pear-common/src/main/java/com/pearadmin/common/tools/datetime/DateUtil.java
index 026a06da1d209be51f26aa4e7643540d0e902ccf..27b80dbb80d8ef13f9b5b6e521996b8258623b67 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/datetime/DateUtil.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/datetime/DateUtil.java
@@ -1,6 +1,7 @@
package com.pearadmin.common.tools.datetime;
import org.apache.commons.lang3.time.DateFormatUtils;
+
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -8,11 +9,11 @@ import java.util.Date;
/**
* Describe: 日 期 工 具 类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
-public class DateUtil extends org.apache.commons.lang3.time.DateUtils
-{
+ */
+public class DateUtil extends org.apache.commons.lang3.time.DateUtils {
public static String YYYY = "yyyy";
public static String YYYY_MM = "yyyy-MM";
@@ -22,58 +23,48 @@ public class DateUtil extends org.apache.commons.lang3.time.DateUtils
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
private static String[] parsePatterns = {
- "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
+ "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
/**
* 获取当前Date型日期
- *
+ *
* @return Date() 当前日期
*/
- public static Date getNowDate()
- {
+ public static Date getNowDate() {
return new Date();
}
/**
* 获取当前日期, 默认格式为yyyy-MM-dd
- *
+ *
* @return String
*/
- public static String getDate()
- {
+ public static String getDate() {
return dateTimeNow(YYYY_MM_DD);
}
- public static final String getTime()
- {
+ public static final String getTime() {
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
}
- public static final String dateTimeNow(final String format)
- {
+ public static final String dateTimeNow(final String format) {
return parseDateToStr(format, new Date());
}
- public static final String dateTime(final Date date)
- {
+ public static final String dateTime(final Date date) {
return parseDateToStr(YYYY_MM_DD, date);
}
- public static final String parseDateToStr(final String format, final Date date)
- {
+ public static final String parseDateToStr(final String format, final Date date) {
return new SimpleDateFormat(format).format(date);
}
- public static final Date dateTime(final String format, final String ts)
- {
- try
- {
+ public static final Date dateTime(final String format, final String ts) {
+ try {
return new SimpleDateFormat(format).parse(ts);
- }
- catch (ParseException e)
- {
+ } catch (ParseException e) {
throw new RuntimeException(e);
}
}
@@ -81,8 +72,7 @@ public class DateUtil extends org.apache.commons.lang3.time.DateUtils
/**
* 日期路径 即年/月/日 如2018/08/08
*/
- public static final String datePath()
- {
+ public static final String datePath() {
Date now = new Date();
return DateFormatUtils.format(now, "yyyy/MM/dd");
}
@@ -90,8 +80,7 @@ public class DateUtil extends org.apache.commons.lang3.time.DateUtils
/**
* 日期路径 即年/月/日 如20180808
*/
- public static final String dateTime()
- {
+ public static final String dateTime() {
Date now = new Date();
return DateFormatUtils.format(now, "yyyyMMdd");
}
@@ -99,18 +88,13 @@ public class DateUtil extends org.apache.commons.lang3.time.DateUtils
/**
* 日期型字符串转化为日期 格式
*/
- public static Date parseDate(Object str)
- {
- if (str == null)
- {
+ public static Date parseDate(Object str) {
+ if (str == null) {
return null;
}
- try
- {
+ try {
return parseDate(str.toString(), parsePatterns);
- }
- catch (ParseException e)
- {
+ } catch (ParseException e) {
return null;
}
}
@@ -118,8 +102,7 @@ public class DateUtil extends org.apache.commons.lang3.time.DateUtils
/**
* 获取服务器启动时间
*/
- public static Date getServerStartDate()
- {
+ public static Date getServerStartDate() {
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
return new Date(time);
}
@@ -127,8 +110,7 @@ public class DateUtil extends org.apache.commons.lang3.time.DateUtils
/**
* 计算两个时间差
*/
- public static String getDatePoor(Date endDate, Date nowDate)
- {
+ public static String getDatePoor(Date endDate, Date nowDate) {
long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/jsoup/JsoupUtil.java b/pear-common/src/main/java/com/pearadmin/common/tools/jsoup/JsoupUtil.java
index f8804895db0806f4da00f400055f745a06a63293..5d6125e2fb9cd40ac5b0d48f0595a3f6ad2c3cc6 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/jsoup/JsoupUtil.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/jsoup/JsoupUtil.java
@@ -5,6 +5,9 @@ import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.safety.Whitelist;
+/**
+ * @author 就 眠 仪 式
+ */
public class JsoupUtil {
private static final Whitelist whitelist = Whitelist.basicWithImages();
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/secure/SecurityUtil.java b/pear-common/src/main/java/com/pearadmin/common/tools/secure/SecurityUtil.java
index 0cad31ebe11534036d35492c774f6846e9b0b486..7f45ae0b0fbe04916d2e3e4b4729215176596a1d 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/secure/SecurityUtil.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/secure/SecurityUtil.java
@@ -6,16 +6,17 @@ import org.springframework.security.core.context.SecurityContextHolder;
/**
* Describe: Security 工 具 类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public class SecurityUtil {
/**
* 获取当前登录用户的信息
* return Authentication 权鉴对象
- * */
- public static Authentication currentUser(){
+ */
+ public static Authentication currentUser() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (!(authentication instanceof AnonymousAuthenticationToken)) {
return authentication;
@@ -25,9 +26,10 @@ public class SecurityUtil {
/**
* 验证当前用户是否登录
+ *
* @return boolean 是否登录
- * */
- public static boolean isAuthentication(){
+ */
+ public static boolean isAuthentication() {
// if security session eq s-id is not null to index
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
return !(auth instanceof AnonymousAuthenticationToken);
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/sequence/SequenceUtil.java b/pear-common/src/main/java/com/pearadmin/common/tools/sequence/SequenceUtil.java
index 5ff3203695bf55b1f6f9badbaa19728ef2f2c51b..90267b56f5001cfaa3ecb2f93f72fe4ba122ae49 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/sequence/SequenceUtil.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/sequence/SequenceUtil.java
@@ -7,35 +7,47 @@ import java.util.Set;
/**
* Describe: Sequence 工具类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public class SequenceUtil {
- /*** 机 器 Id */
- private static long workerId = 0;
- /*** 数 据 中 心 */
- private static long centerId = 0;
- /*** 毫 秒 内 序 列 */
- private static long sequence = 0L;
- /*** 上 次 Id 生 成 的 时 间 戳 */
- private static long lastTimestamp = -1L;
- /** 机 器 编 号 所 占 位 数 */
+ /**
+ * 机 器 编 号 所 占 位 数
+ */
private static final long workerIdBits = 5L;
- /** 数 据 标 识 所 占 位 数 */
+ /**
+ * 数 据 标 识 所 占 位 数
+ */
private static final long centerIdBits = 5L;
- /** 开 始 时 间 戳 */
+ /**
+ * 开 始 时 间 戳
+ */
private static final long poc = 1288834974657L;
- /** 序 列 在 Id 中 所 占 的 位 数 */
+ /**
+ * 序 列 在 Id 中 所 占 的 位 数
+ */
private static final long sequenceBits = 12L;
- /** 为 算 法 提 供 可 用 配 置 */
+ /**
+ * 为 算 法 提 供 可 用 配 置
+ */
private static final long workerIdShift = sequenceBits;
private static final long maxWorkerId = ~(-1L << workerIdBits);
private static final long maxCenterId = ~(-1L << centerIdBits);
private static final long centerIdShift = sequenceBits + workerIdBits;
private static final long timestampLeftShift = sequenceBits + workerIdBits + centerIdBits;
private static final long sequenceMask = ~(-1L << sequenceBits);
- public static synchronized long makeSequence() throws Exception{
+ /*** 机 器 Id */
+ private static long workerId = 0;
+ /*** 数 据 中 心 */
+ private static long centerId = 0;
+ /*** 毫 秒 内 序 列 */
+ private static long sequence = 0L;
+ /*** 上 次 Id 生 成 的 时 间 戳 */
+ private static long lastTimestamp = -1L;
+
+ public static synchronized long makeSequence() throws Exception {
long timestamp = timeGen();
// 当 前 时 间 小 于 上 次 Id 生 成 时 间 ,说 明 系 统 时 钟 回 退, 应 会 抛 出 异 常
if (timestamp < lastTimestamp) {
@@ -62,11 +74,11 @@ public class SequenceUtil {
/**
* 获 取 下 一 个 Id
- * */
- public static long makeId(){
+ */
+ public static long makeId() {
try {
return makeSequence();
- }catch (Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
return -1;
@@ -74,34 +86,23 @@ public class SequenceUtil {
/**
* 获 取 下 一 个 Id ( String 类型 )
- * */
- public static String makeStringId(){
+ */
+ public static String makeStringId() {
return "" + makeId();
}
- public static List makeStringIds(int size){
+ public static List makeStringIds(int size) {
List ids = new ArrayList();
- for (int i = 0;i makeId(int initSize) throws Exception{
- Set ids = new HashSet(initSize);
- for (long current = 0; current < initSize; current++){
- ids.add(makeId());
- }
- return ids;
- }
-
/**
* 时 间 戳 比 对
- * */
+ */
protected static long tilNextMillis(long lastTimestamp) {
long timestamp = timeGen();
while (timestamp <= lastTimestamp) {
@@ -112,9 +113,20 @@ public class SequenceUtil {
/**
* 当 前 系 统 时 间 毫 秒
- * */
+ */
protected static long timeGen() {
return System.currentTimeMillis();
}
+
+ /**
+ * 根 据 一 定 数 量 的 Id
+ */
+ public Set makeId(int initSize) throws Exception {
+ Set ids = new HashSet(initSize);
+ for (long current = 0; current < initSize; current++) {
+ ids.add(makeId());
+ }
+ return ids;
+ }
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/servlet/ServletUtil.java b/pear-common/src/main/java/com/pearadmin/common/tools/servlet/ServletUtil.java
index f62a3b8c71aae080317b0f67c9bc5b902cbf0f00..6683e5d8c06e4a7c674805503561a2cd9c2b67da 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/servlet/ServletUtil.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/servlet/ServletUtil.java
@@ -11,9 +11,10 @@ import java.io.IOException;
/**
* Describe: Servlet 工具类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public class ServletUtil {
@@ -21,8 +22,8 @@ public class ServletUtil {
* Describe: 获取 HttpServletRequest 对象
* Param null
* Return HttpServletRequest
- * */
- public static HttpServletRequest getRequest(){
+ */
+ public static HttpServletRequest getRequest() {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
return servletRequestAttributes.getRequest();
}
@@ -31,8 +32,8 @@ public class ServletUtil {
* Describe: 获取 HttpServletResponse 对象
* Param null
* Return HttpServletResponse
- * */
- public static HttpServletResponse getResponse(){
+ */
+ public static HttpServletResponse getResponse() {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
return servletRequestAttributes.getResponse();
}
@@ -41,8 +42,8 @@ public class ServletUtil {
* Describe: 获取 HttpServletSession 对象
* Param null
* Return HttpServletSession
- * */
- public static HttpSession getSession(){
+ */
+ public static HttpSession getSession() {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
return servletRequestAttributes.getRequest().getSession();
}
@@ -51,12 +52,12 @@ public class ServletUtil {
* Describe: 判断是否为 Ajax 请求
* Param null
* Return HttpServletSession
- * */
- public static Boolean isAjax(HttpServletRequest request){
+ */
+ public static Boolean isAjax(HttpServletRequest request) {
String requestType = request.getHeader("X-Requested-With");
- if("XMLHttpRequest".equals(requestType)){
+ if ("XMLHttpRequest".equals(requestType)) {
return true;
- }else{
+ } else {
return false;
}
}
@@ -65,90 +66,90 @@ public class ServletUtil {
* Describe: Response 对象写出数据
* Param: msg 消息数据
* Return null
- * */
- public static void write(String msg) throws IOException{
+ */
+ public static void write(String msg) throws IOException {
HttpServletResponse response = getResponse();
- response.setHeader("Content-type","application/json;charset=UTF-8");
+ response.setHeader("Content-type", "application/json;charset=UTF-8");
response.setCharacterEncoding(SystemConstant.UTF8);
response.getWriter().write(msg);
}
/**
* 获取查询参数
- * */
- public static String getQueryParam(){
+ */
+ public static String getQueryParam() {
return getRequest().getQueryString();
}
/**
* 获取请求地址
- * */
+ */
public static String getRequestURI() {
return getRequest().getRequestURI();
}
/**
* 获取客户端地址
- * */
- public static String getRemoteHost(){
+ */
+ public static String getRemoteHost() {
String remoteHost = getRequest().getRemoteHost();
- if(remoteHost.equals("0:0:0:0:0:0:0:1")){
+ if (remoteHost.equals("0:0:0:0:0:0:0:1")) {
remoteHost = "127.0.0.1";
}
- return remoteHost ;
+ return remoteHost;
}
/**
* 获取当前请求方法
- * */
- public static String getMethod(){
+ */
+ public static String getMethod() {
return getRequest().getMethod();
}
/**
* 获取请求头
- * */
- public static String getHeader(String name){
+ */
+ public static String getHeader(String name) {
return getRequest().getHeader(name);
}
/**
* 获取 UserAgent
- * */
- public static String getAgent(){
+ */
+ public static String getAgent() {
return getHeader("User-Agent");
}
/**
* 获取浏览器类型
- * */
- public static String getBrowser(){
+ */
+ public static String getBrowser() {
String userAgent = getAgent();
- if (userAgent.contains("Firefox")){
+ if (userAgent.contains("Firefox")) {
return "火狐浏览器";
- }else if (userAgent.contains("Chrome")){
+ } else if (userAgent.contains("Chrome")) {
return "谷歌浏览器";
- }else if (userAgent.contains("Trident")){
+ } else if (userAgent.contains("Trident")) {
return "IE 浏览器";
- }else{
+ } else {
return "你用啥浏览器";
}
}
/**
* 获取浏览器类型
- * */
- public static String getSystem(){
+ */
+ public static String getSystem() {
String userAgent = getAgent();
- if (userAgent.toLowerCase().contains("windows" )) {
+ if (userAgent.toLowerCase().contains("windows")) {
return "Windows";
- } else if (userAgent.toLowerCase().contains("mac" )) {
+ } else if (userAgent.toLowerCase().contains("mac")) {
return "Mac";
- } else if (userAgent.toLowerCase().contains("x11" )) {
+ } else if (userAgent.toLowerCase().contains("x11")) {
return "Unix";
- } else if (userAgent.toLowerCase().contains("android" )) {
+ } else if (userAgent.toLowerCase().contains("android")) {
return "Android";
- } else if (userAgent.toLowerCase().contains("iphone" )) {
+ } else if (userAgent.toLowerCase().contains("iphone")) {
return "IPhone";
} else {
return "UnKnown, More-Info: " + userAgent;
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/spring/SpringUtil.java b/pear-common/src/main/java/com/pearadmin/common/tools/spring/SpringUtil.java
index a0d7fe9c3385f523075f058f4dd82b0ff8fcd95e..05b0a5d69207ead1c33a4e1de2d5f72b6de3aee6 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/spring/SpringUtil.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/spring/SpringUtil.java
@@ -7,20 +7,15 @@ import org.springframework.stereotype.Component;
/**
* Describe: Spring 工 具 类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Component
public class SpringUtil implements ApplicationContextAware {
public static ApplicationContext applicationContext;
- @Override
- public void setApplicationContext(ApplicationContext applicationContext)
- throws BeansException {
- SpringUtil.applicationContext = applicationContext;
- }
-
public static Object getBean(String name) {
return applicationContext.getBean(name);
}
@@ -41,4 +36,10 @@ public class SpringUtil implements ApplicationContextAware {
return applicationContext.getType(name);
}
+ @Override
+ public void setApplicationContext(ApplicationContext applicationContext)
+ throws BeansException {
+ SpringUtil.applicationContext = applicationContext;
+ }
+
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/string/CharsetKit.java b/pear-common/src/main/java/com/pearadmin/common/tools/string/CharsetKit.java
index c6dc22e0f9885caadb7bc76fe54c2de05503ec70..cd43663c1b728f6c297a2b733b7feb51e0c4bcd2 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/string/CharsetKit.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/string/CharsetKit.java
@@ -6,21 +6,34 @@ import java.nio.charset.StandardCharsets;
/**
* 字符集工具类
+ *
+ * @author 就 眠 仪 式
*/
-public class CharsetKit
-{
- /** ISO-8859-1 */
+public class CharsetKit {
+ /**
+ * ISO-8859-1
+ */
public static final String ISO_8859_1 = "ISO-8859-1";
- /** UTF-8 */
+ /**
+ * UTF-8
+ */
public static final String UTF_8 = "UTF-8";
- /** GBK */
+ /**
+ * GBK
+ */
public static final String GBK = "GBK";
- /** ISO-8859-1 */
+ /**
+ * ISO-8859-1
+ */
public static final Charset CHARSET_ISO_8859_1 = StandardCharsets.ISO_8859_1;
- /** UTF-8 */
+ /**
+ * UTF-8
+ */
public static final Charset CHARSET_UTF_8 = StandardCharsets.UTF_8;
- /** GBK */
+ /**
+ * GBK
+ */
public static final Charset CHARSET_GBK = Charset.forName(GBK);
/**
@@ -29,46 +42,40 @@ public class CharsetKit
* @param charset 字符集,为空则返回默认字符集
* @return Charset
*/
- public static Charset charset(String charset)
- {
+ public static Charset charset(String charset) {
return StringUtil.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
}
/**
* 转换字符串的字符集编码
*
- * @param source 字符串
- * @param srcCharset 源字符集,默认ISO-8859-1
+ * @param source 字符串
+ * @param srcCharset 源字符集,默认ISO-8859-1
* @param destCharset 目标字符集,默认UTF-8
* @return 转换后的字符集
*/
- public static String convert(String source, String srcCharset, String destCharset)
- {
+ public static String convert(String source, String srcCharset, String destCharset) {
return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
}
/**
* 转换字符串的字符集编码
*
- * @param source 字符串
- * @param srcCharset 源字符集,默认ISO-8859-1
+ * @param source 字符串
+ * @param srcCharset 源字符集,默认ISO-8859-1
* @param destCharset 目标字符集,默认UTF-8
* @return 转换后的字符集
*/
- public static String convert(String source, Charset srcCharset, Charset destCharset)
- {
- if (null == srcCharset)
- {
+ public static String convert(String source, Charset srcCharset, Charset destCharset) {
+ if (null == srcCharset) {
srcCharset = StandardCharsets.ISO_8859_1;
}
- if (null == destCharset)
- {
+ if (null == destCharset) {
srcCharset = StandardCharsets.UTF_8;
}
- if (StringUtil.isEmpty(source) || srcCharset.equals(destCharset))
- {
+ if (StringUtil.isEmpty(source) || srcCharset.equals(destCharset)) {
return source;
}
return new String(source.getBytes(srcCharset), destCharset);
@@ -77,8 +84,7 @@ public class CharsetKit
/**
* @return 系统字符集编码
*/
- public static String systemCharset()
- {
+ public static String systemCharset() {
return Charset.defaultCharset().name();
}
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/string/Convert.java b/pear-common/src/main/java/com/pearadmin/common/tools/string/Convert.java
index 86ef4cf098b0c87126a6fc6a3a65f1ff43b56c2b..56138c5bc3d833e424dad1168644a7946f20186f 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/string/Convert.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/string/Convert.java
@@ -9,26 +9,24 @@ import java.util.Set;
/**
* 类型转换器
+ *
+ * @author 就 眠 仪 式
*/
-public class Convert
-{
+public class Convert {
/**
* 转换为字符串
* 如果给定的值为null,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static String toStr(Object value, String defaultValue)
- {
- if (null == value)
- {
+ public static String toStr(Object value, String defaultValue) {
+ if (null == value) {
return defaultValue;
}
- if (value instanceof String)
- {
+ if (value instanceof String) {
return (String) value;
}
return value.toString();
@@ -42,8 +40,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static String toStr(Object value)
- {
+ public static String toStr(Object value) {
return toStr(value, null);
}
@@ -52,18 +49,15 @@ public class Convert
* 如果给定的值为null,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static Character toChar(Object value, Character defaultValue)
- {
- if (null == value)
- {
+ public static Character toChar(Object value, Character defaultValue) {
+ if (null == value) {
return defaultValue;
}
- if (value instanceof Character)
- {
+ if (value instanceof Character) {
return (Character) value;
}
@@ -79,8 +73,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static Character toChar(Object value)
- {
+ public static Character toChar(Object value) {
return toChar(value, null);
}
@@ -89,35 +82,27 @@ public class Convert
* 如果给定的值为null
,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static Byte toByte(Object value, Byte defaultValue)
- {
- if (value == null)
- {
+ public static Byte toByte(Object value, Byte defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (value instanceof Byte)
- {
+ if (value instanceof Byte) {
return (Byte) value;
}
- if (value instanceof Number)
- {
+ if (value instanceof Number) {
return ((Number) value).byteValue();
}
final String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
- try
- {
+ try {
return Byte.parseByte(valueStr);
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return defaultValue;
}
}
@@ -130,8 +115,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static Byte toByte(Object value)
- {
+ public static Byte toByte(Object value) {
return toByte(value, null);
}
@@ -140,35 +124,27 @@ public class Convert
* 如果给定的值为null
,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static Short toShort(Object value, Short defaultValue)
- {
- if (value == null)
- {
+ public static Short toShort(Object value, Short defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (value instanceof Short)
- {
+ if (value instanceof Short) {
return (Short) value;
}
- if (value instanceof Number)
- {
+ if (value instanceof Number) {
return ((Number) value).shortValue();
}
final String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
- try
- {
+ try {
return Short.parseShort(valueStr.trim());
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return defaultValue;
}
}
@@ -181,8 +157,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static Short toShort(Object value)
- {
+ public static Short toShort(Object value) {
return toShort(value, null);
}
@@ -191,31 +166,24 @@ public class Convert
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static Number toNumber(Object value, Number defaultValue)
- {
- if (value == null)
- {
+ public static Number toNumber(Object value, Number defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (value instanceof Number)
- {
+ if (value instanceof Number) {
return (Number) value;
}
final String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
- try
- {
+ try {
return NumberFormat.getInstance().parse(valueStr);
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return defaultValue;
}
}
@@ -228,8 +196,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static Number toNumber(Object value)
- {
+ public static Number toNumber(Object value) {
return toNumber(value, null);
}
@@ -238,35 +205,27 @@ public class Convert
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static Integer toInt(Object value, Integer defaultValue)
- {
- if (value == null)
- {
+ public static Integer toInt(Object value, Integer defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (value instanceof Integer)
- {
+ if (value instanceof Integer) {
return (Integer) value;
}
- if (value instanceof Number)
- {
+ if (value instanceof Number) {
return ((Number) value).intValue();
}
final String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
- try
- {
+ try {
return Integer.parseInt(valueStr.trim());
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return defaultValue;
}
}
@@ -279,8 +238,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static Integer toInt(Object value)
- {
+ public static Integer toInt(Object value) {
return toInt(value, null);
}
@@ -290,8 +248,7 @@ public class Convert
* @param str 被转换的值
* @return 结果
*/
- public static Integer[] toIntArray(String str)
- {
+ public static Integer[] toIntArray(String str) {
return toIntArray(",", str);
}
@@ -301,8 +258,7 @@ public class Convert
* @param str 被转换的值
* @return 结果
*/
- public static Long[] toLongArray(String str)
- {
+ public static Long[] toLongArray(String str) {
return toLongArray(",", str);
}
@@ -313,16 +269,13 @@ public class Convert
* @param split 被转换的值
* @return 结果
*/
- public static Integer[] toIntArray(String split, String str)
- {
- if (StringUtil.isEmpty(str))
- {
- return new Integer[] {};
+ public static Integer[] toIntArray(String split, String str) {
+ if (StringUtil.isEmpty(str)) {
+ return new Integer[]{};
}
String[] arr = str.split(split);
final Integer[] ints = new Integer[arr.length];
- for (int i = 0; i < arr.length; i++)
- {
+ for (int i = 0; i < arr.length; i++) {
final Integer v = toInt(arr[i], 0);
ints[i] = v;
}
@@ -333,19 +286,16 @@ public class Convert
* 转换为Long数组
*
* @param split 分隔符
- * @param str 被转换的值
+ * @param str 被转换的值
* @return 结果
*/
- public static Long[] toLongArray(String split, String str)
- {
- if (StringUtil.isEmpty(str))
- {
- return new Long[] {};
+ public static Long[] toLongArray(String split, String str) {
+ if (StringUtil.isEmpty(str)) {
+ return new Long[]{};
}
String[] arr = str.split(split);
final Long[] longs = new Long[arr.length];
- for (int i = 0; i < arr.length; i++)
- {
+ for (int i = 0; i < arr.length; i++) {
final Long v = toLong(arr[i], null);
longs[i] = v;
}
@@ -358,8 +308,7 @@ public class Convert
* @param str 被转换的值
* @return 结果
*/
- public static String[] toStrArray(String str)
- {
+ public static String[] toStrArray(String str) {
return toStrArray(",", str);
}
@@ -370,8 +319,7 @@ public class Convert
* @param split 被转换的值
* @return 结果
*/
- public static String[] toStrArray(String split, String str)
- {
+ public static String[] toStrArray(String split, String str) {
return str.split(split);
}
@@ -380,36 +328,28 @@ public class Convert
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static Long toLong(Object value, Long defaultValue)
- {
- if (value == null)
- {
+ public static Long toLong(Object value, Long defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (value instanceof Long)
- {
+ if (value instanceof Long) {
return (Long) value;
}
- if (value instanceof Number)
- {
+ if (value instanceof Number) {
return ((Number) value).longValue();
}
final String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
- try
- {
+ try {
// 支持科学计数法
return new BigDecimal(valueStr.trim()).longValue();
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return defaultValue;
}
}
@@ -422,8 +362,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static Long toLong(Object value)
- {
+ public static Long toLong(Object value) {
return toLong(value, null);
}
@@ -432,36 +371,28 @@ public class Convert
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static Double toDouble(Object value, Double defaultValue)
- {
- if (value == null)
- {
+ public static Double toDouble(Object value, Double defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (value instanceof Double)
- {
+ if (value instanceof Double) {
return (Double) value;
}
- if (value instanceof Number)
- {
+ if (value instanceof Number) {
return ((Number) value).doubleValue();
}
final String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
- try
- {
+ try {
// 支持科学计数法
return new BigDecimal(valueStr.trim()).doubleValue();
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return defaultValue;
}
}
@@ -474,8 +405,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static Double toDouble(Object value)
- {
+ public static Double toDouble(Object value) {
return toDouble(value, null);
}
@@ -484,35 +414,27 @@ public class Convert
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static Float toFloat(Object value, Float defaultValue)
- {
- if (value == null)
- {
+ public static Float toFloat(Object value, Float defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (value instanceof Float)
- {
+ if (value instanceof Float) {
return (Float) value;
}
- if (value instanceof Number)
- {
+ if (value instanceof Number) {
return ((Number) value).floatValue();
}
final String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
- try
- {
+ try {
return Float.parseFloat(valueStr.trim());
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return defaultValue;
}
}
@@ -525,8 +447,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static Float toFloat(Object value)
- {
+ public static Float toFloat(Object value) {
return toFloat(value, null);
}
@@ -535,28 +456,23 @@ public class Convert
* String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static Boolean toBool(Object value, Boolean defaultValue)
- {
- if (value == null)
- {
+ public static Boolean toBool(Object value, Boolean defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (value instanceof Boolean)
- {
+ if (value instanceof Boolean) {
return (Boolean) value;
}
String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
valueStr = valueStr.trim().toLowerCase();
- switch (valueStr)
- {
+ switch (valueStr) {
case "true":
return true;
case "false":
@@ -584,8 +500,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static Boolean toBool(Object value)
- {
+ public static Boolean toBool(Object value) {
return toBool(value, null);
}
@@ -593,34 +508,27 @@ public class Convert
* 转换为Enum对象
* 如果给定的值为空,或者转换失败,返回默认值
*
- * @param clazz Enum的Class
- * @param value 值
+ * @param clazz Enum的Class
+ * @param value 值
* @param defaultValue 默认值
* @return Enum
*/
- public static > E toEnum(Class clazz, Object value, E defaultValue)
- {
- if (value == null)
- {
+ public static > E toEnum(Class clazz, Object value, E defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (clazz.isAssignableFrom(value.getClass()))
- {
+ if (clazz.isAssignableFrom(value.getClass())) {
@SuppressWarnings("unchecked")
E myE = (E) value;
return myE;
}
final String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
- try
- {
+ try {
return Enum.valueOf(clazz, valueStr);
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return defaultValue;
}
}
@@ -633,8 +541,7 @@ public class Convert
* @param value 值
* @return Enum
*/
- public static > E toEnum(Class clazz, Object value)
- {
+ public static > E toEnum(Class clazz, Object value) {
return toEnum(clazz, value, null);
}
@@ -643,35 +550,27 @@ public class Convert
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static BigInteger toBigInteger(Object value, BigInteger defaultValue)
- {
- if (value == null)
- {
+ public static BigInteger toBigInteger(Object value, BigInteger defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (value instanceof BigInteger)
- {
+ if (value instanceof BigInteger) {
return (BigInteger) value;
}
- if (value instanceof Long)
- {
+ if (value instanceof Long) {
return BigInteger.valueOf((Long) value);
}
final String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
- try
- {
+ try {
return new BigInteger(valueStr);
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return defaultValue;
}
}
@@ -684,8 +583,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static BigInteger toBigInteger(Object value)
- {
+ public static BigInteger toBigInteger(Object value) {
return toBigInteger(value, null);
}
@@ -694,43 +592,33 @@ public class Convert
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错
*
- * @param value 被转换的值
+ * @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
- public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue)
- {
- if (value == null)
- {
+ public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) {
+ if (value == null) {
return defaultValue;
}
- if (value instanceof BigDecimal)
- {
+ if (value instanceof BigDecimal) {
return (BigDecimal) value;
}
- if (value instanceof Long)
- {
+ if (value instanceof Long) {
return new BigDecimal((Long) value);
}
- if (value instanceof Double)
- {
+ if (value instanceof Double) {
return BigDecimal.valueOf((Double) value);
}
- if (value instanceof Integer)
- {
+ if (value instanceof Integer) {
return new BigDecimal((Integer) value);
}
final String valueStr = toStr(value, null);
- if (StringUtil.isEmpty(valueStr))
- {
+ if (StringUtil.isEmpty(valueStr)) {
return defaultValue;
}
- try
- {
+ try {
return new BigDecimal(valueStr);
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return defaultValue;
}
}
@@ -743,8 +631,7 @@ public class Convert
* @param value 被转换的值
* @return 结果
*/
- public static BigDecimal toBigDecimal(Object value)
- {
+ public static BigDecimal toBigDecimal(Object value) {
return toBigDecimal(value, null);
}
@@ -755,8 +642,7 @@ public class Convert
* @param obj 对象
* @return 字符串
*/
- public static String utf8Str(Object obj)
- {
+ public static String utf8Str(Object obj) {
return str(obj, CharsetKit.CHARSET_UTF_8);
}
@@ -764,12 +650,11 @@ public class Convert
* 将对象转为字符串
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
*
- * @param obj 对象
+ * @param obj 对象
* @param charsetName 字符集
* @return 字符串
*/
- public static String str(Object obj, String charsetName)
- {
+ public static String str(Object obj, String charsetName) {
return str(obj, Charset.forName(charsetName));
}
@@ -777,27 +662,20 @@ public class Convert
* 将对象转为字符串
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
*
- * @param obj 对象
+ * @param obj 对象
* @param charset 字符集
* @return 字符串
*/
- public static String str(Object obj, Charset charset)
- {
- if (null == obj)
- {
+ public static String str(Object obj, Charset charset) {
+ if (null == obj) {
return null;
}
- if (obj instanceof String)
- {
+ if (obj instanceof String) {
return (String) obj;
- }
- else if (obj instanceof byte[] || obj instanceof Byte[])
- {
+ } else if (obj instanceof byte[] || obj instanceof Byte[]) {
return str((Byte[]) obj, charset);
- }
- else if (obj instanceof ByteBuffer)
- {
+ } else if (obj instanceof ByteBuffer) {
return str((ByteBuffer) obj, charset);
}
return obj.toString();
@@ -806,31 +684,27 @@ public class Convert
/**
* 将byte数组转为字符串
*
- * @param bytes byte数组
+ * @param bytes byte数组
* @param charset 字符集
* @return 字符串
*/
- public static String str(byte[] bytes, String charset)
- {
+ public static String str(byte[] bytes, String charset) {
return str(bytes, StringUtil.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset));
}
/**
* 解码字节码
*
- * @param data 字符串
+ * @param data 字符串
* @param charset 字符集,如果此字段为空,则解码的结果取决于平台
* @return 解码后的字符串
*/
- public static String str(byte[] data, Charset charset)
- {
- if (data == null)
- {
+ public static String str(byte[] data, Charset charset) {
+ if (data == null) {
return null;
}
- if (null == charset)
- {
+ if (null == charset) {
return new String(data);
}
return new String(data, charset);
@@ -839,14 +713,12 @@ public class Convert
/**
* 将编码的byteBuffer数据转换为字符串
*
- * @param data 数据
+ * @param data 数据
* @param charset 字符集,如果为空使用当前系统字符集
* @return 字符串
*/
- public static String str(ByteBuffer data, String charset)
- {
- if (data == null)
- {
+ public static String str(ByteBuffer data, String charset) {
+ if (data == null) {
return null;
}
@@ -856,55 +728,47 @@ public class Convert
/**
* 将编码的byteBuffer数据转换为字符串
*
- * @param data 数据
+ * @param data 数据
* @param charset 字符集,如果为空使用当前系统字符集
* @return 字符串
*/
- public static String str(ByteBuffer data, Charset charset)
- {
- if (null == charset)
- {
+ public static String str(ByteBuffer data, Charset charset) {
+ if (null == charset) {
charset = Charset.defaultCharset();
}
return charset.decode(data).toString();
}
// ----------------------------------------------------------------------- 全角半角转换
+
/**
* 半角转全角
*
* @param input String.
* @return 全角字符串.
*/
- public static String toSBC(String input)
- {
+ public static String toSBC(String input) {
return toSBC(input, null);
}
/**
* 半角转全角
*
- * @param input String
+ * @param input String
* @param notConvertSet 不替换的字符集合
* @return 全角字符串.
*/
- public static String toSBC(String input, Set notConvertSet)
- {
+ public static String toSBC(String input, Set notConvertSet) {
char c[] = input.toCharArray();
- for (int i = 0; i < c.length; i++)
- {
- if (null != notConvertSet && notConvertSet.contains(c[i]))
- {
+ for (int i = 0; i < c.length; i++) {
+ if (null != notConvertSet && notConvertSet.contains(c[i])) {
// 跳过不替换的字符
continue;
}
- if (c[i] == ' ')
- {
+ if (c[i] == ' ') {
c[i] = '\u3000';
- }
- else if (c[i] < '\177')
- {
+ } else if (c[i] < '\177') {
c[i] = (char) (c[i] + 65248);
}
@@ -918,35 +782,28 @@ public class Convert
* @param input String.
* @return 半角字符串
*/
- public static String toDBC(String input)
- {
+ public static String toDBC(String input) {
return toDBC(input, null);
}
/**
* 替换全角为半角
*
- * @param text 文本
+ * @param text 文本
* @param notConvertSet 不替换的字符集合
* @return 替换后的字符
*/
- public static String toDBC(String text, Set notConvertSet)
- {
+ public static String toDBC(String text, Set notConvertSet) {
char c[] = text.toCharArray();
- for (int i = 0; i < c.length; i++)
- {
- if (null != notConvertSet && notConvertSet.contains(c[i]))
- {
+ for (int i = 0; i < c.length; i++) {
+ if (null != notConvertSet && notConvertSet.contains(c[i])) {
// 跳过不替换的字符
continue;
}
- if (c[i] == '\u3000')
- {
+ if (c[i] == '\u3000') {
c[i] = ' ';
- }
- else if (c[i] > '\uFF00' && c[i] < '\uFF5F')
- {
+ } else if (c[i] > '\uFF00' && c[i] < '\uFF5F') {
c[i] = (char) (c[i] - 65248);
}
}
@@ -960,31 +817,26 @@ public class Convert
* @param n 数字
* @return 中文大写数字
*/
- public static String digitUppercase(double n)
- {
- String[] fraction = { "角", "分" };
- String[] digit = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" };
- String[][] unit = { { "元", "万", "亿" }, { "", "拾", "佰", "仟" } };
+ public static String digitUppercase(double n) {
+ String[] fraction = {"角", "分"};
+ String[] digit = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
+ String[][] unit = {{"元", "万", "亿"}, {"", "拾", "佰", "仟"}};
String head = n < 0 ? "负" : "";
n = Math.abs(n);
StringBuilder s = new StringBuilder();
- for (int i = 0; i < fraction.length; i++)
- {
+ for (int i = 0; i < fraction.length; i++) {
s.append((digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""));
}
- if (s.length() < 1)
- {
+ if (s.length() < 1) {
s = new StringBuilder("整");
}
int integerPart = (int) Math.floor(n);
- for (int i = 0; i < unit[0].length && integerPart > 0; i++)
- {
+ for (int i = 0; i < unit[0].length && integerPart > 0; i++) {
StringBuilder p = new StringBuilder();
- for (int j = 0; j < unit[1].length && n > 0; j++)
- {
+ for (int j = 0; j < unit[1].length && n > 0; j++) {
p.insert(0, digit[integerPart % 10] + unit[1][j]);
integerPart = integerPart / 10;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/string/StrFormatter.java b/pear-common/src/main/java/com/pearadmin/common/tools/string/StrFormatter.java
index 0880204dfbba9c2767a508d37ae9a188ffbb0f5e..4efd98c06378fc30dc13e7b4bce6489dd92bda45 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/string/StrFormatter.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/string/StrFormatter.java
@@ -4,8 +4,7 @@ package com.pearadmin.common.tools.string;
/**
* 字符串格式化
*/
-public class StrFormatter
-{
+public class StrFormatter {
public static final String EMPTY_JSON = "{}";
public static final char C_BACKSLASH = '\\';
public static final char C_DELIM_START = '{';
@@ -19,15 +18,13 @@ public class StrFormatter
* 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
- *
+ *
* @param strPattern 字符串模板
- * @param argArray 参数列表
+ * @param argArray 参数列表
* @return 结果
*/
- public static String format(final String strPattern, final Object... argArray)
- {
- if (StringUtil.isEmpty(strPattern) || StringUtil.isEmpty(argArray))
- {
+ public static String format(final String strPattern, final Object... argArray) {
+ if (StringUtil.isEmpty(strPattern) || StringUtil.isEmpty(argArray)) {
return strPattern;
}
final int strPatternLength = strPattern.length();
@@ -37,43 +34,30 @@ public class StrFormatter
int handledPosition = 0;
int delimIndex;// 占位符所在位置
- for (int argIndex = 0; argIndex < argArray.length; argIndex++)
- {
+ for (int argIndex = 0; argIndex < argArray.length; argIndex++) {
delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
- if (delimIndex == -1)
- {
- if (handledPosition == 0)
- {
+ if (delimIndex == -1) {
+ if (handledPosition == 0) {
return strPattern;
- }
- else
- { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
+ } else { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
sbuf.append(strPattern, handledPosition, strPatternLength);
return sbuf.toString();
}
- }
- else
- {
- if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH)
- {
- if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH)
- {
+ } else {
+ if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) {
+ if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) {
// 转义符之前还有一个转义符,占位符依旧有效
sbuf.append(strPattern, handledPosition, delimIndex - 1);
sbuf.append(Convert.utf8Str(argArray[argIndex]));
handledPosition = delimIndex + 2;
- }
- else
- {
+ } else {
// 占位符被转义
argIndex--;
sbuf.append(strPattern, handledPosition, delimIndex - 1);
sbuf.append(C_DELIM_START);
handledPosition = delimIndex + 1;
}
- }
- else
- {
+ } else {
// 正常占位符
sbuf.append(strPattern, handledPosition, delimIndex);
sbuf.append(Convert.utf8Str(argArray[argIndex]));
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/string/StringUtil.java b/pear-common/src/main/java/com/pearadmin/common/tools/string/StringUtil.java
index 5af29bcd5d1572508394b8b466d13dc5e4a5be33..76b2c2fd3c76c8a7dc8c2497741049f4b80e0505 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/string/StringUtil.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/string/StringUtil.java
@@ -7,179 +7,164 @@ import java.util.Map;
/**
* 字符串工具类
*/
-public class StringUtil extends org.apache.commons.lang3.StringUtils
-{
- /** 空字符串 */
+public class StringUtil extends org.apache.commons.lang3.StringUtils {
+ /**
+ * 空字符串
+ */
private static final String NULLSTR = "";
- /** 下划线 */
+ /**
+ * 下划线
+ */
private static final char SEPARATOR = '_';
/**
* 获取参数不为空值
- *
+ *
* @param value defaultValue 要判断的value
* @return value 返回值
*/
- public static T nvl(T value, T defaultValue)
- {
+ public static T nvl(T value, T defaultValue) {
return value != null ? value : defaultValue;
}
/**
* * 判断一个Collection是否为空, 包含List,Set,Queue
- *
+ *
* @param coll 要判断的Collection
* @return true:为空 false:非空
*/
- public static boolean isEmpty(Collection> coll)
- {
+ public static boolean isEmpty(Collection> coll) {
return isNull(coll) || coll.isEmpty();
}
/**
* * 判断一个Collection是否非空,包含List,Set,Queue
- *
+ *
* @param coll 要判断的Collection
* @return true:非空 false:空
*/
- public static boolean isNotEmpty(Collection> coll)
- {
+ public static boolean isNotEmpty(Collection> coll) {
return !isEmpty(coll);
}
/**
* * 判断一个对象数组是否为空
- *
+ *
* @param objects 要判断的对象数组
- ** @return true:为空 false:非空
+ * * @return true:为空 false:非空
*/
- public static boolean isEmpty(Object[] objects)
- {
+ public static boolean isEmpty(Object[] objects) {
return isNull(objects) || (objects.length == 0);
}
/**
* * 判断一个对象数组是否非空
- *
+ *
* @param objects 要判断的对象数组
* @return true:非空 false:空
*/
- public static boolean isNotEmpty(Object[] objects)
- {
+ public static boolean isNotEmpty(Object[] objects) {
return !isEmpty(objects);
}
/**
* * 判断一个Map是否为空
- *
+ *
* @param map 要判断的Map
* @return true:为空 false:非空
*/
- public static boolean isEmpty(Map, ?> map)
- {
+ public static boolean isEmpty(Map, ?> map) {
return isNull(map) || map.isEmpty();
}
/**
* * 判断一个Map是否为空
- *
+ *
* @param map 要判断的Map
* @return true:非空 false:空
*/
- public static boolean isNotEmpty(Map, ?> map)
- {
+ public static boolean isNotEmpty(Map, ?> map) {
return !isEmpty(map);
}
/**
* * 判断一个字符串是否为空串
- *
+ *
* @param str String
* @return true:为空 false:非空
*/
- public static boolean isEmpty(String str)
- {
+ public static boolean isEmpty(String str) {
return isNull(str) || NULLSTR.equals(str.trim());
}
/**
* * 判断一个字符串是否为非空串
- *
+ *
* @param str String
* @return true:非空串 false:空串
*/
- public static boolean isNotEmpty(String str)
- {
+ public static boolean isNotEmpty(String str) {
return !isEmpty(str);
}
/**
* * 判断一个对象是否为空
- *
+ *
* @param object Object
* @return true:为空 false:非空
*/
- public static boolean isNull(Object object)
- {
+ public static boolean isNull(Object object) {
return object == null;
}
/**
* * 判断一个对象是否非空
- *
+ *
* @param object Object
* @return true:非空 false:空
*/
- public static boolean isNotNull(Object object)
- {
+ public static boolean isNotNull(Object object) {
return !isNull(object);
}
/**
* * 判断一个对象是否是数组类型(Java基本型别的数组)
- *
+ *
* @param object 对象
* @return true:是数组 false:不是数组
*/
- public static boolean isArray(Object object)
- {
+ public static boolean isArray(Object object) {
return isNotNull(object) && object.getClass().isArray();
}
/**
* 去空格
*/
- public static String trim(String str)
- {
+ public static String trim(String str) {
return (str == null ? "" : str.trim());
}
/**
* 截取字符串
- *
- * @param str 字符串
+ *
+ * @param str 字符串
* @param start 开始
* @return 结果
*/
- public static String substring(final String str, int start)
- {
- if (str == null)
- {
+ public static String substring(final String str, int start) {
+ if (str == null) {
return NULLSTR;
}
- if (start < 0)
- {
+ if (start < 0) {
start = str.length() + start;
}
- if (start < 0)
- {
+ if (start < 0) {
start = 0;
}
- if (start > str.length())
- {
+ if (start > str.length()) {
return NULLSTR;
}
@@ -188,44 +173,36 @@ public class StringUtil extends org.apache.commons.lang3.StringUtils
/**
* 截取字符串
- *
- * @param str 字符串
+ *
+ * @param str 字符串
* @param start 开始
- * @param end 结束
+ * @param end 结束
* @return 结果
*/
- public static String substring(final String str, int start, int end)
- {
- if (str == null)
- {
+ public static String substring(final String str, int start, int end) {
+ if (str == null) {
return NULLSTR;
}
- if (end < 0)
- {
+ if (end < 0) {
end = str.length() + end;
}
- if (start < 0)
- {
+ if (start < 0) {
start = str.length() + start;
}
- if (end > str.length())
- {
+ if (end > str.length()) {
end = str.length();
}
- if (start > end)
- {
+ if (start > end) {
return NULLSTR;
}
- if (start < 0)
- {
+ if (start < 0) {
start = 0;
}
- if (end < 0)
- {
+ if (end < 0) {
end = 0;
}
@@ -240,15 +217,13 @@ public class StringUtil extends org.apache.commons.lang3.StringUtils
* 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
- *
+ *
* @param template 文本模板,被替换的部分用 {} 表示
- * @param params 参数值
+ * @param params 参数值
* @return 格式化后的文本
*/
- public static String format(String template, Object... params)
- {
- if (isEmpty(params) || isEmpty(template))
- {
+ public static String format(String template, Object... params) {
+ if (isEmpty(params) || isEmpty(template)) {
return template;
}
return StrFormatter.format(template, params);
@@ -257,10 +232,8 @@ public class StringUtil extends org.apache.commons.lang3.StringUtils
/**
* 下划线转驼峰命名
*/
- public static String toUnderScoreCase(String str)
- {
- if (str == null)
- {
+ public static String toUnderScoreCase(String str) {
+ if (str == null) {
return null;
}
StringBuilder sb = new StringBuilder();
@@ -270,31 +243,23 @@ public class StringUtil extends org.apache.commons.lang3.StringUtils
boolean curreCharIsUpperCase = true;
// 下一字符是否大写
boolean nexteCharIsUpperCase = true;
- for (int i = 0; i < str.length(); i++)
- {
+ for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
- if (i > 0)
- {
+ if (i > 0) {
preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
- }
- else
- {
+ } else {
preCharIsUpperCase = false;
}
curreCharIsUpperCase = Character.isUpperCase(c);
- if (i < (str.length() - 1))
- {
+ if (i < (str.length() - 1)) {
nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
}
- if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase)
- {
+ if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
sb.append(SEPARATOR);
- }
- else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase)
- {
+ } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) {
sb.append(SEPARATOR);
}
sb.append(Character.toLowerCase(c));
@@ -305,19 +270,15 @@ public class StringUtil extends org.apache.commons.lang3.StringUtils
/**
* 是否包含字符串
- *
- * @param str 验证字符串
+ *
+ * @param str 验证字符串
* @param strs 字符串组
* @return 包含返回true
*/
- public static boolean inStringIgnoreCase(String str, String... strs)
- {
- if (str != null && strs != null)
- {
- for (String s : strs)
- {
- if (str.equalsIgnoreCase(trim(s)))
- {
+ public static boolean inStringIgnoreCase(String str, String... strs) {
+ if (str != null && strs != null) {
+ for (String s : strs) {
+ if (str.equalsIgnoreCase(trim(s))) {
return true;
}
}
@@ -327,31 +288,25 @@ public class StringUtil extends org.apache.commons.lang3.StringUtils
/**
* 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
- *
+ *
* @param name 转换前的下划线大写方式命名的字符串
* @return 转换后的驼峰式命名的字符串
*/
- public static String convertToCamelCase(String name)
- {
+ public static String convertToCamelCase(String name) {
StringBuilder result = new StringBuilder();
// 快速检查
- if (name == null || name.isEmpty())
- {
+ if (name == null || name.isEmpty()) {
// 没必要转换
return "";
- }
- else if (!name.contains("_"))
- {
+ } else if (!name.contains("_")) {
// 不含下划线,仅将首字母大写
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
// 用下划线将原始字符串分割
String[] camels = name.split("_");
- for (String camel : camels)
- {
+ for (String camel : camels) {
// 跳过原始字符串中开头、结尾的下换线或双重下划线
- if (camel.isEmpty())
- {
+ if (camel.isEmpty()) {
continue;
}
// 首字母大写
@@ -364,30 +319,22 @@ public class StringUtil extends org.apache.commons.lang3.StringUtils
/**
* 驼峰式命名法 例如:user_name->userName
*/
- public static String toCamelCase(String s)
- {
- if (s == null)
- {
+ public static String toCamelCase(String s) {
+ if (s == null) {
return null;
}
s = s.toLowerCase();
StringBuilder sb = new StringBuilder(s.length());
boolean upperCase = false;
- for (int i = 0; i < s.length(); i++)
- {
+ for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
- if (c == SEPARATOR)
- {
+ if (c == SEPARATOR) {
upperCase = true;
- }
- else if (upperCase)
- {
+ } else if (upperCase) {
sb.append(Character.toUpperCase(c));
upperCase = false;
- }
- else
- {
+ } else {
sb.append(c);
}
}
@@ -395,8 +342,7 @@ public class StringUtil extends org.apache.commons.lang3.StringUtils
}
@SuppressWarnings("unchecked")
- public static T cast(Object obj)
- {
+ public static T cast(Object obj) {
return (T) obj;
}
-}
\ No newline at end of file
+}
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/system/CpuInfo.java b/pear-common/src/main/java/com/pearadmin/common/tools/system/CpuInfo.java
index a5cf24744ffa970e0cc049692bd0172a161e7c9b..e116af25404393791f78945029d6da23a47a1d71 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/system/CpuInfo.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/system/CpuInfo.java
@@ -10,6 +10,9 @@ import java.util.Date;
import java.util.LinkedList;
import java.util.List;
+/**
+ * @author 就 眠 仪 式
+ */
@Data
public class CpuInfo {
@@ -20,7 +23,6 @@ public class CpuInfo {
/**
* 內存相关信息
- *
*/
private MemInfo memInfo;
@@ -79,7 +81,7 @@ public class CpuInfo {
*/
private String sysInfoOsArch;
- /**
+ /**
* 当前JVM占用的内存总数(M)
*/
private double jvmInfoTotal;
@@ -120,7 +122,9 @@ public class CpuInfo {
return NumberUtil.div(jvmInfoTotal - jvmInfoFree, (1024 * 1024), 2);
}
- public double getJvmUsage() { return NumberUtil.mul(NumberUtil.div(jvmInfoTotal - jvmInfoFree, jvmInfoTotal, 4), 100); }
+ public double getJvmUsage() {
+ return NumberUtil.mul(NumberUtil.div(jvmInfoTotal - jvmInfoFree, jvmInfoTotal, 4), 100);
+ }
/**
* 获取JDK名称
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/system/MemInfo.java b/pear-common/src/main/java/com/pearadmin/common/tools/system/MemInfo.java
index 49c4b182d5947e7af4563f70f610d34933f78508..fe11bff52a6382327f129d1fb335461d2edf88cd 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/system/MemInfo.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/system/MemInfo.java
@@ -2,8 +2,10 @@ package com.pearadmin.common.tools.system;
import cn.hutool.core.util.NumberUtil;
import lombok.Data;
-import lombok.ToString;
+/**
+ * @author 就 眠 仪 式
+ */
@Data
public class MemInfo {
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/system/SysFileInfo.java b/pear-common/src/main/java/com/pearadmin/common/tools/system/SysFileInfo.java
index bed1dc2534542d1bd4044e0fe1142159049276bc..59e169aaa4c4a055ade9c18519976c1ecb74d8d4 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/system/SysFileInfo.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/system/SysFileInfo.java
@@ -1,7 +1,6 @@
package com.pearadmin.common.tools.system;
import lombok.Data;
-import lombok.ToString;
@Data
public class SysFileInfo {
diff --git a/pear-common/src/main/java/com/pearadmin/common/tools/system/SystemUtil.java b/pear-common/src/main/java/com/pearadmin/common/tools/system/SystemUtil.java
index 3ba9f86759166df608b7e5b6c7ea734c07b3ac2d..b53b3e5bbd75a4bcd36c4f70e8eae3d9693e69b6 100644
--- a/pear-common/src/main/java/com/pearadmin/common/tools/system/SystemUtil.java
+++ b/pear-common/src/main/java/com/pearadmin/common/tools/system/SystemUtil.java
@@ -20,16 +20,16 @@ public class SystemUtil {
private static final int WAIT_SECOND = 110;
- public static CpuInfo getCpu(){
+ public static CpuInfo getCpu() {
CpuInfo cpu = new CpuInfo();
- SystemInfo si=new SystemInfo();
+ SystemInfo si = new SystemInfo();
HardwareAbstractionLayer hal = si.getHardware();
- setCpuInfo(hal.getProcessor(),cpu);
+ setCpuInfo(hal.getProcessor(), cpu);
MemInfo memInfo = setMemInfo(hal.getMemory());
cpu.setMemInfo(memInfo);
setSysInfo(cpu);
setJvmInfo(cpu);
- setSysFiles(si.getOperatingSystem(),cpu);
+ setSysFiles(si.getOperatingSystem(), cpu);
return cpu;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/base/BaseController.java b/pear-common/src/main/java/com/pearadmin/common/web/base/BaseController.java
index 254d1ca05d3c0b0e66901f260103115108a132fc..bc63ac658f24508f7bec76b10a431c09f0496921 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/base/BaseController.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/base/BaseController.java
@@ -4,11 +4,11 @@ import com.pearadmin.common.web.domain.response.ResultController;
/**
* Describe: 基 础 控 制 器 类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public class BaseController extends ResultController {
-
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/base/BaseDomain.java b/pear-common/src/main/java/com/pearadmin/common/web/base/BaseDomain.java
index 4b40eeb7846fdd16ad80caf1710c1bf53e732441..c237bead7d4aa82ff73ef3da484b3a7e39e83906 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/base/BaseDomain.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/base/BaseDomain.java
@@ -1,55 +1,57 @@
package com.pearadmin.common.web.base;
import lombok.Data;
+
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Map;
/**
* Describe: 基 础 实 体 类
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
public class BaseDomain implements Serializable {
/**
* 创建时间
- * */
+ */
private LocalDateTime createTime;
/**
* 创建人
- * */
+ */
private String createBy;
/**
* 创建人名称
- * */
+ */
private String createName;
/**
* 修改时间
- * */
+ */
private LocalDateTime updateTime;
/**
* 修改人
- * */
+ */
private String updateBy;
/**
* 修改人名称
- * */
+ */
private String updateName;
/**
* 备注
- * */
+ */
private String remark;
/**
- * 请求参数
- * */
+ * 请求参数
+ */
private Map params;
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/domain/request/PageDomain.java b/pear-common/src/main/java/com/pearadmin/common/web/domain/request/PageDomain.java
index 6bb86c07ff93803a511b5fcf7ae7392a7725145b..47978eec9ce99b54eb49724a12dcfb3012da2357 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/domain/request/PageDomain.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/domain/request/PageDomain.java
@@ -4,34 +4,35 @@ import lombok.Data;
/**
* Describe: 分 页 参 数 封 装
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
public class PageDomain {
/**
* 当前页
- * */
+ */
private Integer page;
/**
* 每页数量
- * */
+ */
private Integer limit;
/**
* 获取开始的数据行
- * */
- public Integer start(){
- return (this.page-1)*this.limit;
+ */
+ public Integer start() {
+ return (this.page - 1) * this.limit;
}
/**
* 获取结束的数据行
- * */
- public Integer end(){
- return this.page*this.limit;
+ */
+ public Integer end() {
+ return this.page * this.limit;
}
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/Result.java b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/Result.java
index a34d24b12b9af8b08db48f0521d58546631adad5..3c6f94464fd50021e3283f3f0753b47c476f6b27 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/Result.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/Result.java
@@ -7,9 +7,10 @@ import java.io.Serializable;
/**
* Describe: Ajax 返 回 JSON 结 果 封 装 数 据
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
@Accessors(chain = true)
public class Result implements Serializable {
@@ -36,43 +37,43 @@ public class Result implements Serializable {
/**
* 成 功 操 作
- * */
- public static Result success(){
+ */
+ public static Result success() {
return success(null);
}
/**
* 成 功 操 作 , 携 带 数 据
- * */
- public static Result success(T data){
- return success(ResultCode.SUCCESS.getMessage(),data);
+ */
+ public static Result success(T data) {
+ return success(ResultCode.SUCCESS.getMessage(), data);
}
/**
* 成 功 操 作, 携 带 消 息
- * */
- public static Result success(String message){
- return success(message,null);
+ */
+ public static Result success(String message) {
+ return success(message, null);
}
/**
* 成 功 操 作, 携 带 消 息 和 携 带 数 据
- * */
- public static Result success(String message,T data){
- return success(ResultCode.SUCCESS.getCode(),message,data);
+ */
+ public static Result success(String message, T data) {
+ return success(ResultCode.SUCCESS.getCode(), message, data);
}
/**
* 成 功 操 作, 携 带 自 定 义 状 态 码 和 消 息
- * */
- public static Result success(int code,String message){
- return success(code,message,null);
+ */
+ public static Result success(int code, String message) {
+ return success(code, message, null);
}
/**
* 成 功 操 作, 携 带 自 定义 状 态 码, 消 息 和 数 据
- * */
- public static Result success(int code,String message,T data){
+ */
+ public static Result success(int code, String message, T data) {
Result result = new Result();
result.setCode(code);
result.setMsg(message);
@@ -83,36 +84,36 @@ public class Result implements Serializable {
/**
* 失 败 操 作, 默 认 数 据
- * */
- public static Result failure(){
+ */
+ public static Result failure() {
return failure(ResultCode.SUCCESS.getMessage());
}
/**
* 失 败 操 作, 携 带 自 定 义 消 息
*/
- public static Result failure(String message){
- return failure(message,null);
+ public static Result failure(String message) {
+ return failure(message, null);
}
/**
* 失 败 操 作, 携 带 自 定 义 消 息 和 数 据
- * */
- public static Result failure(String message,T data){
- return failure(ResultCode.FAILURE.getCode(),message,data);
+ */
+ public static Result failure(String message, T data) {
+ return failure(ResultCode.FAILURE.getCode(), message, data);
}
/**
* 失 败 操 作, 携 带 自 定 义 状 态 码 和 自 定 义 消 息
- * */
- public static Result failure(int code ,String message){
- return failure(ResultCode.FAILURE.getCode(),message,null);
+ */
+ public static Result failure(int code, String message) {
+ return failure(ResultCode.FAILURE.getCode(), message, null);
}
/**
* 失 败 操 作, 携 带 自 定 义 状 态 码 , 消 息 和 数 据
- * */
- public static Result failure(int code,String message,T data){
+ */
+ public static Result failure(int code, String message, T data) {
Result result = new Result();
result.setCode(code);
result.setMsg(message);
@@ -123,18 +124,18 @@ public class Result implements Serializable {
/**
* Boolean 返 回 操 作, 携 带 默 认 返 回 值
- * */
- public static Result decide(boolean b){
- return decide(b,ResultCode.SUCCESS.getMessage(),ResultCode.FAILURE.getMessage());
+ */
+ public static Result decide(boolean b) {
+ return decide(b, ResultCode.SUCCESS.getMessage(), ResultCode.FAILURE.getMessage());
}
/**
* Boolean 返 回 操 作, 携 带 自 定 义 消 息
- * */
- public static Result decide(boolean b,String success,String failure){
- if(b){
+ */
+ public static Result decide(boolean b, String success, String failure) {
+ if (b) {
return success(success);
- }else{
+ } else {
return failure(failure);
}
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/ResultCode.java b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/ResultCode.java
index 7675a6bb76882498f50fa9fb92b656cb75bdd157..1bb7e3df9d07126e227b8e1a0d5598671eb494e4 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/ResultCode.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/ResultCode.java
@@ -4,35 +4,36 @@ import lombok.Getter;
/**
* Describe: 统 一 返 回 状 态 码
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public enum ResultCode {
/**
* 成功
*/
- SUCCESS(200,"操作成功"),
+ SUCCESS(200, "操作成功"),
/**
* 失败
*/
- FAILURE(500,"操作失败");
+ FAILURE(500, "操作失败");
/**
* 状 态 码
- * */
+ */
@Getter
private final int code;
/**
* 携 带 消 息
- * */
+ */
@Getter
private final String message;
/**
* 构 造 方 法
- * */
+ */
ResultCode(int code, String message) {
this.code = code;
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/ResultController.java b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/ResultController.java
index 168f00c2656488169c29bb5e12502838ce74ad5b..06122a5c8dab8b8051e3d3a1703cfa4aa8d816d7 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/ResultController.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/ResultController.java
@@ -1,120 +1,160 @@
package com.pearadmin.common.web.domain.response;
-import com.pearadmin.common.web.domain.response.module.ResultTree;
import com.pearadmin.common.web.domain.response.module.ResultTable;
+import com.pearadmin.common.web.domain.response.module.ResultTree;
import org.springframework.web.servlet.ModelAndView;
+
import java.util.Map;
/**
* Describe: 统一响应 Controller
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
public class ResultController {
+ /**
+ * Describe: 返回 Tree 数据
+ * Param data
+ * Return Tree数据
+ */
+ protected static ResultTree dataTree(Object data) {
+ ResultTree resuTree = new ResultTree();
+ resuTree.setData(data);
+ return resuTree;
+ }
+
+ /**
+ * Describe: 返回数据表格数据 分页
+ * Param data
+ * Return 表格分页数据
+ */
+ protected static ResultTable pageTable(Object data, long count) {
+ return ResultTable.pageTable(count, data);
+ }
+
+ /**
+ * Describe: 返回数据表格数据
+ * Param data
+ * Return 表格分页数据
+ */
+ protected static ResultTable dataTable(Object data) {
+ return ResultTable.dataTable(data);
+ }
+
+ /**
+ * Describe: 返回树状表格数据 分页
+ * Param data
+ * Return 表格分页数据
+ */
+ protected static ResultTable treeTable(Object data) {
+ return ResultTable.dataTable(data);
+ }
+
/**
* 成功操作
- * */
- public Result success(){
+ */
+ public Result success() {
return Result.success();
}
/**
* 成功操作
- * */
- public Result success(String msg){
+ */
+ public Result success(String msg) {
return Result.success(msg);
}
/**
* 成功操作
- * */
- public Result success(Object data){
+ */
+ public Result success(Object data) {
return Result.success(data);
}
/**
* 成功操作
- * */
- public Result success(String msg,Object data){
- return Result.success(msg,data);
+ */
+ public Result success(String msg, Object data) {
+ return Result.success(msg, data);
}
/**
* 成功操作
- * */
- public Result success(int code,String message,Object data){
- return Result.success(code,message,data);
+ */
+ public Result success(int code, String message, Object data) {
+ return Result.success(code, message, data);
}
/**
* 失败操作
- * */
- public Result failure(){
+ */
+ public Result failure() {
return Result.failure();
}
/**
* 失败操作
- * */
- public Result failure(String msg){
+ */
+ public Result failure(String msg) {
return Result.failure(msg);
}
/**
* 失败操作
- * */
- public Result failure(String msg,Object data){
- return Result.failure(msg,data);
+ */
+ public Result failure(String msg, Object data) {
+ return Result.failure(msg, data);
}
/**
* 失败操作
- * */
- public Result failure(int code,String msg,Object data){
- return Result.failure(code,msg,data);
+ */
+ public Result failure(int code, String msg, Object data) {
+ return Result.failure(code, msg, data);
}
/**
* 选择返回
- * */
- public Result decide(Boolean b){
+ */
+ public Result decide(Boolean b) {
return Result.decide(b);
}
/**
* 选择返回
- * */
- public Result decide(Boolean b,String success,String failure){
- return Result.decide(b,success,failure);
+ */
+ public Result decide(Boolean b, String success, String failure) {
+ return Result.decide(b, success, failure);
}
/**
* 选择返回
- * */
- public Result decide(int result){
- if(result>0){
+ */
+ public Result decide(int result) {
+ if (result > 0) {
return Result.decide(true);
- }else{
+ } else {
return Result.decide(false);
}
}
/**
* 选择返回
- * */
- public Result decide(int result,String success,String failure){
- if(result>0){
- return Result.decide(true,success,failure);
- }else{
- return Result.decide(false,success,failure);
+ */
+ public Result decide(int result, String success, String failure) {
+ if (result > 0) {
+ return Result.decide(true, success, failure);
+ } else {
+ return Result.decide(false, success, failure);
}
}
/**
* 页面跳转
- * */
- public ModelAndView jumpPage(String path){
+ */
+ public ModelAndView jumpPage(String path) {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName(path);
return modelAndView;
@@ -122,50 +162,12 @@ public class ResultController {
/**
* 带参数的页面跳转
- * */
- public ModelAndView jumpPage(String path, Map params){
+ */
+ public ModelAndView jumpPage(String path, Map params) {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName(path);
modelAndView.addAllObjects(params);
return modelAndView;
}
- /**
- * Describe: 返回 Tree 数据
- * Param data
- * Return Tree数据
- * */
- protected static ResultTree dataTree(Object data){
- ResultTree resuTree = new ResultTree();
- resuTree.setData(data);
- return resuTree;
- }
-
- /**
- * Describe: 返回数据表格数据 分页
- * Param data
- * Return 表格分页数据
- * */
- protected static ResultTable pageTable(Object data, long count){
- return ResultTable.pageTable(count,data);
- }
-
- /**
- * Describe: 返回数据表格数据
- * Param data
- * Return 表格分页数据
- * */
- protected static ResultTable dataTable(Object data){
- return ResultTable.dataTable(data);
- }
-
- /**
- * Describe: 返回树状表格数据 分页
- * Param data
- * Return 表格分页数据
- * */
- protected static ResultTable treeTable(Object data){
- return ResultTable.dataTable(data);
- }
-
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultSelect.java b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultSelect.java
index 3c94e9ec52ed7060341abd351c1bb71978167531..0cd352257f8eae112aba1f49d346fc3409894b1b 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultSelect.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultSelect.java
@@ -5,11 +5,11 @@ import java.util.List;
/**
* Describe: 前 端 下 拉 树
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
-public class ResultSelect implements Serializable
-{
+ */
+public class ResultSelect implements Serializable {
private static final long serialVersionUID = 1L;
/**
@@ -27,43 +27,35 @@ public class ResultSelect implements Serializable
*/
private List s;
- public ResultSelect()
- {
+ public ResultSelect() {
}
- public ResultSelect(String v, String n)
- {
+ public ResultSelect(String v, String n) {
this.v = v;
this.n = n;
}
- public List getS()
- {
+ public List getS() {
return s;
}
- public void setN(String n)
- {
- this.n = n;
+ public void setS(List s) {
+ this.s = s;
}
- public String getN()
- {
+ public String getN() {
return n;
}
- public void setS(List s)
- {
- this.s = s;
+ public void setN(String n) {
+ this.n = n;
}
- public String getV()
- {
+ public String getV() {
return v;
}
- public void setV(String v)
- {
+ public void setV(String v) {
this.v = v;
}
}
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultTable.java b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultTable.java
index 11d78c03ba7ff2ac6681bb478e50e0b03b21bec9..639ba60aad327c6399f89d6f8f8553021b85cffd 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultTable.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultTable.java
@@ -5,36 +5,37 @@ import lombok.Data;
/**
* Describe: 前 端 表 格 数 据 封 装
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
public class ResultTable extends BaseDomain {
/**
* 状态码
- * */
+ */
private Integer code;
/**
* 提示消息
- * */
+ */
private String msg;
/**
* 消息总量
- * */
+ */
private Long count;
/**
* 数据对象
- * */
+ */
private Object data;
/**
* 构 建
- * */
- public static ResultTable pageTable(long count,Object data){
+ */
+ public static ResultTable pageTable(long count, Object data) {
ResultTable resultTable = new ResultTable();
resultTable.setData(data);
resultTable.setCode(0);
@@ -42,7 +43,7 @@ public class ResultTable extends BaseDomain {
return resultTable;
}
- public static ResultTable dataTable(Object data){
+ public static ResultTable dataTable(Object data) {
ResultTable resultTable = new ResultTable();
resultTable.setData(data);
resultTable.setCode(0);
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultTree.java b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultTree.java
index 454f8a1590543de48aa7b1f2c5c59d2602255560..1a481215a43aa6618d9d00af20b00b5c32dfe572 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultTree.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/domain/response/module/ResultTree.java
@@ -4,27 +4,28 @@ import lombok.Data;
/**
* Describe: 前端 tree 结果封装数据
- * Author: 就 眠 仪 式
+ *
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
- * */
+ */
@Data
public class ResultTree {
/**
* 状态信息
- * */
+ */
private Status status = new Status();
/**
* 返回数据
- * */
+ */
private Object data;
/**
* 所需内部类
- * */
+ */
@Data
- public class Status{
+ public class Status {
private Integer code = 200;
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/session/HttpSessionContext.java b/pear-common/src/main/java/com/pearadmin/common/web/session/HttpSessionContext.java
index 8c3048d58791997b839473169b2d6323f4f6d929..e8a6f49f49887e0b373381c14c3315fdd0b92980 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/session/HttpSessionContext.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/session/HttpSessionContext.java
@@ -7,7 +7,8 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* Describe: 单例模式 HttpSessionContext
- * Author: Heiky
+ *
+ * @author Heiky
* CreateTime: 2020/12/17
*/
public class HttpSessionContext {
diff --git a/pear-common/src/main/java/com/pearadmin/common/web/session/HttpSessionContextHolder.java b/pear-common/src/main/java/com/pearadmin/common/web/session/HttpSessionContextHolder.java
index 0ee9294feaf0574c4cbe0f62fbeb1be65857f4c5..1333fa897be6e6eb645c1cc19fbcae83ad6ef3d6 100644
--- a/pear-common/src/main/java/com/pearadmin/common/web/session/HttpSessionContextHolder.java
+++ b/pear-common/src/main/java/com/pearadmin/common/web/session/HttpSessionContextHolder.java
@@ -3,7 +3,8 @@ package com.pearadmin.common.web.session;
/**
* Describe: HttpSessionContext对象持有者
- * Author: Heiky
+ *
+ * @author Heiky
* CreateTime: 2020/12/17
*/
public class HttpSessionContextHolder {
diff --git a/pear-common/src/main/java/com/pearadmin/common/xss/XssRequest.java b/pear-common/src/main/java/com/pearadmin/common/xss/XssRequest.java
index f08f9fa391f355f0ebe3fbbb741e4f49ddb6fb36..f0f461aa9872a9c97d2d0523dd155d0b80ce5769 100644
--- a/pear-common/src/main/java/com/pearadmin/common/xss/XssRequest.java
+++ b/pear-common/src/main/java/com/pearadmin/common/xss/XssRequest.java
@@ -2,6 +2,7 @@ package com.pearadmin.common.xss;
import com.pearadmin.common.tools.jsoup.JsoupUtil;
import com.pearadmin.common.tools.string.StringUtil;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
@@ -16,9 +17,16 @@ public class XssRequest extends HttpServletRequestWrapper {
this.isIncludeRichText = isIncludeRichText;
}
+ public static HttpServletRequest getOrgRequest(HttpServletRequest req) {
+ if (req instanceof XssRequest) {
+ return ((XssRequest) req).getOrgRequest();
+ }
+ return req;
+ }
+
@Override
public String getParameter(String name) {
- if(("content".equals(name) || name.endsWith("WithHtml")) && !isIncludeRichText){
+ if (("content".equals(name) || name.endsWith("WithHtml")) && !isIncludeRichText) {
return super.getParameter(name);
}
name = JsoupUtil.clean(name);
@@ -32,8 +40,8 @@ public class XssRequest extends HttpServletRequestWrapper {
@Override
public String[] getParameterValues(String name) {
String[] arr = super.getParameterValues(name);
- if(arr != null){
- for (int i=0;i excludes = new ArrayList();
+ @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
- if(log.isDebugEnabled()){
+ if (log.isDebugEnabled()) {
log.debug("xss filter is open");
}
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
- if(handleExcludeURL(req, resp)){
+ if (handleExcludeURL(req, resp)) {
filterChain.doFilter(request, response);
return;
}
- XssRequest xssRequest = new XssRequest((HttpServletRequest) request,IS_INCLUDE_RICH_TEXT);
+ XssRequest xssRequest = new XssRequest((HttpServletRequest) request, IS_INCLUDE_RICH_TEXT);
filterChain.doFilter(xssRequest, response);
}
@@ -53,11 +55,11 @@ public class XssSupport implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
- if(log.isDebugEnabled()){
+ if (log.isDebugEnabled()) {
log.debug("xss filter init~~~~~~~~~~~~");
}
String isIncludeRichText = filterConfig.getInitParameter("isIncludeRichText");
- if(StringUtil.isNotBlank(isIncludeRichText)){
+ if (StringUtil.isNotBlank(isIncludeRichText)) {
IS_INCLUDE_RICH_TEXT = BooleanUtils.toBoolean(isIncludeRichText);
}
String temp = filterConfig.getInitParameter("excludes");
diff --git a/pear-entrance/src/main/java/com/pearadmin/PearEntranceApplication.java b/pear-entrance/src/main/java/com/pearadmin/PearEntranceApplication.java
index f24c7a5148861c2f95875dc7010c281779c80428..b8e9c461ce0c091104080528a495b3b9f457bd72 100644
--- a/pear-entrance/src/main/java/com/pearadmin/PearEntranceApplication.java
+++ b/pear-entrance/src/main/java/com/pearadmin/PearEntranceApplication.java
@@ -8,7 +8,7 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
/**
* Describe: 入 口 启 动 类
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
*/
diff --git a/pear-entrance/src/main/java/com/pearadmin/api/common/CaptchaController.java b/pear-entrance/src/main/java/com/pearadmin/api/common/CaptchaController.java
index a054585c08864556ae5a5dd46b9353395d794875..2f17bce4c91a8adbc89ff91f6e1404dd6669a5cd 100644
--- a/pear-entrance/src/main/java/com/pearadmin/api/common/CaptchaController.java
+++ b/pear-entrance/src/main/java/com/pearadmin/api/common/CaptchaController.java
@@ -10,7 +10,7 @@ import javax.servlet.http.HttpServletRequest;
/**
* Describe: 验证码控制器
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@RestController
diff --git a/pear-entrance/src/main/java/com/pearadmin/api/common/MonitorController.java b/pear-entrance/src/main/java/com/pearadmin/api/common/MonitorController.java
index bc29993cd1a5f9588165a22815c734b0f669de46..c7167da00cca7fb4cf1f9ce90e52354ab2a2c5e0 100644
--- a/pear-entrance/src/main/java/com/pearadmin/api/common/MonitorController.java
+++ b/pear-entrance/src/main/java/com/pearadmin/api/common/MonitorController.java
@@ -10,7 +10,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
-
+/**
+ * @author 就 眠 仪 式
+ * */
@RestController
@RequestMapping(ControllerConstant.API_SYSTEM_PREFIX + "monitor")
public class MonitorController extends BaseController {
diff --git a/pear-entrance/src/main/java/com/pearadmin/api/modules/EntranceController.java b/pear-entrance/src/main/java/com/pearadmin/api/modules/EntranceController.java
index 97e7a40de27a6a90b1832ef67b607e91650dd417..e0ca9cfb8e45dbae4c46eb9fae162361c89e9249 100644
--- a/pear-entrance/src/main/java/com/pearadmin/api/modules/EntranceController.java
+++ b/pear-entrance/src/main/java/com/pearadmin/api/modules/EntranceController.java
@@ -21,7 +21,7 @@ import java.time.LocalTime;
/**
* Describe: 入 口 控 制 器
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@RestController
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/SecureConfiguration.java b/pear-entrance/src/main/java/com/pearadmin/secure/SecureConfiguration.java
index 7f04da9513bb7082de8be252efa60ce3d7118ebc..18c86dd28e70c13b9aa752ab08a761c61abf4859 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/SecureConfiguration.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/SecureConfiguration.java
@@ -20,7 +20,7 @@ import javax.annotation.Resource;
/**
* Describe: Security 安全配置
- * Author: 就眠仪式
+ * @author 就眠仪式
* CreateTime: 2019/10/23
*/
@Configuration
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/SecureExtendConfiguration.java b/pear-entrance/src/main/java/com/pearadmin/secure/SecureExtendConfiguration.java
index 9df08669d5a2b8b61ec5a9ec78ff4e52ad28fec8..f1d4c5e2254c5509fb4ca47cd107a1e58000e144 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/SecureExtendConfiguration.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/SecureExtendConfiguration.java
@@ -18,7 +18,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
/**
* Describe: Security 扩展配置
- * Author: 就眠仪式
+ * @author 就眠仪式
* CreateTime: 2019/10/23
*/
@Configuration
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/domain/SecureUserDetailsService.java b/pear-entrance/src/main/java/com/pearadmin/secure/domain/SecureUserDetailsService.java
index dea52dd6392a7f978beb733553024190e049ad5d..cef8c5f4adb2a9ac0f7f1833ca5462549c827637 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/domain/SecureUserDetailsService.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/domain/SecureUserDetailsService.java
@@ -13,7 +13,7 @@ import java.util.List;
/**
* Describe: Security 用户服务
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Component
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/domain/SecureUserTokenService.java b/pear-entrance/src/main/java/com/pearadmin/secure/domain/SecureUserTokenService.java
index 6245bb01723da0c40ad29cd246a17de5f7cf706c..f6c6ef4b0aabf27ea0f394958f3ad1a106388756 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/domain/SecureUserTokenService.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/domain/SecureUserTokenService.java
@@ -16,7 +16,7 @@ import java.util.List;
/**
* Describe: Token 记录服务
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
*/
@Component
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAccessDeniedHandler.java b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAccessDeniedHandler.java
index ba6a34ab1f8ff015d87e1d16fba9d2319ca406d6..c914075c4579ab14bd7f19d910823486bdd89796 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAccessDeniedHandler.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAccessDeniedHandler.java
@@ -13,7 +13,7 @@ import java.io.IOException;
/**
* Describe: 自定义 Security 用户暂无权限处理类
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Component
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationEntryPoint.java b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationEntryPoint.java
index 099e25890064642ca6378d2f3380ebe93e1ee10c..20ab5d68c36f54a50be266323974cdcd322dba5a 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationEntryPoint.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationEntryPoint.java
@@ -13,7 +13,7 @@ import java.io.IOException;
/**
* Describe: 自定义 Security 用户未登陆处理类
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Component
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationFailureHandler.java b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationFailureHandler.java
index 0f7ea3ae9d65ad4cc1c7fd0d3ce28326db8bb665..13dda636b7f0321eee996fea353da730ebfc9331 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationFailureHandler.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationFailureHandler.java
@@ -24,7 +24,7 @@ import java.io.IOException;
/**
* Describe: 自定义 Security 用户登录失败处理类
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Component
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationSuccessHandler.java b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationSuccessHandler.java
index 87bc2a48012d63e11e0ad22b111657afcdaa93f5..7ca263f99a0838794917479cb6b3f596eb04dce0 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationSuccessHandler.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureAuthenticationSuccessHandler.java
@@ -23,7 +23,7 @@ import java.time.LocalDateTime;
/**
* Describe: 自定义 Security 用户未登陆处理类
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
*/
@Component
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureLogoutHandler.java b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureLogoutHandler.java
index f05b42403b27874567f8012512128eb869352ed1..80be311f67546291f46bb6ff3330320c9b351b2d 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureLogoutHandler.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureLogoutHandler.java
@@ -16,7 +16,7 @@ import javax.servlet.http.HttpSessionEvent;
/**
* Describe: 自定义用户注销处理类
- * Author: Heiky
+ * @author Heiky
* CreateTime: 2020/12/17
*/
@Slf4j
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureLogoutSuccessHandler.java b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureLogoutSuccessHandler.java
index 6ed58197c3d80b0bf2bbfd1beb2f0614e2426568..10c82090c39810f4b0dbd814931d2bb1d1218cc2 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureLogoutSuccessHandler.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureLogoutSuccessHandler.java
@@ -14,7 +14,7 @@ import java.io.IOException;
/**
* Describe: 自定义 Security 注销成功处理类
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Component
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureSessionExpiredHandler.java b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureSessionExpiredHandler.java
index 247838c941618d074abe800be166916fcaa3da8d..8eb9da7151db91f6e90f4919a6451ffdc589b112 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureSessionExpiredHandler.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/process/SecureSessionExpiredHandler.java
@@ -10,7 +10,7 @@ import java.io.IOException;
/**
* Describe: 自定义 Security 同账号多端登录挤下线 跳转地址
- * Author: John Ming
+ * @author John Ming
* CreateTime: 2019/10/23
* */
@Component
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/session/SecureInvalidSession.java b/pear-entrance/src/main/java/com/pearadmin/secure/session/SecureInvalidSession.java
index f41f555170ab519b5546981ff2b4a52b469e97d2..90dfc534b78a4cb518b7678f1b460e01afc0fc26 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/session/SecureInvalidSession.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/session/SecureInvalidSession.java
@@ -21,7 +21,7 @@ import java.util.concurrent.TimeUnit;
/**
* Describe: Security 在线用户监测任务
- * Author: 就眠仪式
+ * @author 就眠仪式
* CreateTime: 2019/10/23
*/
@Slf4j
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/session/SecureSessionService.java b/pear-entrance/src/main/java/com/pearadmin/secure/session/SecureSessionService.java
index 7cffe70bfe4aea8793276e69d80e14c2d256adaa..1c933221ac334920d66fcc8699def095419915ab 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/session/SecureSessionService.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/session/SecureSessionService.java
@@ -11,7 +11,7 @@ import java.util.List;
/**
* Describe: Security Session 操作服务
- * Author: 就眠仪式
+ * @author 就眠仪式
* CreateTime: 2019/10/23
*/
public class SecureSessionService {
diff --git a/pear-entrance/src/main/java/com/pearadmin/secure/support/SecurePermissionSupport.java b/pear-entrance/src/main/java/com/pearadmin/secure/support/SecurePermissionSupport.java
index 6d8a082c30a8da93af841e051f777553c4c80f06..21fe9159876820bfaef97db4912b3a4d7a02e4da 100644
--- a/pear-entrance/src/main/java/com/pearadmin/secure/support/SecurePermissionSupport.java
+++ b/pear-entrance/src/main/java/com/pearadmin/secure/support/SecurePermissionSupport.java
@@ -15,7 +15,7 @@ import java.util.Set;
/**
* Describe: 自定义 Security 权限注解实现
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
*/
@Component
diff --git a/pear-entrance/src/main/resources/static/component/pear/module/eleTree.js b/pear-entrance/src/main/resources/static/component/pear/module/eleTree.js
index ab5ff2ce3929d4ac266549bdf085a20d519b494b..e69c5a688a0d69c764d7b4760b81b37fe612be08 100644
--- a/pear-entrance/src/main/resources/static/component/pear/module/eleTree.js
+++ b/pear-entrance/src/main/resources/static/component/pear/module/eleTree.js
@@ -1,6 +1,6 @@
/**
* 基于layui的tree重写
- * author: hsianglee
+ * @author hsianglee
* 最近修改时间: 2019/01/07
*/
@@ -10,7 +10,7 @@ layui.define(["jquery","laytpl"], function (exports) {
var hint = layui.hint();
var MOD_NAME="eleTree";
-
+
//外部接口
var eleTree={
//事件监听
@@ -189,7 +189,7 @@ layui.define(["jquery","laytpl"], function (exports) {
contentType: "",
headers: {},
done: null,
-
+
response: {
statusName: "code",
statusCode: 0,
@@ -217,7 +217,7 @@ layui.define(["jquery","laytpl"], function (exports) {
this.filter=options.elem.attr("lay-filter");
// load加载框
options.elem.append('
')
-
+
// 判断加载方式
if(options.data.length===0){
this.ajaxGetData();
@@ -230,7 +230,7 @@ layui.define(["jquery","laytpl"], function (exports) {
// 渲染第一层
laytpl(TPL_ELEM(options,0)).render(options.data, function(string){
options.elem.html(string).children().show();
- });
+ });
// 懒加载 > 展开所有 > 初始展开项 > 初始渲染所有子节点 > 初始选中项 > 每次点击只渲染当前层(默认)
// 判断所有dom是否全部加载
if(!options.lazy){
@@ -255,7 +255,7 @@ layui.define(["jquery","laytpl"], function (exports) {
if(!options.url) {
laytpl(TPL_NoText()).render(options, function(string){
options.elem.html(string);
- });
+ });
return;
}
var data = $.extend({}, options.where);
@@ -313,7 +313,7 @@ layui.define(["jquery","laytpl"], function (exports) {
if(options.highlightCurrent) eleTreeNodeContent.addClass("eleTree-node-content-active");
_self.prevClickEle=eleTreeNodeContent;
-
+
if(el.hasClass("icon-rotate")){
// 合并
@@ -396,7 +396,7 @@ layui.define(["jquery","laytpl"], function (exports) {
if(_self.prevClickEle) _self.prevClickEle.removeClass("eleTree-node-content-active");
if(options.highlightCurrent) eleTreeNodeContent.addClass("eleTree-node-content-active");
_self.prevClickEle=eleTreeNodeContent;
-
+
if(!inp){
return;
}
@@ -409,7 +409,7 @@ layui.define(["jquery","laytpl"], function (exports) {
childNode.prop("checked",false);
childNode.attr("eleTree-status","0");
}
-
+
}else{
// 反选自身
$(inp).prop("checked",true).attr("eleTree-status","1");
@@ -426,7 +426,7 @@ layui.define(["jquery","laytpl"], function (exports) {
// 点击子孙层选中祖父层(递归)
_self.selectParents(inp,eleNode,siblingNode);
}
-
+
_self.checkboxRender();
if(type==="default") return;
@@ -451,7 +451,7 @@ layui.define(["jquery","laytpl"], function (exports) {
childNode.prop("checked","checked").attr("eleTree-status","1");
childNode.siblings(".eleTree-checkbox").addClass("eleTree-checkbox-checked");
childNode.siblings(".eleTree-checkbox").children("i").addClass("layui-icon-ok").removeClass("eleTree-checkbox-line");
-
+
// 选择祖父
var eleNode=checkboxEl.parent(".eleTree-node-content").parent(".eleTree-node");
var siblingNode=eleNode.siblings(".eleTree-node");
@@ -549,7 +549,7 @@ layui.define(["jquery","laytpl"], function (exports) {
arr.pop();
})
-
+
},
// 初始默认选中
defaultChecked: function() {
@@ -610,7 +610,7 @@ layui.define(["jquery","laytpl"], function (exports) {
checkbox.addClass("eleTree-checkbox-checked");
checkbox.children("i").removeClass("layui-icon-ok").addClass("eleTree-checkbox-line");
}
-
+
})
},
// 通过dom节点找对应数据
@@ -674,7 +674,7 @@ layui.define(["jquery","laytpl"], function (exports) {
var node=options.elem.find("[data-"+options.request.key+"='"+key+"']");
var floor=Number(node.attr("eletree-floor"))+1;
var _self=this;
-
+
this.keySearchToOpera(key,function(d,obj) {
// 数据更新
d[obj.i][options.request.children]=data;
@@ -682,7 +682,7 @@ layui.define(["jquery","laytpl"], function (exports) {
node.length!==0 && laytpl(TPL_ELEM(options,floor)).render(data, function(string){
$(node).children(".eleTree-node-group").empty().append(string);
options.defaultExpandAll && $(node).children(".eleTree-node-group").children().show();
- });
+ });
_self.unCheckNodes();
_self.defaultChecked();
});
@@ -741,7 +741,7 @@ layui.define(["jquery","laytpl"], function (exports) {
eletreeStatus=eletreeStatus==="2" ? "0" : eletreeStatus;
node.length!==0 && laytpl(TPL_ELEM(options,floor,eletreeStatus)).render([arr[len-1]], function(string){
node.children(".eleTree-node-group").append(string).children().show();
- });
+ });
});
this.checkboxRender();
},
@@ -759,7 +759,7 @@ layui.define(["jquery","laytpl"], function (exports) {
eletreeStatus=eletreeStatus==="2" ? "0" : eletreeStatus;
node.length!==0 && laytpl(TPL_ELEM(options,floor,eletreeStatus)).render([data], function(string){
node.before(string).prev(".eleTree-node").show();
- });
+ });
});
this.checkboxRender();
},
@@ -777,7 +777,7 @@ layui.define(["jquery","laytpl"], function (exports) {
eletreeStatus=eletreeStatus==="2" ? "0" : eletreeStatus;
node.length!==0 && laytpl(TPL_ELEM(options,floor,eletreeStatus)).render([data], function(string){
$(node).after(string).next(".eleTree-node").show();
- });
+ });
});
this.checkboxRender();
// if(!options.lazy){
@@ -903,7 +903,7 @@ layui.define(["jquery","laytpl"], function (exports) {
cloneNode.remove();
options.elem.css("user-select","auto");
-
+
// 当前点击的是否时最外层
var isCurrentOuterMost=eleNode.parent().get(0).isEqualNode(options.elem.get(0))
// 目标是否时最外层
@@ -1058,7 +1058,7 @@ layui.define(["jquery","laytpl"], function (exports) {
var obj={};
obj[options.request.key]=_self.addKeyIndex;
obj[options.request.name]="未命名"+_self.nameIndex;
-
+
var arr=["Append","InsertBefore","InsertAfter"];
arr.forEach(function(val) {
var s=val[0].toLocaleLowerCase()+val.slice(1,val.length);
@@ -1087,7 +1087,7 @@ layui.define(["jquery","laytpl"], function (exports) {
_self.addKeyIndex++;
})
})
-
+
// 编辑
$("#tree-menu li.edit").off().on("click",function(e) {
e.stopPropagation();
@@ -1204,12 +1204,12 @@ layui.define(["jquery","laytpl"], function (exports) {
})){
laytpl(TPL_NoText()).render(options, function(string){
options.elem.append(string);
- });
+ });
}else{
options.elem.children(".eleTree-noText").remove();
}
}
}
-
+
exports(MOD_NAME,eleTree);
-})
\ No newline at end of file
+})
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/config/GenConfig.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/config/GenConfig.java
index 982f71b4790de4c6bf4128e41e3a0e47c5e2858e..f391aee697ce45ee2af0150aae9c3766efd931fb 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/config/GenConfig.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/config/GenConfig.java
@@ -7,7 +7,7 @@ import org.springframework.stereotype.Component;
/**
* Describe: 读取代码相关配置
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Component
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/controller/GenController.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/controller/GenController.java
index 29a30a4e80a53ffcdadeea114c685953e808d65e..3d608aa3588aaeb554d9d88a9396c0289b3dcc28 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/controller/GenController.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/controller/GenController.java
@@ -35,7 +35,7 @@ import com.pearadmin.generate.service.IGenTableColumnService;
/**
* Describe: 代码生成控制器
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Controller
@@ -205,4 +205,4 @@ public class GenController extends BaseController {
response.setContentType("application/octet-stream; charset=UTF-8");
IOUtils.write(data, response.getOutputStream());
}
-}
\ No newline at end of file
+}
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/domain/GenTable.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/domain/GenTable.java
index 23f09fe0b20b2da19598a5e16b868b6bb165f9a0..c59fa3aaac349256901d284e26b12219935d4579 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/domain/GenTable.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/domain/GenTable.java
@@ -10,7 +10,7 @@ import org.apache.ibatis.type.Alias;
/**
* Describe: 业务表实体
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@ToString
@@ -362,4 +362,4 @@ public class GenTable extends BaseDomain
}
return StringUtils.equalsAnyIgnoreCase(javaField, GenerateConstant.BASE_ENTITY);
}
-}
\ No newline at end of file
+}
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/domain/GenTableColumn.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/domain/GenTableColumn.java
index ea5b9a89131b81eb0a3b3c737da0280aac48c991..56d3b3b564f14282d1d5f729d5f1473b06819e27 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/domain/GenTableColumn.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/domain/GenTableColumn.java
@@ -6,7 +6,7 @@ import org.apache.ibatis.type.Alias;
/**
* Describe: 业务表字段实体
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Alias("GenTableColumn")
@@ -370,4 +370,4 @@ public class GenTableColumn extends BaseDomain
return this.columnComment;
}
}
-}
\ No newline at end of file
+}
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/mapper/GenTableColumnMapper.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/mapper/GenTableColumnMapper.java
index a5f833661a9ef51edf23d1efbc81dec822505a2c..a8c210c707fcd551824f4caab268c36201eb393e 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/mapper/GenTableColumnMapper.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/mapper/GenTableColumnMapper.java
@@ -6,7 +6,7 @@ import java.util.List;
/**
* Describe: 业务表字段接口
- * Author: 就眠仪式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Mapper
@@ -14,15 +14,15 @@ public interface GenTableColumnMapper
{
/**
* 根据表名称查询列信息
- *
+ *
* @param tableName 表名称
* @return 列信息
*/
List selectDbTableColumnsByName(String tableName);
-
+
/**
* 查询业务字段列表
- *
+ *
* @param genTableColumn 业务字段信息
* @return 业务字段集合
*/
@@ -30,7 +30,7 @@ public interface GenTableColumnMapper
/**
* 新增业务字段
- *
+ *
* @param genTableColumn 业务字段信息
* @return 结果
*/
@@ -38,7 +38,7 @@ public interface GenTableColumnMapper
/**
* 修改业务字段
- *
+ *
* @param genTableColumn 业务字段信息
* @return 结果
*/
@@ -46,9 +46,9 @@ public interface GenTableColumnMapper
/**
* 批量删除业务字段
- *
+ *
* @param ids 需要删除的数据ID
* @return 结果
*/
int deleteGenTableColumnByIds(String[] ids);
-}
\ No newline at end of file
+}
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/mapper/GenTableMapper.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/mapper/GenTableMapper.java
index 4d5d3caec4788c32bd0328b4252c2017c3a44e21..e0183c35fbd39d9d7c32c61ba001af55f1ade818 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/mapper/GenTableMapper.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/mapper/GenTableMapper.java
@@ -7,7 +7,7 @@ import java.util.List;
/**
* Describe: 业务表接口
- * Author: 就眠仪式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Mapper
@@ -15,7 +15,7 @@ public interface GenTableMapper
{
/**
* 查询业务列表
- *
+ *
* @param genTable 业务信息
* @return 业务集合
*/
@@ -23,7 +23,7 @@ public interface GenTableMapper
/**
* 查询据库列表
- *
+ *
* @param genTable 业务信息
* @return 数据库表集合
*/
@@ -31,7 +31,7 @@ public interface GenTableMapper
/**
* 查询据库列表
- *
+ *
* @param tableNames 表名称组
* @return 数据库表集合
*/
@@ -39,14 +39,14 @@ public interface GenTableMapper
/**
* 查询所有表信息
- *
+ *
* @return 表信息集合
*/
List selectGenTableAll();
/**
* 查询表ID业务信息
- *
+ *
* @param id 业务ID
* @return 业务信息
*/
@@ -62,7 +62,7 @@ public interface GenTableMapper
/**
* 查询表名称业务信息
- *
+ *
* @param tableName 表名称
* @return 业务信息
*/
@@ -70,7 +70,7 @@ public interface GenTableMapper
/**
* 新增业务
- *
+ *
* @param genTable 业务信息
* @return 结果
*/
@@ -78,7 +78,7 @@ public interface GenTableMapper
/**
* 修改业务
- *
+ *
* @param genTable 业务信息
* @return 结果
*/
@@ -86,9 +86,9 @@ public interface GenTableMapper
/**
* 批量删除业务
- *
+ *
* @param ids 需要删除的数据ID
* @return 结果
*/
int deleteGenTableByIds(String[] ids);
-}
\ No newline at end of file
+}
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/IGenTableColumnService.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/IGenTableColumnService.java
index 923f1af3c2076ff5f6a7be4c8a7cc4d68e317ab0..da4337e2db041a5217ba263b8f9dac70c6a0f4eb 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/IGenTableColumnService.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/IGenTableColumnService.java
@@ -5,14 +5,14 @@ import java.util.List;
/**
* Describe: 业务表字段服务层
- * Author: 就眠仪式
+ * @@author 就眠仪式
* CreateTime: 2019/10/23
* */
public interface IGenTableColumnService
{
/**
* 查询业务字段列表
- *
+ *
* @param genTableColumn 业务字段信息
* @return 业务字段集合
*/
@@ -20,7 +20,7 @@ public interface IGenTableColumnService
/**
* 新增业务字段
- *
+ *
* @param genTableColumn 业务字段信息
* @return 结果
*/
@@ -28,7 +28,7 @@ public interface IGenTableColumnService
/**
* 修改业务字段
- *
+ *
* @param genTableColumn 业务字段信息
* @return 结果
*/
@@ -36,7 +36,7 @@ public interface IGenTableColumnService
/**
* 删除业务字段信息
- *
+ *
* @param ids 需要删除的数据ID
* @return 结果
*/
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/IGenTableService.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/IGenTableService.java
index 88a8d78b16a875d5e9f33c61280f9255fff1dc4d..2d865180a95822f3bc0eb8bfdae64ab5f215b5ff 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/IGenTableService.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/IGenTableService.java
@@ -6,14 +6,14 @@ import java.util.Map;
/**
* Describe: 业务表服务接口
- * Author: 就眠仪式
+ * @@author 就眠仪式
* CreateTime: 2019/10/23
* */
public interface IGenTableService
{
/**
* 查询业务列表
- *
+ *
* @param genTable 业务信息
* @return 业务集合
*/
@@ -21,7 +21,7 @@ public interface IGenTableService
/**
* 查询据库列表
- *
+ *
* @param genTable 业务信息
* @return 数据库表集合
*/
@@ -29,7 +29,7 @@ public interface IGenTableService
/**
* 查询据库列表
- *
+ *
* @param tableNames 表名称组
* @return 数据库表集合
*/
@@ -37,14 +37,14 @@ public interface IGenTableService
/**
* 查询所有表信息
- *
+ *
* @return 表信息集合
*/
List selectGenTableAll();
/**
* 查询业务信息
- *
+ *
* @param id 业务ID
* @return 业务信息
*/
@@ -52,7 +52,7 @@ public interface IGenTableService
/**
* 修改业务
- *
+ *
* @param genTable 业务信息
* @return 结果
*/
@@ -60,7 +60,7 @@ public interface IGenTableService
/**
* 删除业务信息
- *
+ *
* @param ids 需要删除的数据ID
* @return 结果
*/
@@ -68,7 +68,7 @@ public interface IGenTableService
/**
* 导入表结构
- *
+ *
* @param tableList 导入表列表
* @param operName 操作人员
*/
@@ -76,7 +76,7 @@ public interface IGenTableService
/**
* 预览代码
- *
+ *
* @param tableId 表编号
* @return 预览数据列表
*/
@@ -84,7 +84,7 @@ public interface IGenTableService
/**
* 生成代码(下载方式)
- *
+ *
* @param tableName 表名称
* @return 数据
*/
@@ -92,7 +92,7 @@ public interface IGenTableService
/**
* 生成代码(自定义路径)
- *
+ *
* @param tableName 表名称
* @return 数据
*/
@@ -100,7 +100,7 @@ public interface IGenTableService
/**
* 批量生成代码(下载方式)
- *
+ *
* @param tableNames 表数组
* @return 数据
*/
@@ -108,7 +108,7 @@ public interface IGenTableService
/**
* 修改保存参数校验
- *
+ *
* @param genTable 业务信息
*/
void validateEdit(GenTable genTable);
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/impl/GenTableColumnServiceImpl.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/impl/GenTableColumnServiceImpl.java
index 1baa3d750fa4f463e09bff6482af39d95bc25abd..e7708bd1c8e8923b5ab17ce0c7e9fda6d05bffe0 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/impl/GenTableColumnServiceImpl.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/impl/GenTableColumnServiceImpl.java
@@ -10,7 +10,7 @@ import javax.annotation.Resource;
/**
* Describe: 业务表字段服务实现
- * Author: 就眠仪式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Service
@@ -21,7 +21,7 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService
/**
* 查询业务字段列表
- *
+ *
* @param genTableColumn 业务字段信息
* @return 业务字段集合
*/
@@ -33,7 +33,7 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService
/**
* 新增业务字段
- *
+ *
* @param genTableColumn 业务字段信息
* @return 结果
*/
@@ -45,7 +45,7 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService
/**
* 修改业务字段
- *
+ *
* @param genTableColumn 业务字段信息
* @return 结果
*/
@@ -57,7 +57,7 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService
/**
* 删除业务字段对象
- *
+ *
* @param ids 需要删除的数据ID
* @return 结果
*/
@@ -66,4 +66,4 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService
{
return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toStrArray(ids));
}
-}
\ No newline at end of file
+}
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/impl/GenTableServiceImpl.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/impl/GenTableServiceImpl.java
index 6d57b06fd1b522d81b137b1779307e71bb36b793..f22599c38f264d028f02a71c05e2f9029a64593e 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/impl/GenTableServiceImpl.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/service/impl/GenTableServiceImpl.java
@@ -41,7 +41,7 @@ import javax.annotation.Resource;
/**
* Describe: 业务表服务实现
- * Author: 就眠仪式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
@Service
@@ -57,7 +57,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 查询业务信息
- *
+ *
* @param id 业务ID
* @return 业务信息
*/
@@ -71,7 +71,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 查询业务列表
- *
+ *
* @param genTable 业务信息
* @return 业务集合
*/
@@ -83,7 +83,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 查询据库列表
- *
+ *
* @param genTable 业务信息
* @return 数据库表集合
*/
@@ -95,7 +95,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 查询据库列表
- *
+ *
* @param tableNames 表名称组
* @return 数据库表集合
*/
@@ -107,7 +107,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 查询所有表信息
- *
+ *
* @return 表信息集合
*/
@Override
@@ -118,7 +118,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 修改业务
- *
+ *
* @param genTable 业务信息
* @return 结果
*/
@@ -140,7 +140,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 删除业务对象
- *
+ *
* @param ids 需要删除的数据ID
* @return 结果
*/
@@ -154,7 +154,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 导入表结构
- *
+ *
* @param tableList 导入表列表
* @param operName 操作人员
*/
@@ -189,7 +189,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 预览代码
- *
+ *
* @param tableId 表编号
* @return 预览数据列表
*/
@@ -222,7 +222,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 生成代码(下载方式)
- *
+ *
* @param tableName 表名称
* @return 数据
*/
@@ -235,10 +235,10 @@ public class GenTableServiceImpl implements IGenTableService
IOUtils.closeQuietly(zip);
return outputStream.toByteArray();
}
-
+
/**
* 生成代码(自定义路径)
- *
+ *
* @param tableName 表名称
* @return 数据
*/
@@ -284,7 +284,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 批量生成代码
- *
+ *
* @param tableNames 表数组
* @return 数据
*/
@@ -339,7 +339,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 修改保存参数校验
- *
+ *
* @param genTable 业务信息
*/
@Override
@@ -377,7 +377,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 设置主键列信息
- *
+ *
* @param table 业务表信息
*/
public void setPkColumn(GenTable table)
@@ -413,7 +413,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 设置主子表信息
- *
+ *
* @param table 业务表信息
*/
public void setSubTable(GenTable table)
@@ -427,7 +427,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 设置代码生成其他选项值
- *
+ *
* @param genTable 设置后的生成对象
*/
public void setTableFromOptions(GenTable genTable)
@@ -450,7 +450,7 @@ public class GenTableServiceImpl implements IGenTableService
/**
* 获取代码生成地址
- *
+ *
* @param table 业务表信息
* @param template 模板文件路径
* @return 生成地址
@@ -464,4 +464,4 @@ public class GenTableServiceImpl implements IGenTableService
}
return genPath + File.separator + VelocityUtils.getFileName(template, table);
}
-}
\ No newline at end of file
+}
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/GenUtils.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/GenUtils.java
index a4c284c1c9b9916751ebfc8ef1124cfd98ebdfd4..154e07680cd4b8cdea744f345dc61e5e94beb486 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/GenUtils.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/GenUtils.java
@@ -10,7 +10,7 @@ import org.apache.commons.lang3.RegExUtils;
/**
* Describe: 代码生成工具类
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
public class GenUtils
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/VelocityInitializer.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/VelocityInitializer.java
index 26c71ee3dcdd5156a9d947e221002617d7175404..90b11111c16a7860e6b0d69c2ae2817be0495115 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/VelocityInitializer.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/VelocityInitializer.java
@@ -7,7 +7,7 @@ import org.apache.velocity.app.Velocity;
/**
* Describe: 模板引擎工厂
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
public class VelocityInitializer
diff --git a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/VelocityUtils.java b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/VelocityUtils.java
index cc6a5356833d3c17d66344c0c634e1364c83c86d..33c58d5f0d46e143833832ab92c81c8260703d95 100644
--- a/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/VelocityUtils.java
+++ b/pear-modules/pear-generate/src/main/java/com/pearadmin/generate/util/VelocityUtils.java
@@ -15,7 +15,7 @@ import com.alibaba.fastjson.JSONObject;
/**
* Describe: 模板引擎工具
- * Author: 就 眠 仪 式
+ * @author 就 眠 仪 式
* CreateTime: 2019/10/23
* */
public class VelocityUtils
diff --git a/pear-modules/pear-generate/src/main/resources/generate.yml b/pear-modules/pear-generate/src/main/resources/generate.yml
index 3cbc52359359313c73d66553f6ac20f66ce5ec56..9465f589a9c008ff17dfafcaa8c1be8320d315df 100644
--- a/pear-modules/pear-generate/src/main/resources/generate.yml
+++ b/pear-modules/pear-generate/src/main/resources/generate.yml
@@ -1,11 +1,11 @@
# 代码生成
-gen:
+gen:
# 作者
- author: jmys
+ @author jmys
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.pearadmin.system
# 自动去除表前缀,默认是false
autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
- tablePrefix: sys_
\ No newline at end of file
+ tablePrefix: sys_
diff --git a/pear-modules/pear-process/src/main/java/com/pearadmin/process/controller/ProDefinedController.java b/pear-modules/pear-process/src/main/java/com/pearadmin/process/controller/ProDefinedController.java
index 693c488c0ce7d7d46d5f858ce955acc036af0275..b53068631fd0b0ec78725c19daca484b28db19c2 100644
--- a/pear-modules/pear-process/src/main/java/com/pearadmin/process/controller/ProDefinedController.java
+++ b/pear-modules/pear-process/src/main/java/com/pearadmin/process/controller/ProDefinedController.java
@@ -23,7 +23,8 @@ import java.util.List;
/**
* Describe: 流程定义控制器
- * Author: 就眠仪式
+ *
+ * @author 就 眠 仪 式
* createTime: 2019/10/23
*/
@RestController
diff --git a/pear-modules/pear-process/src/main/java/com/pearadmin/process/controller/ProModelController.java b/pear-modules/pear-process/src/main/java/com/pearadmin/process/controller/ProModelController.java
index 1169c8a12c6b0f6d86450f74cb0c9c96adff3126..7eff9d5e5224ee7f912cf7dc316765a182bb0897 100644
--- a/pear-modules/pear-process/src/main/java/com/pearadmin/process/controller/ProModelController.java
+++ b/pear-modules/pear-process/src/main/java/com/pearadmin/process/controller/ProModelController.java
@@ -28,9 +28,10 @@ import java.util.List;
/**
* Describe: 流程模型控制器
- * Author: 就眠仪式
+ *
+ * @author 就 眠 仪 式
* createTime: 2019/10/23
- * */
+ */
@RestController
@RequestMapping(ControllerConstant.API_PROCESS_PREFIX + "model")
public class ProModelController extends BaseController {
@@ -47,11 +48,10 @@ public class ProModelController extends BaseController {
* Describe: 获取流程模型列表视图
* Param: modelAndView
* Return: 流程模型列表视图
- * */
+ */
@GetMapping("main")
- public ModelAndView view(ModelAndView modelAndView)
- {
- modelAndView.setViewName(modelPath+"main");
+ public ModelAndView view(ModelAndView modelAndView) {
+ modelAndView.setViewName(modelPath + "main");
return modelAndView;
}
@@ -59,10 +59,10 @@ public class ProModelController extends BaseController {
* Describe: 获取流程编辑器视图
* Param: modelAndView
* Return: 流程编辑视图
- * */
+ */
@GetMapping("editor")
- public ModelAndView editor(ModelAndView modelAndView){
- modelAndView.setViewName(modelPath+"editor");
+ public ModelAndView editor(ModelAndView modelAndView) {
+ modelAndView.setViewName(modelPath + "editor");
return modelAndView;
}
@@ -70,14 +70,14 @@ public class ProModelController extends BaseController {
* Describe: 获取流程模型列表数据
* Param: modelAndView
* Return: ResultTable
- * */
+ */
@GetMapping("data")
- public ResultTable list(PageDomain pageDomain,String modelName){
+ public ResultTable list(PageDomain pageDomain, String modelName) {
ModelQuery modelQuery = repositoryService.createModelQuery();
- if (StringUtils.hasText(modelName)){
+ if (StringUtils.hasText(modelName)) {
modelQuery.modelNameLike(modelName);
}
- List list = modelQuery.listPage(pageDomain.start(),pageDomain.end());
+ List list = modelQuery.listPage(pageDomain.start(), pageDomain.end());
List data = new ArrayList<>();
list.forEach(model -> {
@@ -90,17 +90,17 @@ public class ProModelController extends BaseController {
});
long count = modelQuery.list().size();
- return pageTable(data,count);
+ return pageTable(data, count);
}
/**
* Describe: 流程创建视图
* Param: modelAndView
* Return: 流程创建视图
- * */
+ */
@GetMapping("add")
- public ModelAndView add(ModelAndView modelAndView){
- modelAndView.setViewName(modelPath+"add");
+ public ModelAndView add(ModelAndView modelAndView) {
+ modelAndView.setViewName(modelPath + "add");
return modelAndView;
}
@@ -108,7 +108,7 @@ public class ProModelController extends BaseController {
* Describe: 创建流程图
* Param: createModelParam
* Return: Result
- * */
+ */
@PostMapping("create")
public Result create(@RequestBody CreateModelParam param) throws IOException {
Model model = repositoryService.newModel();
@@ -128,18 +128,18 @@ public class ProModelController extends BaseController {
* Describe: 创建流程图节点信息
* Param: modelId
* Return: null
- * */
- private void createObjectNode(String modelId){
+ */
+ private void createObjectNode(String modelId) {
ObjectNode editorNode = objectMapper.createObjectNode();
editorNode.put("id", "canvas");
editorNode.put("resourceId", "canvas");
ObjectNode stencilSetNode = objectMapper.createObjectNode();
- stencilSetNode.put("namespace","http://b3mn.org/stencilset/bpmn2.0#");
+ stencilSetNode.put("namespace", "http://b3mn.org/stencilset/bpmn2.0#");
editorNode.put("stencilset", stencilSetNode);
try {
- repositoryService.addModelEditorSource(modelId,editorNode.toString().getBytes("utf-8"));
+ repositoryService.addModelEditorSource(modelId, editorNode.toString().getBytes("utf-8"));
} catch (Exception e) {
- System.out.println("创建模型时完善ModelEditorSource服务异常:"+e);
+ System.out.println("创建模型时完善ModelEditorSource服务异常:" + e);
}
System.out.println("创建模型完善ModelEditorSource结束");
}
@@ -148,9 +148,9 @@ public class ProModelController extends BaseController {
* Describe: 根据 Id 删除流程图
* Param: modelId
* Return: Result
- * */
+ */
@PostMapping("deleteById")
- public Result deleteById(String modelId){
+ public Result deleteById(String modelId) {
repositoryService.deleteModel(modelId);
return success("删除成功");
}
@@ -159,10 +159,10 @@ public class ProModelController extends BaseController {
* Describe: 发布流程
* Param: modelId
* Return: Result
- * */
+ */
@ResponseBody
@RequestMapping("/publish")
- public Result publish(String modelId){
+ public Result publish(String modelId) {
try {
Model modelData = repositoryService.getModel(modelId);
byte[] bytes = repositoryService.getModelEditorSource(modelData.getId());
@@ -173,7 +173,7 @@ public class ProModelController extends BaseController {
BpmnModel model = new BpmnJsonConverter().convertToBpmnModel(modelNode);
Deployment deployment = repositoryService.createDeployment()
.name(modelData.getName())
- .addBpmnModel(modelData.getKey()+".bpmn20.xml", model)
+ .addBpmnModel(modelData.getKey() + ".bpmn20.xml", model)
.deploy();
modelData.setDeploymentId(deployment.getId());
repositoryService.saveModel(modelData);
diff --git a/pear-modules/pear-process/src/main/java/com/pearadmin/process/domain/ProDefined.java b/pear-modules/pear-process/src/main/java/com/pearadmin/process/domain/ProDefined.java
index dddf1a91265687a08d788de91b38e62b2e3c10d4..051db61d32937fbf6df92deedb483cf7644f3ffd 100644
--- a/pear-modules/pear-process/src/main/java/com/pearadmin/process/domain/ProDefined.java
+++ b/pear-modules/pear-process/src/main/java/com/pearadmin/process/domain/ProDefined.java
@@ -5,45 +5,46 @@ import lombok.Data;
/**
* Describe: 流程定义实体
- * Author: 就眠仪式
+ *
+ * @author 就 眠 仪 式
* createTime: 2019/10/23
- * */
+ */
@Data
public class ProDefined extends BaseDomain {
/**
* 流程定义编号
- * */
+ */
private String id;
/**
* 流程定义名称
- * */
+ */
private String name;
/**
* 流程定义标识
- * */
+ */
private String key;
/**
* 流程定义版本
- * */
+ */
private int version;
/**
* xml 资源文件名称
- * */
+ */
private String bpmn;
/**
* png 资源文件名称
- * */
+ */
private String png;
/**
* 部署 Id
- * */
+ */
private String deploymentId;
}
diff --git a/pear-modules/pear-process/src/main/java/com/pearadmin/process/domain/ProModel.java b/pear-modules/pear-process/src/main/java/com/pearadmin/process/domain/ProModel.java
index 594cef159bb15393aa1cd157ec76d74f0eb14191..2c9f9cb7feb1f8d5280f5b9b6aa3e622ff8c360d 100644
--- a/pear-modules/pear-process/src/main/java/com/pearadmin/process/domain/ProModel.java
+++ b/pear-modules/pear-process/src/main/java/com/pearadmin/process/domain/ProModel.java
@@ -5,29 +5,30 @@ import lombok.Data;
/**
* Describe: 流程模型实体
- * Author: 就眠仪式
+ *
+ * @author 就 眠 仪 式
* createTime: 2019/10/23
- * */
+ */
@Data
public class ProModel extends BaseDomain {
- /**
- * 编号
- * */
- private String id;
+ /**
+ * 编号
+ */
+ private String id;
- /**
- * 名称
- * */
- private String name;
+ /**
+ * 名称
+ */
+ private String name;
- /**
- * 标识
- * */
- private String key;
+ /**
+ * 标识
+ */
+ private String key;
- /**
- * 版本
- * */
- private Integer version;
+ /**
+ * 版本
+ */
+ private Integer version;
}
diff --git a/pear-modules/pear-process/src/main/java/com/pearadmin/process/param/CreateModelParam.java b/pear-modules/pear-process/src/main/java/com/pearadmin/process/param/CreateModelParam.java
index a217eb9e45c22707fbf7b301f409522afa3f79d7..8fe32fc480dc83840669d01cdef0e6d83de37de7 100644
--- a/pear-modules/pear-process/src/main/java/com/pearadmin/process/param/CreateModelParam.java
+++ b/pear-modules/pear-process/src/main/java/com/pearadmin/process/param/CreateModelParam.java
@@ -4,30 +4,31 @@ import lombok.Data;
/**
* Describe: 模型创建实体
- * Author: 就眠仪式
+ *
+ * @author 就 眠 仪 式
* createTime: 2019/10/23
- * */
+ */
@Data
public class CreateModelParam {
- /**
- * 模板名称
- * */
- private String name;
+ /**
+ * 模板名称
+ */
+ private String name;
- /**
- * 模板标识
- * */
- private String key;
+ /**
+ * 模板标识
+ */
+ private String key;
- /**
- * 模板标识
- * */
- private String description;
+ /**
+ * 模板标识
+ */
+ private String description;
- /**
- * 模板版本
- * */
- private String version;
+ /**
+ * 模板版本
+ */
+ private String version;
}
diff --git a/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorJsonRestResource.java b/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorJsonRestResource.java
index be310bed095d27c1ec4b9b334eb613603e9b9184..3e4cf222f09fc340f450496cf9a34a2d33711122 100644
--- a/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorJsonRestResource.java
+++ b/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorJsonRestResource.java
@@ -15,7 +15,9 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.nio.charset.StandardCharsets;
-
+/**
+ * @author 就 眠 仪 式
+ */
@RestController
@RequestMapping("service")
public class ModelEditorJsonRestResource implements ModelDataJsonConstants {
@@ -26,7 +28,7 @@ public class ModelEditorJsonRestResource implements ModelDataJsonConstants {
@Resource
private ObjectMapper objectMapper;
- @RequestMapping(value="/model/{modelId}/json", method = RequestMethod.GET, produces = "application/json")
+ @RequestMapping(value = "/model/{modelId}/json", method = RequestMethod.GET, produces = "application/json")
public ObjectNode getEditorJson(@PathVariable String modelId) {
ObjectNode modelNode = null;
Model model = repositoryService.getModel(modelId);
diff --git a/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorSaveRestResource.java b/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorSaveRestResource.java
index 8302b88dc34640da044a46493eb5098a0a11a9b0..f5ac89ab8dec5f29b66dd854692064593f31145c 100644
--- a/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorSaveRestResource.java
+++ b/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorSaveRestResource.java
@@ -11,12 +11,16 @@ import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.image.PNGTranscoder;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
+
import javax.annotation.Resource;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
+/**
+ * @author 就 眠 仪 式
+ */
@RestController
@RequestMapping("service")
public class ModelEditorSaveRestResource implements ModelDataJsonConstants {
@@ -29,13 +33,14 @@ public class ModelEditorSaveRestResource implements ModelDataJsonConstants {
/**
* 保存流程
- * @param modelId 模型ID
- * @param name 流程模型名称
+ *
+ * @param modelId 模型ID
+ * @param name 流程模型名称
* @param description
- * @param json_xml 流程文件
- * @param svg_xml 图片
+ * @param json_xml 流程文件
+ * @param svg_xml 图片
*/
- @RequestMapping(value="/model/{modelId}/save", method = RequestMethod.PUT)
+ @RequestMapping(value = "/model/{modelId}/save", method = RequestMethod.PUT)
@ResponseStatus(value = HttpStatus.OK)
public void saveModel(@PathVariable String modelId, String name, String description, String json_xml, String svg_xml) {
try {
diff --git a/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorToolRestResource.java b/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorToolRestResource.java
index 667c91499a1d13c4882628ea91da9848fd805462..0d1b8e59f39716cb3a6f0dfd1a25ae2ec8591351 100644
--- a/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorToolRestResource.java
+++ b/pear-modules/pear-process/src/main/java/com/pearadmin/process/resource/ModelEditorToolRestResource.java
@@ -2,17 +2,23 @@ package com.pearadmin.process.resource;
import org.activiti.engine.ActivitiException;
import org.apache.commons.io.IOUtils;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
+/**
+ * @author 就 眠 仪 式
+ */
@RestController
@RequestMapping("service")
public class ModelEditorToolRestResource {
@ResponseBody
- @GetMapping(value="/editor/stencilset", produces = "application/json;charset=utf-8")
+ @GetMapping(value = "/editor/stencilset", produces = "application/json;charset=utf-8")
public String getStencilset() {
InputStream stencilsetStream = this.getClass().getClassLoader().getResourceAsStream("stencilset.json");
try {
diff --git a/pear-modules/pear-process/src/main/resources/static/editor-app/app-cfg.js b/pear-modules/pear-process/src/main/resources/static/editor-app/app-cfg.js
index fef58bb28d6a85749d40cd502c5159c4b9902e9d..ec9413e81560fc9a918144d591e775a67e550a56 100644
--- a/pear-modules/pear-process/src/main/resources/static/editor-app/app-cfg.js
+++ b/pear-modules/pear-process/src/main/resources/static/editor-app/app-cfg.js
@@ -1,7 +1,7 @@
/*
* Activiti Modeler component part of the Activiti project
* Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@@ -21,5 +21,5 @@
var ACTIVITI = ACTIVITI || {};
ACTIVITI.CONFIG = {
- 'contextRoot' : '/service',
+ 'contextRoot': '/service',
};
diff --git a/pear-modules/pear-process/src/main/resources/static/editor-app/app.js b/pear-modules/pear-process/src/main/resources/static/editor-app/app.js
index cd43b167e41c2996b941fe1df29288b05caa6188..c7f5b2fed85943f7eef0300cbbc146d433b56282 100644
--- a/pear-modules/pear-process/src/main/resources/static/editor-app/app.js
+++ b/pear-modules/pear-process/src/main/resources/static/editor-app/app.js
@@ -1,7 +1,7 @@
/*
* Activiti Modeler component part of the Activiti project
* Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@@ -19,29 +19,29 @@
'use strict';
var activitiModeler = angular.module('activitiModeler', [
- 'ngCookies',
- 'ngResource',
- 'ngSanitize',
- 'ngRoute',
- 'ngDragDrop',
- 'mgcrea.ngStrap',
- 'ngGrid',
- 'ngAnimate',
- 'pascalprecht.translate',
- 'duScroll'
+ 'ngCookies',
+ 'ngResource',
+ 'ngSanitize',
+ 'ngRoute',
+ 'ngDragDrop',
+ 'mgcrea.ngStrap',
+ 'ngGrid',
+ 'ngAnimate',
+ 'pascalprecht.translate',
+ 'duScroll'
]);
var activitiModule = activitiModeler;
activitiModeler
- // Initialize routes
- .config(['$selectProvider', '$translateProvider', function ($selectProvider, $translateProvider) {
-
- // Override caret for bs-select directive
- angular.extend($selectProvider.defaults, {
- caretHtml: ' '
- });
-
+ // Initialize routes
+ .config(['$selectProvider', '$translateProvider', function ($selectProvider, $translateProvider) {
+
+ // Override caret for bs-select directive
+ angular.extend($selectProvider.defaults, {
+ caretHtml: ' '
+ });
+
// Initialize angular-translate
$translateProvider.useStaticFilesLoader({
prefix: '../../editor-app/i18n/',
@@ -52,40 +52,40 @@ activitiModeler
// remember language
$translateProvider.useCookieStorage();
-
- }])
- .run(['$rootScope', '$timeout', '$modal', '$translate', '$location', '$window', '$http', '$q',
- function($rootScope, $timeout, $modal, $translate, $location, $window, $http, $q) {
-
- $rootScope.config = ACTIVITI.CONFIG;
-
- $rootScope.editorInitialized = false;
-
- $rootScope.editorFactory = $q.defer();
-
- $rootScope.forceSelectionRefresh = false;
-
- $rootScope.ignoreChanges = false; // by default never ignore changes
-
- $rootScope.validationErrors = [];
-
- $rootScope.staticIncludeVersion = Date.now();
-
- /**
- * A 'safer' apply that avoids concurrent updates (which $apply allows).
- */
- $rootScope.safeApply = function(fn) {
- var phase = this.$root.$$phase;
- if(phase == '$apply' || phase == '$digest') {
- if(fn && (typeof(fn) === 'function')) {
- fn();
- }
- } else {
- this.$apply(fn);
- }
- };
-
-
+
+ }])
+ .run(['$rootScope', '$timeout', '$modal', '$translate', '$location', '$window', '$http', '$q',
+ function ($rootScope, $timeout, $modal, $translate, $location, $window, $http, $q) {
+
+ $rootScope.config = ACTIVITI.CONFIG;
+
+ $rootScope.editorInitialized = false;
+
+ $rootScope.editorFactory = $q.defer();
+
+ $rootScope.forceSelectionRefresh = false;
+
+ $rootScope.ignoreChanges = false; // by default never ignore changes
+
+ $rootScope.validationErrors = [];
+
+ $rootScope.staticIncludeVersion = Date.now();
+
+ /**
+ * A 'safer' apply that avoids concurrent updates (which $apply allows).
+ */
+ $rootScope.safeApply = function (fn) {
+ var phase = this.$root.$$phase;
+ if (phase == '$apply' || phase == '$digest') {
+ if (fn && (typeof (fn) === 'function')) {
+ fn();
+ }
+ } else {
+ this.$apply(fn);
+ }
+ };
+
+
/**
* Initialize the event bus: couple all Oryx events with a dispatch of the
* event of the event bus. This way, it gets much easier to attach custom logic
@@ -97,21 +97,19 @@ activitiModeler
var modelUrl = KISBPM.URL.getModel(modelId);
- $http({method: 'GET', url: modelUrl}).
- success(function (data, status, headers, config) {
- $rootScope.editor = new ORYX.Editor(data);
- $rootScope.modelData = angular.fromJson(data);
- $rootScope.editorFactory.resolve();
- }).
- error(function (data, status, headers, config) {
- console.log('Error loading model with id ' + modelId + ' ' + data);
- });
+ $http({method: 'GET', url: modelUrl}).success(function (data, status, headers, config) {
+ $rootScope.editor = new ORYX.Editor(data);
+ $rootScope.modelData = angular.fromJson(data);
+ $rootScope.editorFactory.resolve();
+ }).error(function (data, status, headers, config) {
+ console.log('Error loading model with id ' + modelId + ' ' + data);
+ });
}
function initScrollHandling() {
var canvasSection = jQuery('#canvasSection');
- canvasSection.scroll(function() {
+ canvasSection.scroll(function () {
// Hides the resizer and quick menu items during scrolling
@@ -121,26 +119,26 @@ activitiModeler
$rootScope.selectedElements = selectedElements;
$rootScope.subSelectionElements = subSelectionElements;
if (selectedElements && selectedElements.length > 0) {
- $rootScope.selectedElementBeforeScrolling = selectedElements[0];
+ $rootScope.selectedElementBeforeScrolling = selectedElements[0];
}
- jQuery('.Oryx_button').each(function(i, obj) {
- $rootScope.orginalOryxButtonStyle = obj.style.display;
- obj.style.display = 'none';
+ jQuery('.Oryx_button').each(function (i, obj) {
+ $rootScope.orginalOryxButtonStyle = obj.style.display;
+ obj.style.display = 'none';
});
-
- jQuery('.resizer_southeast').each(function(i, obj) {
- $rootScope.orginalResizerSEStyle = obj.style.display;
+
+ jQuery('.resizer_southeast').each(function (i, obj) {
+ $rootScope.orginalResizerSEStyle = obj.style.display;
obj.style.display = 'none';
});
- jQuery('.resizer_northwest').each(function(i, obj) {
- $rootScope.orginalResizerNWStyle = obj.style.display;
+ jQuery('.resizer_northwest').each(function (i, obj) {
+ $rootScope.orginalResizerNWStyle = obj.style.display;
obj.style.display = 'none';
});
- $rootScope.editor.handleEvents({type:ORYX.CONFIG.EVENT_CANVAS_SCROLL});
+ $rootScope.editor.handleEvents({type: ORYX.CONFIG.EVENT_CANVAS_SCROLL});
});
- canvasSection.scrollStopped(function(){
+ canvasSection.scrollStopped(function () {
// Puts the quick menu items and resizer back when scroll is stopped.
@@ -157,14 +155,14 @@ activitiModeler
}
}
- jQuery('.Oryx_button').each(function(i, obj) {
+ jQuery('.Oryx_button').each(function (i, obj) {
handleDisplayProperty(obj);
});
-
- jQuery('.resizer_southeast').each(function(i, obj) {
+
+ jQuery('.resizer_southeast').each(function (i, obj) {
handleDisplayProperty(obj);
});
- jQuery('.resizer_northwest').each(function(i, obj) {
+ jQuery('.resizer_northwest').each(function (i, obj) {
handleDisplayProperty(obj);
});
@@ -175,154 +173,152 @@ activitiModeler
* Initialize the Oryx Editor when the content has been loaded
*/
$rootScope.$on('$includeContentLoaded', function (event) {
- if (!$rootScope.editorInitialized) {
-
- ORYX._loadPlugins();
-
- var modelId = EDITOR.UTIL.getParameterByName('modelId');
- fetchModel(modelId);
-
- $rootScope.window = {};
- var updateWindowSize = function() {
- $rootScope.window.width = $window.innerWidth;
- $rootScope.window.height = $window.innerHeight;
- };
-
- // Window resize hook
- angular.element($window).bind('resize', function() {
- $rootScope.safeApply(updateWindowSize());
- });
-
- $rootScope.$watch('window.forceRefresh', function(newValue) {
- if(newValue) {
- $timeout(function() {
- updateWindowSize();
- $rootScope.window.forceRefresh = false;
- });
- }
- });
-
- updateWindowSize();
-
- // Hook in resizing of main panels when window resizes
- // TODO: perhaps move to a separate JS-file?
- jQuery(window).resize(function () {
-
- // Calculate the offset based on the bottom of the module header
- var offset = jQuery("#editor-header").offset();
- var propSectionHeight = jQuery('#propertySection').height();
- var canvas = jQuery('#canvasSection');
- var mainHeader = jQuery('#main-header');
-
- if (offset == undefined || offset === null
- || propSectionHeight === undefined || propSectionHeight === null
- || canvas === undefined || canvas === null || mainHeader === null) {
- return;
- }
-
- if ($rootScope.editor)
- {
- var selectedElements = $rootScope.editor.selection;
- var subSelectionElements = $rootScope.editor._subSelection;
-
- $rootScope.selectedElements = selectedElements;
- $rootScope.subSelectionElements = subSelectionElements;
- if (selectedElements && selectedElements.length > 0)
- {
- $rootScope.selectedElementBeforeScrolling = selectedElements[0];
-
- $rootScope.editor.setSelection([]); // needed cause it checks for element changes and does nothing if the elements are the same
- $rootScope.editor.setSelection($rootScope.selectedElements, $rootScope.subSelectionElements);
- $rootScope.selectedElements = undefined;
- $rootScope.subSelectionElements = undefined;
- }
- }
-
- var totalAvailable = jQuery(window).height() - offset.top - mainHeader.height() - 21;
- canvas.height(totalAvailable - propSectionHeight);
- jQuery('#paletteSection').height(totalAvailable);
-
- // Update positions of the resize-markers, according to the canvas
-
- var actualCanvas = null;
- if (canvas && canvas[0].children[1]) {
- actualCanvas = canvas[0].children[1];
- }
-
- var canvasTop = canvas.position().top;
- var canvasLeft = canvas.position().left;
- var canvasHeight = canvas[0].clientHeight;
- var canvasWidth = canvas[0].clientWidth;
- var iconCenterOffset = 8;
- var widthDiff = 0;
-
- var actualWidth = 0;
- if(actualCanvas) {
- // In some browsers, the SVG-element clientwidth isn't available, so we revert to the parent
- actualWidth = actualCanvas.clientWidth || actualCanvas.parentNode.clientWidth;
- }
-
-
- if(actualWidth < canvas[0].clientWidth) {
- widthDiff = actualWidth - canvas[0].clientWidth;
- // In case the canvas is smaller than the actual viewport, the resizers should be moved
- canvasLeft -= widthDiff / 2;
- canvasWidth += widthDiff;
- }
-
- var iconWidth = 17;
- var iconOffset = 20;
-
- var north = jQuery('#canvas-grow-N');
- north.css('top', canvasTop + iconOffset + 'px');
- north.css('left', canvasLeft - 10 + (canvasWidth - iconWidth) / 2 + 'px');
-
- var south = jQuery('#canvas-grow-S');
- south.css('top', (canvasTop + canvasHeight - iconOffset - iconCenterOffset) + 'px');
- south.css('left', canvasLeft - 10 + (canvasWidth - iconWidth) / 2 + 'px');
-
- var east = jQuery('#canvas-grow-E');
- east.css('top', canvasTop - 10 + (canvasHeight - iconWidth) / 2 + 'px');
- east.css('left', (canvasLeft + canvasWidth - iconOffset - iconCenterOffset) + 'px');
-
- var west = jQuery('#canvas-grow-W');
- west.css('top', canvasTop -10 + (canvasHeight - iconWidth) / 2 + 'px');
- west.css('left', canvasLeft + iconOffset + 'px');
-
- north = jQuery('#canvas-shrink-N');
- north.css('top', canvasTop + iconOffset + 'px');
- north.css('left', canvasLeft + 10 + (canvasWidth - iconWidth) / 2 + 'px');
-
- south = jQuery('#canvas-shrink-S');
- south.css('top', (canvasTop + canvasHeight - iconOffset - iconCenterOffset) + 'px');
- south.css('left', canvasLeft +10 + (canvasWidth - iconWidth) / 2 + 'px');
-
- east = jQuery('#canvas-shrink-E');
- east.css('top', canvasTop + 10 + (canvasHeight - iconWidth) / 2 + 'px');
- east.css('left', (canvasLeft + canvasWidth - iconOffset - iconCenterOffset) + 'px');
-
- west = jQuery('#canvas-shrink-W');
- west.css('top', canvasTop + 10 + (canvasHeight - iconWidth) / 2 + 'px');
- west.css('left', canvasLeft + iconOffset + 'px');
- });
-
- jQuery(window).trigger('resize');
-
- jQuery.fn.scrollStopped = function(callback) {
- jQuery(this).scroll(function(){
- var self = this, $this = jQuery(self);
- if ($this.data('scrollTimeout')) {
- clearTimeout($this.data('scrollTimeout'));
- }
- $this.data('scrollTimeout', setTimeout(callback,50,self));
- });
- };
-
- // Always needed, cause the DOM element on which the scroll event listeners are attached are changed for every new model
- initScrollHandling();
-
- $rootScope.editorInitialized = true;
- }
+ if (!$rootScope.editorInitialized) {
+
+ ORYX._loadPlugins();
+
+ var modelId = EDITOR.UTIL.getParameterByName('modelId');
+ fetchModel(modelId);
+
+ $rootScope.window = {};
+ var updateWindowSize = function () {
+ $rootScope.window.width = $window.innerWidth;
+ $rootScope.window.height = $window.innerHeight;
+ };
+
+ // Window resize hook
+ angular.element($window).bind('resize', function () {
+ $rootScope.safeApply(updateWindowSize());
+ });
+
+ $rootScope.$watch('window.forceRefresh', function (newValue) {
+ if (newValue) {
+ $timeout(function () {
+ updateWindowSize();
+ $rootScope.window.forceRefresh = false;
+ });
+ }
+ });
+
+ updateWindowSize();
+
+ // Hook in resizing of main panels when window resizes
+ // TODO: perhaps move to a separate JS-file?
+ jQuery(window).resize(function () {
+
+ // Calculate the offset based on the bottom of the module header
+ var offset = jQuery("#editor-header").offset();
+ var propSectionHeight = jQuery('#propertySection').height();
+ var canvas = jQuery('#canvasSection');
+ var mainHeader = jQuery('#main-header');
+
+ if (offset == undefined || offset === null
+ || propSectionHeight === undefined || propSectionHeight === null
+ || canvas === undefined || canvas === null || mainHeader === null) {
+ return;
+ }
+
+ if ($rootScope.editor) {
+ var selectedElements = $rootScope.editor.selection;
+ var subSelectionElements = $rootScope.editor._subSelection;
+
+ $rootScope.selectedElements = selectedElements;
+ $rootScope.subSelectionElements = subSelectionElements;
+ if (selectedElements && selectedElements.length > 0) {
+ $rootScope.selectedElementBeforeScrolling = selectedElements[0];
+
+ $rootScope.editor.setSelection([]); // needed cause it checks for element changes and does nothing if the elements are the same
+ $rootScope.editor.setSelection($rootScope.selectedElements, $rootScope.subSelectionElements);
+ $rootScope.selectedElements = undefined;
+ $rootScope.subSelectionElements = undefined;
+ }
+ }
+
+ var totalAvailable = jQuery(window).height() - offset.top - mainHeader.height() - 21;
+ canvas.height(totalAvailable - propSectionHeight);
+ jQuery('#paletteSection').height(totalAvailable);
+
+ // Update positions of the resize-markers, according to the canvas
+
+ var actualCanvas = null;
+ if (canvas && canvas[0].children[1]) {
+ actualCanvas = canvas[0].children[1];
+ }
+
+ var canvasTop = canvas.position().top;
+ var canvasLeft = canvas.position().left;
+ var canvasHeight = canvas[0].clientHeight;
+ var canvasWidth = canvas[0].clientWidth;
+ var iconCenterOffset = 8;
+ var widthDiff = 0;
+
+ var actualWidth = 0;
+ if (actualCanvas) {
+ // In some browsers, the SVG-element clientwidth isn't available, so we revert to the parent
+ actualWidth = actualCanvas.clientWidth || actualCanvas.parentNode.clientWidth;
+ }
+
+
+ if (actualWidth < canvas[0].clientWidth) {
+ widthDiff = actualWidth - canvas[0].clientWidth;
+ // In case the canvas is smaller than the actual viewport, the resizers should be moved
+ canvasLeft -= widthDiff / 2;
+ canvasWidth += widthDiff;
+ }
+
+ var iconWidth = 17;
+ var iconOffset = 20;
+
+ var north = jQuery('#canvas-grow-N');
+ north.css('top', canvasTop + iconOffset + 'px');
+ north.css('left', canvasLeft - 10 + (canvasWidth - iconWidth) / 2 + 'px');
+
+ var south = jQuery('#canvas-grow-S');
+ south.css('top', (canvasTop + canvasHeight - iconOffset - iconCenterOffset) + 'px');
+ south.css('left', canvasLeft - 10 + (canvasWidth - iconWidth) / 2 + 'px');
+
+ var east = jQuery('#canvas-grow-E');
+ east.css('top', canvasTop - 10 + (canvasHeight - iconWidth) / 2 + 'px');
+ east.css('left', (canvasLeft + canvasWidth - iconOffset - iconCenterOffset) + 'px');
+
+ var west = jQuery('#canvas-grow-W');
+ west.css('top', canvasTop - 10 + (canvasHeight - iconWidth) / 2 + 'px');
+ west.css('left', canvasLeft + iconOffset + 'px');
+
+ north = jQuery('#canvas-shrink-N');
+ north.css('top', canvasTop + iconOffset + 'px');
+ north.css('left', canvasLeft + 10 + (canvasWidth - iconWidth) / 2 + 'px');
+
+ south = jQuery('#canvas-shrink-S');
+ south.css('top', (canvasTop + canvasHeight - iconOffset - iconCenterOffset) + 'px');
+ south.css('left', canvasLeft + 10 + (canvasWidth - iconWidth) / 2 + 'px');
+
+ east = jQuery('#canvas-shrink-E');
+ east.css('top', canvasTop + 10 + (canvasHeight - iconWidth) / 2 + 'px');
+ east.css('left', (canvasLeft + canvasWidth - iconOffset - iconCenterOffset) + 'px');
+
+ west = jQuery('#canvas-shrink-W');
+ west.css('top', canvasTop + 10 + (canvasHeight - iconWidth) / 2 + 'px');
+ west.css('left', canvasLeft + iconOffset + 'px');
+ });
+
+ jQuery(window).trigger('resize');
+
+ jQuery.fn.scrollStopped = function (callback) {
+ jQuery(this).scroll(function () {
+ var self = this, $this = jQuery(self);
+ if ($this.data('scrollTimeout')) {
+ clearTimeout($this.data('scrollTimeout'));
+ }
+ $this.data('scrollTimeout', setTimeout(callback, 50, self));
+ });
+ };
+
+ // Always needed, cause the DOM element on which the scroll event listeners are attached are changed for every new model
+ initScrollHandling();
+
+ $rootScope.editorInitialized = true;
+ }
});
/**
@@ -331,48 +327,50 @@ activitiModeler
* to any event.
*/
- $rootScope.editorFactory.promise.then(function() {
+ $rootScope.editorFactory.promise.then(function () {
KISBPM.eventBus.editor = $rootScope.editor;
var eventMappings = [
- { oryxType : ORYX.CONFIG.EVENT_SELECTION_CHANGED, kisBpmType : KISBPM.eventBus.EVENT_TYPE_SELECTION_CHANGE },
- { oryxType : ORYX.CONFIG.EVENT_DBLCLICK, kisBpmType : KISBPM.eventBus.EVENT_TYPE_DOUBLE_CLICK },
- { oryxType : ORYX.CONFIG.EVENT_MOUSEOUT, kisBpmType : KISBPM.eventBus.EVENT_TYPE_MOUSE_OUT },
- { oryxType : ORYX.CONFIG.EVENT_MOUSEOVER, kisBpmType : KISBPM.eventBus.EVENT_TYPE_MOUSE_OVER }
+ {
+ oryxType: ORYX.CONFIG.EVENT_SELECTION_CHANGED,
+ kisBpmType: KISBPM.eventBus.EVENT_TYPE_SELECTION_CHANGE
+ },
+ {oryxType: ORYX.CONFIG.EVENT_DBLCLICK, kisBpmType: KISBPM.eventBus.EVENT_TYPE_DOUBLE_CLICK},
+ {oryxType: ORYX.CONFIG.EVENT_MOUSEOUT, kisBpmType: KISBPM.eventBus.EVENT_TYPE_MOUSE_OUT},
+ {oryxType: ORYX.CONFIG.EVENT_MOUSEOVER, kisBpmType: KISBPM.eventBus.EVENT_TYPE_MOUSE_OVER}
];
- eventMappings.forEach(function(eventMapping) {
- $rootScope.editor.registerOnEvent(eventMapping.oryxType, function(event) {
+ eventMappings.forEach(function (eventMapping) {
+ $rootScope.editor.registerOnEvent(eventMapping.oryxType, function (event) {
KISBPM.eventBus.dispatch(eventMapping.kisBpmType, event);
});
});
-
+
$rootScope.editor.registerOnEvent(ORYX.CONFIG.EVENT_SHAPEREMOVED, function (event) {
- var validateButton = document.getElementById(event.shape.resourceId + "-validate-button");
- if (validateButton)
- {
- validateButton.style.display = 'none';
- }
+ var validateButton = document.getElementById(event.shape.resourceId + "-validate-button");
+ if (validateButton) {
+ validateButton.style.display = 'none';
+ }
});
// The Oryx canvas is ready (we know since we're in this promise callback) and the
// event bus is ready. The editor is now ready for use
- KISBPM.eventBus.dispatch(KISBPM.eventBus.EVENT_TYPE_EDITOR_READY, {type : KISBPM.eventBus.EVENT_TYPE_EDITOR_READY});
+ KISBPM.eventBus.dispatch(KISBPM.eventBus.EVENT_TYPE_EDITOR_READY, {type: KISBPM.eventBus.EVENT_TYPE_EDITOR_READY});
});
-
+
// Alerts
$rootScope.alerts = {
queue: []
};
-
- $rootScope.showAlert = function(alert) {
- if(alert.queue.length > 0) {
+
+ $rootScope.showAlert = function (alert) {
+ if (alert.queue.length > 0) {
alert.current = alert.queue.shift();
// Start timout for message-pruning
- alert.timeout = $timeout(function() {
+ alert.timeout = $timeout(function () {
if (alert.queue.length == 0) {
alert.current = undefined;
alert.timeout = undefined;
@@ -384,8 +382,8 @@ activitiModeler
$rootScope.alerts.current = undefined;
}
};
-
- $rootScope.addAlert = function(message, type) {
+
+ $rootScope.addAlert = function (message, type) {
var newAlert = {message: message, type: type};
if (!$rootScope.alerts.timeout) {
// Timeout for message queue is not running, start one
@@ -395,8 +393,8 @@ activitiModeler
$rootScope.alerts.queue.push(newAlert);
}
};
-
- $rootScope.dismissAlert = function() {
+
+ $rootScope.dismissAlert = function () {
if (!$rootScope.alerts.timeout) {
$rootScope.alerts.current = undefined;
} else {
@@ -405,21 +403,21 @@ activitiModeler
$rootScope.showAlert($rootScope.alerts);
}
};
-
- $rootScope.addAlertPromise = function(promise, type) {
+
+ $rootScope.addAlertPromise = function (promise, type) {
if (promise) {
- promise.then(function(data) {
+ promise.then(function (data) {
$rootScope.addAlert(data, type);
});
}
};
-
+
}
- ])
+ ])
// Moment-JS date-formatting filter
- .filter('dateformat', function() {
- return function(date, format) {
+ .filter('dateformat', function () {
+ return function (date, format) {
if (date) {
if (format) {
return moment(date).format(format);
diff --git a/pear-modules/pear-process/src/main/resources/static/editor-app/css/style-common.css b/pear-modules/pear-process/src/main/resources/static/editor-app/css/style-common.css
index 07aab3173b56bdc8886329364db7ea44c5f0986c..142cb51b2082a169ffa74279b8b5927ad58e365b 100644
--- a/pear-modules/pear-process/src/main/resources/static/editor-app/css/style-common.css
+++ b/pear-modules/pear-process/src/main/resources/static/editor-app/css/style-common.css
@@ -55,18 +55,18 @@ body {
}
.simple-list li:hover {
- background-color: #f8f8f9;
+ background-color: #f8f8f9;
}
.simple-list li.nothing-to-see:hover {
- background-color: transparent;
+ background-color: transparent;
}
.simple-list li.active {
- background-color: #eeeeee;
+ background-color: #eeeeee;
}
-.simple-list li >.actions {
+.simple-list li > .actions {
visibility: hidden;
position: absolute;
top: 3px;
@@ -76,15 +76,15 @@ body {
padding: 0 0 0 4px;
}
-.simple-list li >.actions a {
- padding: 4px 4px 0 4px;
- }
+.simple-list li > .actions a {
+ padding: 4px 4px 0 4px;
+}
-.simple-list li >.actions a:hover {
+.simple-list li > .actions a:hover {
background-color: #ffffff;
}
-.simple-list li:hover >.actions {
+.simple-list li:hover > .actions {
visibility: visible;
}
@@ -138,7 +138,9 @@ label {
font-size: 14px;
}
-[ng\:cloak], [ng-cloak], .ng-cloak { display: none; }
+[ng\:cloak], [ng-cloak], .ng-cloak {
+ display: none;
+}
.nothing-to-see {
padding: 5px 0 20px 0;
@@ -310,35 +312,35 @@ a.dropdown-toggle {
/** Subtle dropdown (eg. sort) */
.dropdown-subtle {
- margin-right: 5px;
- color: #606b7d;
+ margin-right: 5px;
+ color: #606b7d;
}
.dropdown-subtle .btn {
- background: transparent;
- line-height: 36px;
- color: #606b7d;
- padding: 0;
- font-size: 14px;
- border: none;
- box-shadow: none;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
+ background: transparent;
+ line-height: 36px;
+ color: #606b7d;
+ padding: 0;
+ font-size: 14px;
+ border: none;
+ box-shadow: none;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
}
.dropdown-subtle .btn-group.open .dropdown-toggle {
- box-shadow: none;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
+ box-shadow: none;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
}
.dropdown-subtle .btn:hover, .dropdown-subtle .btn:focus {
- background: transparent;
- color: #333333;
+ background: transparent;
+ color: #333333;
}
.dropdown-subtle a {
- cursor: pointer;
+ cursor: pointer;
}
/** Popovers */
@@ -354,24 +356,25 @@ a.dropdown-toggle {
.popover.bottom-left, .popover.bottom-right {
margin-top: 10px;
}
- .popover>.arrow, .popover>.arrow {
+
+.popover > .arrow, .popover > .arrow {
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999;
- border-bottom-color: rgba(0,0,0,.25);
+ border-bottom-color: rgba(0, 0, 0, .25);
top: -11px;
}
-.popover.bottom-left>.arrow {
+.popover.bottom-left > .arrow {
left: 40px;
}
-.popover.bottom-right>.arrow {
+.popover.bottom-right > .arrow {
right: 40px;
}
-.popover.bottom-left>.arrow:after, .popover.bottom-right>.arrow:after, .popover.bottom>.arrow:after {
+.popover.bottom-left > .arrow:after, .popover.bottom-right > .arrow:after, .popover.bottom > .arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
@@ -405,7 +408,7 @@ a.dropdown-toggle {
font-size: 12px;
}
-.popover-header .actions a{
+.popover-header .actions a {
display: inline-block;
padding: 8px 5px;
}
@@ -548,7 +551,7 @@ a.dropdown-toggle {
margin-top: 0px;
}
-.subheader .version {
+.subheader .version {
font-weight: bold;
color: #36a7c4;
font-size: 110%;
@@ -558,24 +561,25 @@ a.dropdown-toggle {
border-right: 1px solid #a4acb9;
margin-right: 5px;
}
+
.subheader .btn {
border-color: #e8edf1;
}
-.subheader a.btn:hover, .subheader a.btn:focus {
+.subheader a.btn:hover, .subheader a.btn:focus {
border-color: #e8edf1;
color: #ffffff;
}
.subheader .dropdown-menu .detail {
- vertical-align:middle;
+ vertical-align: middle;
color: #1a1a1a;
}
.subheader p {
font-size: 14px;
color: #1a1a1a;
- word-wrap:break-word;
+ word-wrap: break-word;
}
.subheader p.hint a {
@@ -619,7 +623,7 @@ a.dropdown-toggle {
padding-right: 8px;
}
-.subheader >div>.pull-right {
+.subheader > div > .pull-right {
margin-top: 12px;
margin-right: 5px;
}
@@ -689,7 +693,7 @@ a.dropdown-toggle {
}
.icon-pencil:before {
- content: "\270f";
+ content: "\270f";
}
.icon-caret-up:before {
@@ -829,18 +833,23 @@ a.dropdown-toggle {
@-webkit-keyframes bouncedelay {
- 0%, 80%, 100% { -webkit-transform: scale(0.0) }
- 40% { -webkit-transform: scale(1.0) }
+ 0%, 80%, 100% {
+ -webkit-transform: scale(0.0)
+ }
+ 40% {
+ -webkit-transform: scale(1.0)
+ }
}
@keyframes bouncedelay {
0%, 80%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
- } 40% {
- transform: scale(1.0);
- -webkit-transform: scale(1.0);
- }
+ }
+ 40% {
+ transform: scale(1.0);
+ -webkit-transform: scale(1.0);
+ }
}
/** Alerts */
@@ -856,7 +865,7 @@ a.dropdown-toggle {
z-index: 1010;
}
-.alert-wrapper.no-header {
+.alert-wrapper.no-header {
top: 0px;
}
@@ -883,8 +892,8 @@ a.dropdown-toggle {
.alert.ng-hide-remove {
opacity: 1;
- display:block!important;
- }
+ display: block !important;
+}
.alert.ng-hide {
@@ -902,7 +911,7 @@ a.dropdown-toggle {
.alert .glyphicon {
padding-right: 8px;
- color: #bcd35f;
+ color: #bcd35f;
}
.alert span {
@@ -915,6 +924,7 @@ a.dropdown-toggle {
border-color: #e4593d;
background-color: rgba(228, 89, 61, .7);
}
+
.alert.error .glyphicon {
color: #e4593d;
}
@@ -955,9 +965,9 @@ a.dropdown-toggle {
background-color: #ffffff;
margin-right: 20px;
- -webkit-box-shadow: 2px 2px 2px 0px rgba(220,220,220,0.50);
- -moz-box-shadow: 2px 2px 2px 0px rgba(220,220,220,0.50);
- box-shadow: 2px 2px 2px 0px rgba(220,220,220,0.50);
+ -webkit-box-shadow: 2px 2px 2px 0px rgba(220, 220, 220, 0.50);
+ -moz-box-shadow: 2px 2px 2px 0px rgba(220, 220, 220, 0.50);
+ box-shadow: 2px 2px 2px 0px rgba(220, 220, 220, 0.50);
}
.main-list .sort {
@@ -975,9 +985,9 @@ a.dropdown-toggle {
background-color: rgba(255, 255, 255, .9);
border-bottom: 1px solid #cccccc;
- -webkit-box-shadow: 0px 1px 1px 0px rgba(220,220,220,0.65);
- -moz-box-shadow: 0px 1px 1px 0px rgba(220,220,220,0.65);
- box-shadow: 0px 1px 1px 0px rgba(220,220,220,0.65);
+ -webkit-box-shadow: 0px 1px 1px 0px rgba(220, 220, 220, 0.65);
+ -moz-box-shadow: 0px 1px 1px 0px rgba(220, 220, 220, 0.65);
+ box-shadow: 0px 1px 1px 0px rgba(220, 220, 220, 0.65);
z-index: 2;
}
@@ -1018,9 +1028,9 @@ a.dropdown-toggle {
padding: 6px 8px;
border: 1px solid #cccccc;
- -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
- -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
- box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
background-color: #ffffff;
font-size: 14px;
@@ -1028,13 +1038,14 @@ a.dropdown-toggle {
cursor: pointer;
}
-.selection .glyphicon, .selection .icon {
+.selection .glyphicon, .selection .icon {
padding-right: 5px;
}
.selection .actions {
float: right;
}
+
.selection .actions.no-upload {
float: left;
margin-right: 10px;
@@ -1073,7 +1084,7 @@ a.dropdown-toggle {
.selection.narrow .label {
font-size: 13px;
- padding:0 10px 0 0;
+ padding: 0 10px 0 0;
margin: 0;
color: #666666;
}
@@ -1102,7 +1113,7 @@ a.dropdown-toggle {
color: #999999;
}
-.selection+.dropdown-menu {
+.selection + .dropdown-menu {
width: 100%;
}
@@ -1142,9 +1153,9 @@ button.selection:active, button.selection:focus {
-webkit-border-radius: 0px;
border-radius: 0px;
color: #666666;
- -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
- -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
- box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
}
@@ -1184,7 +1195,7 @@ button.selection:active, button.selection:focus {
.subtle-select:hover, .header .detail a.subtle-select:hover {
background-color: #ffffff;
text-decoration: none;
- color:#1a1a1a;
+ color: #1a1a1a;
}
@@ -1197,7 +1208,7 @@ button.selection:active, button.selection:focus {
}
.list-wrapper {
- overflow: auto;
+ overflow: auto;
}
@@ -1208,12 +1219,13 @@ button.selection:active, button.selection:focus {
.main-list .nothing-to-see {
text-align: center;
- padding:50px 20px;
+ padding: 50px 20px;
}
.main-list .nothing-to-see span {
font-size: 17px;
}
+
.main-list .popover {
width: 375px;
}
@@ -1257,7 +1269,7 @@ button.selection:active, button.selection:focus {
padding: 2px 0px 2px 0px;
}
-.full-list li .badge, .simple-list li .badge{
+.full-list li .badge, .simple-list li .badge {
font-size: 12px;
line-height: 12px;
@@ -1338,9 +1350,9 @@ button.selection:active, button.selection:focus {
height: 100%;
max-height: 100%;
overflow: hidden;
- -webkit-box-shadow: 2px 2px 2px 0px rgba(220,220,220,0.50);
- -moz-box-shadow: 2px 2px 2px 0px rgba(220,220,220,0.50);
- box-shadow: 2px 2px 2px 0px rgba(220,220,220,0.50);
+ -webkit-box-shadow: 2px 2px 2px 0px rgba(220, 220, 220, 0.50);
+ -moz-box-shadow: 2px 2px 2px 0px rgba(220, 220, 220, 0.50);
+ box-shadow: 2px 2px 2px 0px rgba(220, 220, 220, 0.50);
}
.main-content > .header {
@@ -1355,12 +1367,12 @@ button.selection:active, button.selection:focus {
font-size: 26px;
}
-.main-content > .header .btn:hover, .main-content > .header .btn:focus {
+.main-content > .header .btn:hover, .main-content > .header .btn:focus {
border-color: #e8edf1;
color: #ffffff;
}
- .modal-header .label, .header .label {
+.modal-header .label, .header .label {
padding: 0 3px 0 15px;
color: #1a1a1a;
font-weight: normal;
@@ -1368,7 +1380,7 @@ button.selection:active, button.selection:focus {
color: #666666;
}
-.header > .detail >.label:first-child {
+.header > .detail > .label:first-child {
padding-left: 0;
}
@@ -1428,7 +1440,6 @@ button.selection:active, button.selection:focus {
}
-
.section {
margin: 10px 0;
padding: 10px 0 0px 0;
@@ -1468,6 +1479,7 @@ button.selection:active, button.selection:focus {
background-color: rgba(100, 100, 100, .75);
background-image: url('../../images/glasspane.png');
}
+
.modal-content {
-webkit-border-radius: 0;
-moz-border-radius: 0;
@@ -1515,4 +1527,4 @@ button.selection:active, button.selection:focus {
.fullscreen .modal-header h3 .summary {
font-size: 13px;
-}
\ No newline at end of file
+}
diff --git a/pear-modules/pear-process/src/main/resources/static/editor-app/css/style-editor.css b/pear-modules/pear-process/src/main/resources/static/editor-app/css/style-editor.css
index bce6fa7b83bbe0d5c6c16a3bb1a02f382d833b55..5f6021558f55421451e69c802b811c122544cc48 100644
--- a/pear-modules/pear-process/src/main/resources/static/editor-app/css/style-editor.css
+++ b/pear-modules/pear-process/src/main/resources/static/editor-app/css/style-editor.css
@@ -1,6 +1,6 @@
/**
Colors:
-
+
- Header: #333333
- Subheader: #e8edf1
- Subheader border: #a4acb9
@@ -11,9 +11,9 @@
*/
.container-fluid {
- max-width: 1400px;
- min-width: 1000px;
- margin: 0 auto;
+ max-width: 1400px;
+ min-width: 1000px;
+ margin: 0 auto;
}
.subtle-select .glyphicon {
@@ -26,8 +26,8 @@ a.subtle-select:hover .glyphicon {
}
.full {
- padding: 0 15px;
- width: 100%;
+ padding: 0 15px;
+ width: 100%;
}
.inline {
@@ -43,8 +43,8 @@ a.subtle-select:hover .glyphicon {
}
.no-pad {
- margin: 0;
- max-width: 1300px;
+ margin: 0;
+ max-width: 1300px;
min-width: 1100px;
}
@@ -56,105 +56,106 @@ a.subtle-select:hover .glyphicon {
.inset .col-sm-3 {
margin-left: -15px;
}
-.no-pad > div{
- padding: 0;
+
+.no-pad > div {
+ padding: 0;
}
.dropdown-toggle .icon-caret-down {
- padding-left: 10px;
- font-size: 85%;
+ padding-left: 10px;
+ font-size: 85%;
}
h1 {
- margin: 0 0 0 15px;
- padding: 0;
- font-size: 22px;
- line-height: 40px;
- border: none;
- color: #ffffff;
- font-family: 'Lato', sans-serif;
+ margin: 0 0 0 15px;
+ padding: 0;
+ font-size: 22px;
+ line-height: 40px;
+ border: none;
+ color: #ffffff;
+ font-family: 'Lato', sans-serif;
}
.truncate, .truncate > span {
- white-space: nowrap;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
+ white-space: nowrap;
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
.subheader .details .counter {
- top: -1px;
- line-height: 1;
- display: inline-block;
- padding: 2px 6px;
- min-width: 20px;
- background-color: #e8edf1;
- color: #333333;
+ top: -1px;
+ line-height: 1;
+ display: inline-block;
+ padding: 2px 6px;
+ min-width: 20px;
+ background-color: #e8edf1;
+ color: #333333;
}
.subheader .subtle-select {
- margin: -6px 0 0 -8px;
+ margin: -6px 0 0 -8px;
}
.btn .icon-and-label {
- padding-right: 5px;
-}
+ padding-right: 5px;
+}
.dropdown-menu .title {
- margin: 5px 10px 0px 10px;
- font-size: 17px;
- min-width: 250px;
+ margin: 5px 10px 0px 10px;
+ font-size: 17px;
+ min-width: 250px;
}
.dropdown-menu ul {
- list-style: none;
- list-style-position: inside;
- padding: 5px 10px;
+ list-style: none;
+ list-style-position: inside;
+ padding: 5px 10px;
}
.input-group-addon {
- background-color: transparent;
+ background-color: transparent;
}
/* List Filter */
.filter-wrapper {
- min-height: 400px;
- margin-top: 10px;
+ min-height: 400px;
+ margin-top: 10px;
margin-left: -15px;
}
ul.filter-list {
- list-style: none;
- list-style-position: inside;
- padding-left: 0px;
- padding-top: 10px;
+ list-style: none;
+ list-style-position: inside;
+ padding-left: 0px;
+ padding-top: 10px;
}
ul.filter-list li a {
- display: block;
- color: #373e48;
- font-size: 17px;
- margin: 10px 5px 10px 0px;
- padding-left: 10px;
+ display: block;
+ color: #373e48;
+ font-size: 17px;
+ margin: 10px 5px 10px 0px;
+ padding-left: 10px;
}
ul.filter-list li.current a {
- color: #36a7c4;
- padding-left: 5px;
- border-left: 4px solid #36a7c4;
+ color: #36a7c4;
+ padding-left: 5px;
+ border-left: 4px solid #36a7c4;
}
ul.filter-list li a:hover, ul.filter-list li a:focus {
- text-decoration: none;
- background-color: #e8edf1;
+ text-decoration: none;
+ background-color: #e8edf1;
}
ul.filter-list li.current a:hover, ul.filter-list li.current a:focus {
- background-color: transparent;
- color: #36a7c4;
- cursor: default;
- text-decoration: none;
+ background-color: transparent;
+ color: #36a7c4;
+ cursor: default;
+ text-decoration: none;
}
@@ -162,160 +163,163 @@ ul.filter-list li.current a:hover, ul.filter-list li.current a:focus {
.item-wrapper {
- padding-left: 0;
- margin-top: 5px;
+ padding-left: 0;
+ margin-top: 5px;
}
.item-wrapper .message {
- text-align: left;
- margin-left: 5px;
- line-height: 40px;
- color: #606b7d;
+ text-align: left;
+ margin-left: 5px;
+ line-height: 40px;
+ color: #606b7d;
}
+
.item-wrapper .message span {
- font-size: 14px;
+ font-size: 14px;
}
.item-wrapper .item {
- width: 25%;
- padding: 0;
- margin: 0;
- float: left;
+ width: 25%;
+ padding: 0;
+ margin: 0;
+ float: left;
}
-.item-wrapper .item .btn-default.disabled,
+.item-wrapper .item .btn-default.disabled,
.item-wrapper .item .btn-default[disabled],
.item-wrapper .item .btn-default[disabled]:active,
.item-wrapper .item .btn-default[disabled]:hover {
- border-color: #ffffff;
- cursor: default;
+ border-color: #ffffff;
+ cursor: default;
}
.item-wrapper .item .item-box {
- margin: 5px;
- border: 1px solid #e8edf1;
- height: 250px;
- overflow: hidden;
- cursor: pointer;
- background-repeat: no-repeat;
- background-position: center 20px;
- background-size: auto;
+ margin: 5px;
+ border: 1px solid #e8edf1;
+ height: 250px;
+ overflow: hidden;
+ cursor: pointer;
+ background-repeat: no-repeat;
+ background-position: center 20px;
+ background-size: auto;
position: relative;
}
.item-box .details {
position: relative;
- background-color: #e8edf1;
- height: 160px;
- margin-top: 120px;
- padding: 5px;
- color: #373e48;
- font-size: 13px;
-
- transition: margin-top .5s ease;
- -moz-transition: margin-top .5s ease;
- -webkit-transition: margin-top .5s ease;
- -o-transition: margin-top .5s ease;
+ background-color: #e8edf1;
+ height: 160px;
+ margin-top: 120px;
+ padding: 5px;
+ color: #373e48;
+ font-size: 13px;
+
+ transition: margin-top .5s ease;
+ -moz-transition: margin-top .5s ease;
+ -webkit-transition: margin-top .5s ease;
+ -o-transition: margin-top .5s ease;
}
.item-box:hover .details, .item-box.active .details {
- margin-top: 50px;
+ margin-top: 50px;
}
.item-box .actions {
- padding: 5px;
- height: 45px;
+ padding: 5px;
+ height: 45px;
}
.item-box .actions .btn-group {
- visibility: hidden;
+ visibility: hidden;
}
.item-box:hover .actions .btn-group, .item-box.active .actions .btn-group {
- visibility: inherit;
+ visibility: inherit;
}
.item-box .details h3 {
- font-size: 14px;
- margin: 0;
- padding: 2px;
- color: #373e48;
+ font-size: 14px;
+ margin: 0;
+ padding: 2px;
+ color: #373e48;
}
.item-box .details span {
- display: block;
- margin-top: 5px;
+ display: block;
+ margin-top: 5px;
}
.item-box .details span i {
- padding-right: 10px;
- padding-left: 5px;
+ padding-right: 10px;
+ padding-left: 5px;
}
.item-box .details .basic-details {
- min-height: 60px;
+ min-height: 60px;
}
.item-box .details p {
- width: 100%;
- height: 70px;
- font-size: 12px;
- overflow: hidden;
+ width: 100%;
+ height: 70px;
+ font-size: 12px;
+ overflow: hidden;
}
.create-inline {
- padding: 100px 20px 80px 20px;
- border: 1px solid #e8edf1;
+ padding: 100px 20px 80px 20px;
+ border: 1px solid #e8edf1;
}
+
.create-inline span {
- display: block;
- font-size: 18px;
- color: #1a1a1a;
- text-align: center;
- margin-bottom: 20px;
-}
+ display: block;
+ font-size: 18px;
+ color: #1a1a1a;
+ text-align: center;
+ margin-bottom: 20px;
+}
.create-inline .glyphicon {
- margin-right: 10px;
+ margin-right: 10px;
}
.show-more {
- clear: both;
- height: 50px;
- text-align: center;
- padding-top: 5px;
- margin: 5px;
+ clear: both;
+ height: 50px;
+ text-align: center;
+ padding-top: 5px;
+ margin: 5px;
}
.show-more a {
- display: block;
- padding: 5px;
- font-size: 15px;
- text-decoration: none;
- cursor: pointer;
- color: #666666;
+ display: block;
+ padding: 5px;
+ font-size: 15px;
+ text-decoration: none;
+ cursor: pointer;
+ color: #666666;
}
.show-more a:hover {
- color: #1a1a1a;
- background: #e8edf1;
+ color: #1a1a1a;
+ background: #e8edf1;
}
.content-canvas-wrapper {
- -moz-box-shadow: inset 0 3px 3px -4px #ababab;
- -webkit-box-shadow: inset 0 3px 3px -4px #ababab;
- box-shadow: inset 0 3px 3px -4px #ababab;
+ -moz-box-shadow: inset 0 3px 3px -4px #ababab;
+ -webkit-box-shadow: inset 0 3px 3px -4px #ababab;
+ box-shadow: inset 0 3px 3px -4px #ababab;
margin: 15px 7px 0 7px;
z-index: 0;
}
+
.content-canvas {
background-color: #f9f9f9;
margin: 0 3px 0 3px;
- -moz-box-shadow: inset 0 3px 3px -4px #ababab;
- -webkit-box-shadow: inset 0 3px 3px -4px #ababab;
- box-shadow: inset 0 3px 3px -4px #ababab;
+ -moz-box-shadow: inset 0 3px 3px -4px #ababab;
+ -webkit-box-shadow: inset 0 3px 3px -4px #ababab;
+ box-shadow: inset 0 3px 3px -4px #ababab;
padding: 20px;
}
@@ -325,7 +329,7 @@ ul.filter-list li.current a:hover, ul.filter-list li.current a:focus {
margin-bottom: 5px;
}
-.content-canvas .no-results{
+.content-canvas .no-results {
color: #999999;
font-size: 16px;
margin: 10px 0px;
@@ -337,104 +341,106 @@ ul.filter-list li.current a:hover, ul.filter-list li.current a:focus {
/* History */
table.history {
- margin: 0;
- padding: 0;
+ margin: 0;
+ padding: 0;
}
.subheader table.history {
- min-width: 250px;
+ min-width: 250px;
}
table.history td {
- vertical-align: middle;
+ vertical-align: middle;
}
table.history tr td:last-child {
- width: 90%;
+ width: 90%;
}
table.history tr:hover {
- background-color: #f3f6f8;
- cursor: pointer;
+ background-color: #f3f6f8;
+ cursor: pointer;
}
+
table.history tr.current:hover {
- background-color: #e8edf1;
- cursor: inherit;
+ background-color: #e8edf1;
+ cursor: inherit;
}
table.history a:hover {
- text-decoration: none;
-
+ text-decoration: none;
+
}
table.history .version {
- font-size: 30px;
- display: inline-block;
- color: #36a7c4;
- padding: 5px 10px;
- vertical-align:middle;
- color: #36a7c4;
+ font-size: 30px;
+ display: inline-block;
+ color: #36a7c4;
+ padding: 5px 10px;
+ vertical-align: middle;
+ color: #36a7c4;
}
table.history .detail {
- padding: 5px 5px;
- font-size: 15px;
- color: #1a1a1a;
- display: inline-block;
+ padding: 5px 5px;
+ font-size: 15px;
+ color: #1a1a1a;
+ display: inline-block;
}
table.history tr.current {
- font-weight: bold;
- background-color: #e8edf1;
+ font-weight: bold;
+ background-color: #e8edf1;
}
+
table.history tr.current td {
- background-color: #e8edf1;
+ background-color: #e8edf1;
}
.comments {
- clear: both;
- width: 350px;
- border-top: 1px solid #eeeeee;
- margin-top: 5px;
- max-height: 350px;
- overflow: auto;
+ clear: both;
+ width: 350px;
+ border-top: 1px solid #eeeeee;
+ margin-top: 5px;
+ max-height: 350px;
+ overflow: auto;
}
.comment {
- margin: 10px 0px 20px 0px;
- font-size: 12px;
+ margin: 10px 0px 20px 0px;
+ font-size: 12px;
}
.comment .date {
- color: #999999;
- font-size: 12px;
+ color: #999999;
+ font-size: 12px;
}
.comment .author {
- color: #36a7c4;
- font-size: 18px;
+ color: #36a7c4;
+ font-size: 18px;
}
.comment p {
- word-wrap: break-word;
+ word-wrap: break-word;
}
.modal.modal-wide .modal-dialog {
- width: 1000px;
+ width: 1000px;
}
.modal-dialog.modal-wide {
- width: 1000px;
+ width: 1000px;
}
.modal-body p {
- font-size: 15px;
+ font-size: 15px;
}
.modal-body p.danger {
- color: #d35f5f;
- margin-top: 10px;
+ color: #d35f5f;
+ margin-top: 10px;
}
.form-group .inline-help {
@@ -452,6 +458,7 @@ table.history tr.current td {
width: 100%;
text-align: left;
}
+
.popup-wrapper .people-select {
max-height: 160px;
}
@@ -476,6 +483,7 @@ table.history tr.current td {
.center-pane .content {
overflow: hidden;
}
+
.center-pane .tab-actions {
padding: 8px;
}
@@ -483,6 +491,7 @@ table.history tr.current td {
.center-pane .tabs-wrapper > .pull-right {
margin-right: 5px;
}
+
.center-pane .content {
padding: 10px;
}
@@ -502,13 +511,13 @@ table.history tr.current td {
.center-pane .header h1 {
font-size: 30px;
margin: 0;
- padding:0;
+ padding: 0;
}
.center-pane .header h2 {
font-size: 24px;
margin: 0 0 5px 0;
- padding:0;
+ padding: 0;
}
.center-pane .header {
@@ -570,54 +579,56 @@ ul.list {
margin-bottom: 3px;
}
-ul.list>li {
+ul.list > li {
line-height: 30px;
margin: 0;
padding: 4px;
cursor: pointer;
}
-.popup-wrapper ul.list>li {
+.popup-wrapper ul.list > li {
border-top: 1px solid #eeeeee;
}
-.popup-wrapper ul.list>li:last-child {
+.popup-wrapper ul.list > li:last-child {
border-bottom: 1px solid #eeeeee;
}
-ul.list>li:hover, ul.list>li.active {
+ul.list > li:hover, ul.list > li.active {
background-color: #f2f2f2;
}
-ul.list >li .actions {
- float:right;
+ul.list > li .actions {
+ float: right;
margin: 0px 0px 0px 5px;
visibility: hidden;
}
-ul.list>li:hover .actions {
+ul.list > li:hover .actions {
visibility: inherit;
}
/** Animations **/
-.fadein.ng-enter,
+.fadein.ng-enter,
.fadein.ng-move {
- -webkit-transition: 0.5s linear opacity;
- transition: 0.5s linear all;
+ -webkit-transition: 0.5s linear opacity;
+ transition: 0.5s linear all;
}
.fadein.ng-enter {
- opacity:0;
+ opacity: 0;
}
+
.fadein.ng-enter.ng-enter-active {
- opacity:1;
+ opacity: 1;
}
.fadein.ng-move {
- opacity:0.5;
+ opacity: 0.5;
}
+
.fadein.ng-move.ng-move-active {
- opacity:1;
+ opacity: 1;
}
.popup-error {
@@ -634,6 +645,6 @@ ul.list>li:hover .actions {
/** LOADING */
.message .loading {
- line-height: 40px;
- margin-left: 0px;
-}
\ No newline at end of file
+ line-height: 40px;
+ margin-left: 0px;
+}
diff --git a/pear-modules/pear-process/src/main/resources/static/editor-app/css/style.css b/pear-modules/pear-process/src/main/resources/static/editor-app/css/style.css
index b4916936fcef7c8e9fc902d7146ef8be2423fa21..8ebedb6df695bea1be803dd0da07b6afaede0213 100644
--- a/pear-modules/pear-process/src/main/resources/static/editor-app/css/style.css
+++ b/pear-modules/pear-process/src/main/resources/static/editor-app/css/style.css
@@ -2,23 +2,23 @@
font-family: 'ActivitiModeler';
src: url('../fonts/activiti-admin-webfont.eot');
src: url('../fonts/activiti-admin-webfont.eot?#iefix') format('embedded-opentype'),
- url('../fonts/activiti-admin-webfont.woff') format('woff'),
- url('../fonts/activiti-admin-webfont.ttf') format('truetype'),
- url('../fonts/activiti-admin-webfont.svg#activitimodelerregular') format('svg');
+ url('../fonts/activiti-admin-webfont.woff') format('woff'),
+ url('../fonts/activiti-admin-webfont.ttf') format('truetype'),
+ url('../fonts/activiti-admin-webfont.svg#activitimodelerregular') format('svg');
font-weight: normal;
font-style: normal;
}
.row-no-gutter .col-xs-9 {
- padding-left: 0px;
- padding-right: 0px;
- z-index: 50;
+ padding-left: 0px;
+ padding-right: 0px;
+ z-index: 50;
}
.row-no-gutter .col-xs-3 {
- padding-left: 0px;
- padding-right: 0px;
- z-index: 100;
+ padding-left: 0px;
+ padding-right: 0px;
+ z-index: 100;
}
.editor-item-picker {
@@ -35,20 +35,20 @@
}
.editor-toolbar {
- padding-left: 5px;
+ padding-left: 5px;
}
.editor-toolbar > .btn-group {
- margin: 12px 15px 0px 0px;
+ margin: 12px 15px 0px 0px;
}
-.editor-toolbar > .btn-group.pull-right {
- margin: 0;
+.editor-toolbar > .btn-group.pull-right {
+ margin: 0;
}
.editor-toolbar .btn.btn-inverse {
- font-size: 24px;
- color: #FFFFFF;
+ font-size: 24px;
+ color: #FFFFFF;
border-color: rgba(0, 0, 0, 0);
padding: 3px 6px 0px 6px;
box-shadow: none;
@@ -59,88 +59,91 @@
height: 36px;
min-width: 36px;
}
+
.editor-toolbar .btn.btn-inverse.pressed {
- background-color: #287d92;
- color: #174753;
+ background-color: #287d92;
+ color: #174753;
}
.editor-toolbar .btn.btn-inverse.disabled, .editor-toolbar .btn.btn-inverse[disabled], .editor-toolbar .btn.btn-inverse[disabled]:active, .editor-toolbar .btn.btn-inverse[disabled]:hover {
- background-color: #668b94;
- border-color: #668b94;
+ background-color: #668b94;
+ border-color: #668b94;
}
.editor-toolbar .btn.btn-inverse.separator {
- background: transparent;
- padding: 4px 5px 0px 5px;
- width: 1px;
- min-width: 1px;
+ background: transparent;
+ padding: 4px 5px 0px 5px;
+ width: 1px;
+ min-width: 1px;
}
.editor-toolbar .toolbar-separator {
- background: #a4acb9;
- width: 1px;
- height: 30px;
+ background: #a4acb9;
+ width: 1px;
+ height: 30px;
}
.stencils {
- border-right: 1pt solid #c7cacd;
- overflow: auto;
- z-index: 5000;
+ border-right: 1pt solid #c7cacd;
+ overflow: auto;
+ z-index: 5000;
}
.stencils ul {
- padding-left: 0;
+ padding-left: 0;
}
.stencils > div {
- margin-top: 10px;
+ margin-top: 10px;
}
.stencil-group {
- list-style: none;
- list-style-position: outside;
- margin: 0px 15px 0px 0px;
+ list-style: none;
+ list-style-position: outside;
+ margin: 0px 15px 0px 0px;
}
.stencil-group > li {
- list-style: none;
- list-style-position: outside;
- margin: 0px 0px 5px 15px;
- background-color: #ffffff;
- font-family: Arial, Regular;
- font-size: 17px;
- color: #323437;
+ list-style: none;
+ list-style-position: outside;
+ margin: 0px 0px 5px 15px;
+ background-color: #ffffff;
+ font-family: Arial, Regular;
+ font-size: 17px;
+ color: #323437;
}
.stencil-group > li > span {
- margin-left: 5px;
- padding-top:5px;
- padding-bottom: 5px;
- display: block;
- cursor: pointer;
+ margin-left: 5px;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ display: block;
+ cursor: pointer;
}
.stencil-group > li > span > i {
- font-size: 12px;
- line-height: 17px;
+ font-size: 12px;
+ line-height: 17px;
}
+
.stencil-group > li > ul {
- list-style: none;
- list-style-position: inside;
- background-color: transparent;
- margin: 0px;
- overflow: hidden;
- padding-left: 20px;
+ list-style: none;
+ list-style-position: inside;
+ background-color: transparent;
+ margin: 0px;
+ overflow: hidden;
+ padding-left: 20px;
}
.stencil-group.collapsed > li {
- color: #000000;
+ color: #000000;
}
+
.stencil-group.collapsed > li > ul {
- max-height: 0px;
- padding-top: 0;
- padding-bottom: 0;
+ max-height: 0px;
+ padding-top: 0;
+ padding-bottom: 0;
}
.stencil-group-non-root > li {
@@ -168,63 +171,63 @@
/* Modeling Canvas
-------------------------------- */
div.canvas-wrapper {
- overflow: auto;
- background-color: #F8F8F8;
+ overflow: auto;
+ background-color: #F8F8F8;
}
.canvas_resize_indicator i {
- font-size: 15px;
- color: #ffffff;
- cursor: pointer;
+ font-size: 15px;
+ color: #ffffff;
+ cursor: pointer;
}
.canvas_resize_indicator.N, .canvas_resize_indicator.S, .canvas_resize_indicator.E, .canvas_resize_indicator.W {
- background: #5fbcd3;
- height: 17px;
- width: 17px;
- text-align: center;
- -webkit-border-radius:3px;
- -moz-border-radius:3px;
- border-radius:3px;
+ background: #5fbcd3;
+ height: 17px;
+ width: 17px;
+ text-align: center;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
}
#canvas-grow-N.canvas_resize_indicator, #canvas-shrink-S.canvas_resize_indicator {
- margin: 0;
- top: auto;
+ margin: 0;
+ top: auto;
}
#canvas-grow-S.canvas_resize_indicator, #canvas-shrink-N.canvas_resize_indicator {
- margin: 0;
- bottom: auto;
+ margin: 0;
+ bottom: auto;
}
#canvas-grow-E.canvas_resize_indicator, #canvas-shrink-W.canvas_resize_indicator {
- margin: 0;
- right: auto;
+ margin: 0;
+ right: auto;
}
#canvas-grow-W.canvas_resize_indicator, #canvas-shrink-E.canvas_resize_indicator {
- margin: 0;
- left: auto;
+ margin: 0;
+ left: auto;
}
.x-panel-body.x-panel-body-noheader.x-panel-body-noborder, .ORYX_Editor x-panel {
- background-color: #F8F8F8;
+ background-color: #F8F8F8;
}
.canvas-message {
- position: absolute;
- top: 60px;
- right: 10px;
- background: transparent;
- font-size: 10pt;
+ position: absolute;
+ top: 60px;
+ right: 10px;
+ background: transparent;
+ font-size: 10pt;
}
div.propertySection {
- height: 250px;
+ height: 250px;
background-color: #e8edf1;
- margin-bottom: 0px;
+ margin-bottom: 0px;
}
.selected-item-title {
@@ -236,118 +239,118 @@ div.propertySection {
}
.selected-item-title a {
- display: block;
- color: #1a1a1a;
+ display: block;
+ color: #1a1a1a;
}
.selected-item-title .glyphicon {
- line-height: 25px;
- font-size: 14px;
+ line-height: 25px;
+ font-size: 14px;
}
.selected-item-title a:hover, .selected-item-title a:focus {
- color: #1a1a1a;
- text-decoration: none;
+ color: #1a1a1a;
+ text-decoration: none;
}
.selected-item-section > div > .pull-right {
- line-height: 50px;
- margin: 0px 10px;
- font-size: 14px;
+ line-height: 50px;
+ margin: 0px 10px;
+ font-size: 14px;
}
.selected-item-body .property-row {
- float: left;
- width: 50%;
- border: 0;
- margin: 0;
- padding: 0;
- font-size: 13px;
- overflow: hidden;
+ float: left;
+ width: 50%;
+ border: 0;
+ margin: 0;
+ padding: 0;
+ font-size: 13px;
+ overflow: hidden;
}
.selected-item-body .property-row:hover {
- background-color: #d7dfe6;
+ background-color: #d7dfe6;
}
.selected-item-body {
- padding: 0;
- overflow: auto;
- height: 199px;
+ padding: 0;
+ overflow: auto;
+ height: 199px;
}
.selected-item-body > div {
- overflow: hidden;
- margin: 5px 20px;
+ overflow: hidden;
+ margin: 5px 20px;
}
.property-row > span {
- display: block;
- float: left;
- margin: 2px 2%;
- padding: 0;
- min-height: 25px;
+ display: block;
+ float: left;
+ margin: 2px 2%;
+ padding: 0;
+ min-height: 25px;
}
.property-row span.value {
- cursor: pointer;
- width: 46%;
- padding: 0;
- margin: 0;
+ cursor: pointer;
+ width: 46%;
+ padding: 0;
+ margin: 0;
}
.property-row span.value:hover {
- cursor: pointer;
+ cursor: pointer;
}
.property-row span.title {
- font-size: 13px;
- font-weight: bold;
- width: 46%;
+ font-size: 13px;
+ font-weight: bold;
+ width: 46%;
}
.property-row span.title-removed {
- font-size: 13px;
- font-weight: normal;
- width: 46%;
+ font-size: 13px;
+ font-weight: normal;
+ width: 46%;
}
.propertySection.collapsed {
- max-height: 50px;
- height: 50px;
- overflow: hidden;
+ max-height: 50px;
+ height: 50px;
+ overflow: hidden;
}
.propertySection.collapsed .selected-item-title {
- border: none;
+ border: none;
}
.property-row input[type="text"] {
- height: 25px;
- margin: 2px 0;
- padding: 0px 5px;
- width: 100%;
+ height: 25px;
+ margin: 2px 0;
+ padding: 0px 5px;
+ width: 100%;
outline: none;
- border:none !important;
- box-shadow:none !important;
+ border: none !important;
+ box-shadow: none !important;
}
.default-grid {
- border: 1px solid rgb(212,212,212);
+ border: 1px solid rgb(212, 212, 212);
width: 100%;
height: 300px;
margin-bottom: 10px;
}
.kis-listener-grid {
- border: 1px solid rgb(212,212,212);
+ border: 1px solid rgb(212, 212, 212);
width: 100%;
height: 200px;
margin-bottom: 10px;
}
.kis-field-grid {
- border: 1px solid rgb(212,212,212);
+ border: 1px solid rgb(212, 212, 212);
width: 100%;
height: 150px;
margin-bottom: 10px;
@@ -361,43 +364,43 @@ div.propertySection {
.form-property-checkbox {
- margin:0;
+ margin: 0;
}
/* Oryx overrides
-------------------------------- */
ul.x-menu-list {
- list-style: none;
- list-style-position: inside;
- width: 200px;
- background-color: #FFFFFF;
- border: 1px solid #E1E2E5;
- -webkit-border-radius:3px;
- -moz-border-radius:3px;
- border-radius:3px;
- padding: 3px;
+ list-style: none;
+ list-style-position: inside;
+ width: 200px;
+ background-color: #FFFFFF;
+ border: 1px solid #E1E2E5;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ padding: 3px;
}
-img.x-menu-item-icon {
- width: auto;
- height: auto;
- margin-right: 5px;
+img.x-menu-item-icon {
+ width: auto;
+ height: auto;
+ margin-right: 5px;
}
li.x-menu-list-item {
- margin: 3px 0px;
+ margin: 3px 0px;
}
li.x-menu-list-item.x-menu-item-active {
- background-color: #EFEFEF;
+ background-color: #EFEFEF;
}
li.x-menu-list-item a {
- color: #000000;
+ color: #000000;
}
li.x-menu-list-item.x-menu-item-active a {
- text-decoration: none;
+ text-decoration: none;
}
.sequence-flow-order-element {
@@ -406,72 +409,85 @@ li.x-menu-list-item.x-menu-item-active a {
/* Editor icon font */
.editor-icon {
- position: relative;
- top: 1px;
- display: inline-block;
- font-family: 'ActivitiModeler';
- font-style: normal;
- font-weight: 400;
- line-height: 1;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
+ position: relative;
+ top: 1px;
+ display: inline-block;
+ font-family: 'ActivitiModeler';
+ font-style: normal;
+ font-weight: 400;
+ line-height: 1;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
}
.editor-icon-save:before {
- content: 'a';
+ content: 'a';
}
.editor-icon-edit:before {
- content: 'b';
+ content: 'b';
}
.editor-icon-cut:before {
- content: 'c';
+ content: 'c';
}
.editor-icon-copy:before {
- content: 'd';
+ content: 'd';
}
.editor-icon-paste:before {
- content: 'e';
+ content: 'e';
}
+
.editor-icon-delete:before {
- content: 'f';
+ content: 'f';
}
+
.editor-icon-redo:before {
- content: 'h';
+ content: 'h';
}
+
.editor-icon-undo:before {
- content: 'g';
+ content: 'g';
}
+
.editor-icon-same-size:before {
- content: 'i';
+ content: 'i';
}
+
.editor-icon-zoom-in:before {
- content: 'k';
+ content: 'k';
}
+
.editor-icon-zoom-out:before {
- content: 'l';
+ content: 'l';
}
+
.editor-icon-zoom-actual:before {
- content: 'm';
+ content: 'm';
}
+
.editor-icon-zoom-fit:before {
- content: 'j';
+ content: 'j';
}
+
.editor-icon-bendpoint-add:before {
- content: 'n';
+ content: 'n';
}
+
.editor-icon-bendpoint-remove:before {
- content: 'o';
+ content: 'o';
}
+
.editor-icon-align-horizontal:before {
- content: 'p';
+ content: 'p';
}
+
.editor-icon-align-vertical:before {
- content: 'q';
+ content: 'q';
}
+
.editor-icon-close:before {
content: "X";
}
diff --git a/pear-modules/pear-process/src/main/resources/static/editor-app/editor.html b/pear-modules/pear-process/src/main/resources/static/editor-app/editor.html
index 4680f138217fbac6bce650cefe02c469151adc11..9c5bb6bab1745f81b1ea8674528f81e40bd4e253 100644
--- a/pear-modules/pear-process/src/main/resources/static/editor-app/editor.html
+++ b/pear-modules/pear-process/src/main/resources/static/editor-app/editor.html
@@ -1,133 +1,143 @@
-