From e2b7692dd4458cd86cdb8ad6555a1a6955773f80 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Mon, 12 Nov 2018 18:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=93=E5=AD=98=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E7=9B=B8=E5=85=B3=E8=A1=A8=E3=80=81=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E3=80=81=E8=8F=9C=E5=8D=95=E7=AD=89=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/sql/20181112/add_cache_policy | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 src/main/resources/sql/20181112/add_cache_policy diff --git a/src/main/resources/sql/20181112/add_cache_policy b/src/main/resources/sql/20181112/add_cache_policy new file mode 100644 index 000000000..e35ff0b01 --- /dev/null +++ b/src/main/resources/sql/20181112/add_cache_policy @@ -0,0 +1,112 @@ +drop table IF EXISTS `common_keyword_cfg` ; +CREATE TABLE `common_keyword_cfg` ( + `cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `cfg_desc` varchar(128) DEFAULT NULL, + `replace_content` varchar(500) DEFAULT NULL COMMENT '替换内容, action为replace时填写', + `cfg_keywords` varchar(2048) NOT NULL COMMENT '对应maat规范的字符串表keywords字段', + `action` int(11) NOT NULL COMMENT '1:阻断,2:监测, 5: FD 白名单,6:监测白名单,7: FD 监测都白名单,应与业务ID所代表的逻辑相匹配,8-灰名单', + `is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除;1) 未审核时配置可删除;2) 审核通过,此字段置1;3) 取消审核通过,此字段置0', + `is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过;1) 审核未通过,配置可修改;2) 审核通过,配置不可删除,只能取消审核通过', + `creator_id` int(11) NOT NULL COMMENT '取自sys_user.id', + `create_time` datetime NOT NULL, + `editor_id` int(11) DEFAULT NULL COMMENT '取自sys_user.id', + `edit_time` datetime DEFAULT NULL, + `auditor_id` int(11) DEFAULT NULL COMMENT '取自sys_user.id', + `audit_time` datetime DEFAULT NULL, + `service_id` int(11) NOT NULL COMMENT '参考系统业务类型管理表', + `request_id` int(11) NOT NULL COMMENT '取自request_info.id', + `compile_id` int(11) NOT NULL COMMENT '取自服务接口返回的maat配置的编译id,配置初始入库时获取。', + `is_area_effective` int(11) NOT NULL COMMENT '0否,1是', + `classify` varchar(128) DEFAULT NULL COMMENT '分类id,多个用英文逗号分隔', + `attribute` varchar(128) DEFAULT NULL COMMENT '性质id,多个用英文逗号分隔', + `lable` varchar(128) DEFAULT NULL COMMENT '标签id,多个用英文逗号分隔', + `expr_type` int(11) NOT NULL COMMENT '0:无表达式,1:与表达式', + `match_method` int(11) NOT NULL COMMENT 'expr_type:0时有意义,其它情况必须置0。0:子串匹配;1:右匹配;2:左匹配;3:完全匹配', + `is_hexbin` int(11) NOT NULL COMMENT '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX', + `area_effective_ids` varchar(1024) DEFAULT NULL COMMENT '多个英文逗号分隔', + `function_id` int(11) DEFAULT NULL, + `cfg_region_code` int(11) DEFAULT NULL, + `cfg_type` varchar(64) DEFAULT NULL, + `user_region1` varchar(1024) DEFAULT NULL COMMENT '预留自定义域1', + `user_region2` varchar(1024) DEFAULT NULL COMMENT '预留自定义域2', + `user_region3` varchar(1024) DEFAULT NULL COMMENT '预留自定义域3', + `user_region4` varchar(1024) DEFAULT NULL COMMENT '预留自定义域4', + `user_region5` varchar(1024) DEFAULT NULL COMMENT '预留自定义域5', + PRIMARY KEY (`cfg_id`), + UNIQUE KEY `pk_cfg_index_id` (`cfg_id`) USING BTREE, + KEY `cfg_index_compileId` (`compile_id`) USING BTREE, + KEY `cfg_index_functionId` (`function_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COMMENT='通用字符串类配置'; +drop table IF EXISTS `complex_keyword_cfg`; +CREATE TABLE `complex_keyword_cfg` ( + `cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `cfg_desc` varchar(128) DEFAULT NULL, + `district` varchar(128) DEFAULT NULL, + `keywords` varchar(2048) NOT NULL, + `action` int(11) NOT NULL COMMENT '1:阻断,2:监测, 5: FD 白名单,6:监测白名单,7: FD 监测都白名单,应与业务ID所代表的逻辑相匹配,8-灰名单', + `is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除;1) 未审核时配置可删除;2) 审核通过,此字段置1;3) 取消审核通过,此字段置0', + `is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过;1) 审核未通过,配置可修改;2) 审核通过,配置不可删除,只能取消审核通过', + `creator_id` int(11) NOT NULL COMMENT '取自sys_user.id', + `create_time` datetime NOT NULL, + `editor_id` int(11) DEFAULT NULL COMMENT '取自sys_user.id', + `edit_time` datetime DEFAULT NULL, + `auditor_id` int(11) DEFAULT NULL COMMENT '取自sys_user.id', + `audit_time` datetime DEFAULT NULL, + `service_id` int(11) NOT NULL COMMENT '参考系统业务类型管理表', + `request_id` int(11) NOT NULL COMMENT '取自request_info.id', + `compile_id` int(11) NOT NULL COMMENT '取自服务接口返回的maat配置的编译id,配置初始入库时获取。', + `is_area_effective` int(11) NOT NULL COMMENT '0否,1是', + `classify` varchar(128) DEFAULT NULL COMMENT '分类id,多个用英文逗号分隔', + `attribute` varchar(128) DEFAULT NULL COMMENT '性质id,多个用英文逗号分隔', + `lable` varchar(128) DEFAULT NULL COMMENT '标签id,多个用英文逗号分隔', + `expr_type` int(11) NOT NULL COMMENT '0:无表达式,1:与表达式', + `match_method` int(11) NOT NULL COMMENT 'expr_type:0时有意义,其它情况必须置0。0:子串匹配;1:右匹配;2:左匹配;3:完全匹配', + `is_hexbin` int(11) NOT NULL COMMENT '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX', + `area_effective_ids` varchar(1024) DEFAULT NULL COMMENT '多个英文逗号分隔', + `cfg_type` varbinary(64) DEFAULT NULL COMMENT '内容类型', + `function_id` int(11) NOT NULL COMMENT '菜单ID', + `cfg_region_code` int(11) DEFAULT NULL, + `user_region1` varchar(1024) DEFAULT '' COMMENT '预留自定义域1', + `user_region2` varchar(1024) DEFAULT '' COMMENT '预留自定义域2', + `user_region3` varchar(1024) DEFAULT '' COMMENT '预留自定义域3', + `user_region4` varchar(1024) DEFAULT '' COMMENT '预留自定义域4', + `user_region5` varchar(1024) DEFAULT '' COMMENT '预留自定义域5', + PRIMARY KEY (`cfg_id`), + UNIQUE KEY `pk_cfg_index_id` (`cfg_id`) USING BTREE, + KEY `cfg_index_compileId` (`compile_id`) USING BTREE, + KEY `cfg_index_functionId` (`function_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通用增强字符串配置'; + +#增加缓存相关字典 +INSERT INTO `sys_data_dictionary_name` (`id`, `module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ('130', '缓存算法', 'CACHE_KEY', '', '', '2018-11-12 10:25:57', '2018-11-12 10:25:57', '1'); +INSERT INTO `sys_data_dictionary_name` (`id`, `module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ('131', '缓存验证', 'CACHE_NO_REVALIDATE', '', '', '2018-11-12 11:12:55', '2018-11-12 11:12:55', '1'); +INSERT INTO `sys_data_dictionary_name` (`id`, `module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ('132', '缓存动态URL', 'CACHE_DYN_URL', '', '', '2018-11-12 11:14:35', '2018-11-12 11:14:35', '1'); +INSERT INTO `sys_data_dictionary_name` (`id`, `module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ('133', '缓存cookie内容', 'CACHE_COOKIED_CONT', '', 'user:管理员,2018-11-12 11:16:04edit', '2018-11-12 11:15:46', '2018-11-12 11:16:04', '1'); +INSERT INTO `sys_data_dictionary_name` (`id`, `module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ('134', '忽略请求头不缓存', 'IGNORE_REQ_NOCACHE', '', '', '2018-11-12 11:18:09', '2018-11-12 11:18:09', '1'); +INSERT INTO `sys_data_dictionary_name` (`id`, `module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ('135', '忽略响应头不缓存', 'IGNORE_RES_NOCACHE', '', '', '2018-11-12 11:22:42', '2018-11-12 11:22:42', '1'); +INSERT INTO `sys_data_dictionary_name` (`id`, `module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ('136', '强制缓存', 'FORCE_CACHING', '', '', '2018-11-12 11:23:51', '2018-11-12 11:23:51', '1'); + +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('2992', 'ignore_query_string', 'ignore_query_string', '', '0', '1', '1', '130'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('2993', 'include_cookie', 'include_cookie', '', '0', '1', '1', '130'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('2994', '0', 'no', '', '0', '1', '1', '131'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('2995', '1', 'yes', '', '0', '1', '1', '131'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('2996', '0', 'no', '', '0', '1', '1', '132'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('2997', '1', 'yes', '', '0', '1', '1', '132'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3000', '0', 'no', '', '0', '1', '1', '133'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3001', '1', 'yes', '', '0', '1', '1', '133'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3002', '0', 'no', '', '0', '1', '1', '134'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3003', '1', 'yes', '', '0', '1', '1', '134'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3004', '0', 'no', '', '0', '1', '1', '135'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3005', '1', 'yes', '', '0', '1', '1', '135'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3006', '0', 'no', '', '0', '1', '1', '136'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3007', '1', 'yes', '', '0', '1', '1', '136'); + +#增加缓存功能业务字典 +INSERT INTO `function_service_dict` (`dict_id`, `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`) VALUES ('154', '213', '0', '48', 'cache', '625', 'proxy_cache_policy_redirect', NULL, '1', NULL, '2018-11-08 11:14:30', NULL, '2018-11-08 11:14:33', '2', '0'); +INSERT INTO `function_service_dict` (`dict_id`, `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`) VALUES ('155', '213', '0', '128', 'cache_whitelist', '624', 'proxy_cache_policy_whitelist', NULL, '1', NULL, '2018-11-08 11:16:18', NULL, '2018-11-08 11:16:23', NULL, '0'); +INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('604', '213', NULL, '1', 'PXY_CACHE_HTTP_URL', '代理缓存URL配置', '1', '1', '2', NULL, '2018-11-08 11:20:31', NULL, '2018-11-08 11:20:33', '', '0,1', '0,1,2,3', NULL, '0,1,2', '1', NULL, NULL, NULL, NULL, NULL, '1', '0'); +INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('605', '213', NULL, '2', 'PXY_CACHE_HTTP_COOKIE', '代理缓存cookie配置', '1', '1', '2', NULL, '2018-11-08 11:22:00', NULL, '2018-11-08 11:22:04', '', '0,1', '0,1,2,3', NULL, '0,1,2', '1', NULL, NULL, NULL, NULL, NULL, '2', '0'); +#增加缓存功能菜单 +INSERT INTO `sys_menu` (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('1161', '719', '0,1,86,719,', 'cache_policy', '缓存策略', '90', '/proxy/cache/list', '', '', '1', 'cache:policy:config', '1', '2018-11-08 11:27:45', '1', '2018-11-08 11:27:45', '', '1', NULL, '0', '0', '213'); +INSERT INTO `sys_menu` (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('1162', '748', '0,1,150,748,', 'cache_policy', '缓存策略', '90', '/proxy/cache/list', '', '', '1', 'cache:policy:confirm', '1', '2018-11-08 11:28:43', '1', '2018-11-08 11:28:43', '', '1', NULL, '0', '0', '213'); +INSERT INTO `sys_menu` (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('1163', '850', '0,1,151,850,', 'cache_policy', '缓存策略', '90', '/proxy/cache/list', '', '', '1', '', '1', '2018-11-08 11:29:26', '1', '2018-11-08 11:29:26', '', '1', NULL, '0', '0', '213');