summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortanghao <[email protected]>2023-10-20 16:00:39 +0800
committertanghao <[email protected]>2023-10-20 16:00:39 +0800
commit18240b5c8e2085dd4426522afd8c121744a3b1e6 (patch)
tree2340330449327887278343b8854112a2da196889
parent40e0a9adabff9cc97e8cb2033d2d9d0805287db0 (diff)
fix: 补充提交
-rw-r--r--cn-admin/src/main/resources/db/R__AZ_magic_api_file.sql3
1 files changed, 3 insertions, 0 deletions
diff --git a/cn-admin/src/main/resources/db/R__AZ_magic_api_file.sql b/cn-admin/src/main/resources/db/R__AZ_magic_api_file.sql
index 2fbe82e..8fd6eae 100644
--- a/cn-admin/src/main/resources/db/R__AZ_magic_api_file.sql
+++ b/cn-admin/src/main/resources/db/R__AZ_magic_api_file.sql
@@ -705,6 +705,9 @@ INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/', 't
INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/', 'this is directory');
INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/group.json', '{\r\n \"properties\" : { },\r\n \"id\" : \"3800301a02724b26862153234522639e\",\r\n \"name\" : \"detection\",\r\n \"type\" : \"api\",\r\n \"parentId\" : \"67d55368d07840ca80c04d7ade154d76\",\r\n \"path\" : \"/detection\",\r\n \"createTime\" : null,\r\n \"updateTime\" : 1697773570065,\r\n \"createBy\" : null,\r\n \"updateBy\" : \"admin\",\r\n \"paths\" : [ ],\r\n \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/', 'this is directory');
+INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/event-type/', 'this is directory');
+INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/event-type/group.json', '{\r\n \"properties\" : { },\r\n \"id\" : \"22559230d05249c985871ca0970b2c19\",\r\n \"name\" : \"event-type\",\r\n \"type\" : \"api\",\r\n \"parentId\" : \"de526fab02d442ccbbee9790c3c7f53d\",\r\n \"path\" : \"/event-type\",\r\n \"createTime\" : 1697788521033,\r\n \"updateTime\" : null,\r\n \"createBy\" : \"admin\",\r\n \"updateBy\" : null,\r\n \"paths\" : [ ],\r\n \"options\" : [ ]\r\n}');
+INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/event-type/事件类型统计.ms', '{\r\n \"properties\" : { },\r\n \"id\" : \"55072da8705c44ac9ae61cce5c6e9491\",\r\n \"script\" : null,\r\n \"groupId\" : \"22559230d05249c985871ca0970b2c19\",\r\n \"name\" : \"事件类型统计\",\r\n \"createTime\" : null,\r\n \"updateTime\" : 1697788718863,\r\n \"lock\" : null,\r\n \"createBy\" : null,\r\n \"updateBy\" : \"admin\",\r\n \"path\" : \"/statistics\",\r\n \"method\" : \"GET\",\r\n \"parameters\" : [ {\r\n \"name\" : \"startTime\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"String\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"endTime\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"String\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"resource\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : false,\r\n \"dataType\" : \"String\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n } ],\r\n \"options\" : [ ],\r\n \"requestBody\" : \"\",\r\n \"headers\" : [ ],\r\n \"paths\" : [ ],\r\n \"responseBody\" : null,\r\n \"description\" : null,\r\n \"requestBodyDefinition\" : null,\r\n \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport net.geedge.common.utils.FreeMarkerUtil as freeMarkerUtil;\r\nimport net.geedge.common.utils.JSONUtil as jsonUtil;\r\nimport \'@/pre/timeHandle\' as preHandle;\r\nimport \'@/post/table\' as postHandle;\r\nimport \'@/public/getGalaxyResult\' as getGalaxyResult;\r\n\r\n\r\n/**\r\n * 入参整理 包括调用公共函数\r\n */\r\nvar parameter={\r\n \"startTime\":startTime,\r\n \"endTime\":endTime,\r\n \"resource\":resource\r\n}\r\npreHandle(parameter);\r\n\r\n/**\r\n * 接口sql相关内容整理 通过freemarker模板生成最后执行语句\r\n */\r\nvar q = \"{\\\"query\\\": \\\"SELECT event_type AS event_type,COUNT(*) AS count FROM cn_security_event WHERE start_time >= ${startTime} AND start_time < ${endTime} <#if resource?default(\'\')?trim? length gt 0> AND ${resource} </#if> GROUP BY event_type ORDER BY count DESC\\\",\\\"option\\\": \\\"real-time\\\",\\\"format\\\": \\\"json\\\"}\"\r\nvar result = freeMarkerUtil.processTemplateIntoString(\"detectionSecurityList\",q,parameter);\r\n\r\n/**\r\n * 调用galaxy接口获取结果信息\r\n */\r\nvar res = jsonUtil.toBean(result,HashMap.class);\r\nvar galaxyRes = getGalaxyResult(res);\r\n\r\n/**\r\n * 处理galaxy返回的数据结果 将新结果返回前端界面\r\n */\r\nvar result = postHandle(galaxyRes);\r\nprintln(jsonUtil.toJsonStr(galaxyRes));\r\n\r\nreturn result;');
INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/group.json', '{\r\n \"properties\" : { },\r\n \"id\" : \"de526fab02d442ccbbee9790c3c7f53d\",\r\n \"name\" : \"security\",\r\n \"type\" : \"api\",\r\n \"parentId\" : \"3800301a02724b26862153234522639e\",\r\n \"path\" : \"/security\",\r\n \"createTime\" : 1697771295126,\r\n \"updateTime\" : null,\r\n \"createBy\" : \"admin\",\r\n \"updateBy\" : null,\r\n \"paths\" : [ ],\r\n \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/ip/', 'this is directory');
INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/ip/group.json', '{\r\n \"properties\" : { },\r\n \"id\" : \"e699fff78465455bb7db22fdb86a13be\",\r\n \"name\" : \"ip\",\r\n \"type\" : \"api\",\r\n \"parentId\" : \"de526fab02d442ccbbee9790c3c7f53d\",\r\n \"path\" : \"/ip\",\r\n \"createTime\" : 1697782216471,\r\n \"updateTime\" : null,\r\n \"createBy\" : \"admin\",\r\n \"updateBy\" : null,\r\n \"paths\" : [ ],\r\n \"options\" : [ ]\r\n}');