Merge branch 'develop' of git.mesalab.cn:galaxy/galaxy-service into develop
This commit is contained in:
39
db/20181225/add_event_report_table.sql
Normal file
39
db/20181225/add_event_report_table.sql
Normal file
@@ -0,0 +1,39 @@
|
||||
##新增统计表:
|
||||
##重点保障事件(时间粒度天): ntc_major_task_report
|
||||
CREATE TABLE `ntc_major_task_report` (
|
||||
`stat_id` int(11) NOT NULL AUTO_INCREMENT ,
|
||||
`task_id` int(20) NOT NULL ,
|
||||
`task_name` varchar(64) NOT NULL ,
|
||||
`letter_num` bigint(11) UNSIGNED NOT NULL DEFAULT 0 ,
|
||||
`config_num` bigint(11) UNSIGNED NOT NULL DEFAULT 0 ,
|
||||
`monitor_num` bigint(11) UNSIGNED NOT NULL DEFAULT 0 ,
|
||||
`control_num` bigint(11) UNSIGNED NOT NULL DEFAULT 0 ,
|
||||
`report_time` datetime NOT NULL ,
|
||||
`task_time` datetime NOT NULL ,
|
||||
PRIMARY KEY (`stat_id`),
|
||||
INDEX `IDX_MAJOR_TASK_REPORT_TIME` (`report_time`) USING BTREE
|
||||
)
|
||||
ENGINE=InnoDB
|
||||
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
|
||||
AUTO_INCREMENT=1
|
||||
ROW_FORMAT=DYNAMIC;
|
||||
##事件封堵、事件监测(时间粒度小时):ntc_task_report
|
||||
CREATE TABLE `ntc_task_report` (
|
||||
`stat_id` int(11) NOT NULL AUTO_INCREMENT ,
|
||||
`task_id` int(20) NOT NULL ,
|
||||
`task_name` varchar(64) NOT NULL ,
|
||||
`report_type` int(11) NOT NULL ,#1:事件封堵;2事件监测;
|
||||
`ip_num` bigint(20) UNSIGNED NOT NULL DEFAULT 0 ,
|
||||
`http_num` bigint(11) UNSIGNED NOT NULL DEFAULT 0 ,
|
||||
`mail_num` bigint(11) UNSIGNED NOT NULL DEFAULT 0 ,
|
||||
`vedio_num` bigint(11) UNSIGNED NOT NULL DEFAULT 0 ,
|
||||
`agent_num` bigint(11) UNSIGNED NOT NULL DEFAULT 0 ,
|
||||
`report_time` datetime NOT NULL ,
|
||||
`task_time` datetime NOT NULL ,
|
||||
PRIMARY KEY (`stat_id`),
|
||||
INDEX `IDX_TASK_REPORT_TIME` (`report_time`) USING BTREE
|
||||
)
|
||||
ENGINE=InnoDB
|
||||
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
|
||||
AUTO_INCREMENT=1
|
||||
ROW_FORMAT=DYNAMIC;
|
||||
@@ -307,4 +307,51 @@ CREATE TABLE `ui_http_url_cfg` (
|
||||
`user_region4` varchar(1024) DEFAULT '' COMMENT '预留自定义域4',
|
||||
`user_region5` varchar(1024) DEFAULT '' COMMENT '预留自定义域5',
|
||||
PRIMARY KEY (`cfg_id`)
|
||||
) ENGINE=FEDERATED AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 CONNECTION='mysql://root:111111@10.0.4.6:3306/ntc_db/http_url_cfg';
|
||||
) ENGINE=FEDERATED AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 CONNECTION='mysql://root:111111@10.0.4.6:3306/ntc_db/http_url_cfg';
|
||||
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `remote_nms_di_rule`;
|
||||
CREATE TABLE `di_rule` (
|
||||
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`dete `ServiceIndex` bigint(20) NULL DEFAULT NULL,
|
||||
ction_info_id` bigint(20) NOT NULL,
|
||||
`ServiceCode` bigint(20) NULL DEFAULT NULL,
|
||||
`ServiceDesc` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`agedTime` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`ClientNum` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`RefluxPort` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`RuleNumber` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`usedRuleNum` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`leftRuleNum` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`HitTotalNum` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`DETECTIONED_STATE` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`SEQ_ID` int(11) NULL DEFAULT NULL,
|
||||
`DETECTION_SET_INFO_ID` bigint(20) NULL DEFAULT NULL,
|
||||
`data_check_time` datetime(0) NOT NULL,
|
||||
`data_arrive_time` datetime(0) NULL DEFAULT NULL,
|
||||
`data_check_time_digital` bigint(20) NULL DEFAULT NULL,
|
||||
`data_arrive_time_digital` bigint(20) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`ID`, `data_check_time`) USING BTREE,
|
||||
INDEX `DI_SUGON_RULE_1`(`data_check_time`) USING BTREE,
|
||||
INDEX `DI_SUGON_RULE_2`(`SEQ_ID`) USING BTREE,
|
||||
INDEX `DI_SUGON_RULE_3`(`DETECTION_SET_INFO_ID`) USING BTREE,
|
||||
INDEX `index_DI_RULE_DETECTION_INFO_ID`(`detection_info_id`) USING BTREE
|
||||
) ENGINE=FEDERATED AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 CONNECTION='mysql://root:111111@10.0.4.223:3306/nms/di_rule';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.Map;
|
||||
* @data 2018/12/24 15:21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("${servicePath}")
|
||||
@RequestMapping("${servicePath}/log/v1")
|
||||
@Api(value = "EventInfoController", description = "事件封堵、监测、保障接口")
|
||||
@SuppressWarnings("all")
|
||||
public class EventInfoController extends BaseRestController {
|
||||
@@ -37,7 +37,7 @@ public class EventInfoController extends BaseRestController {
|
||||
@Autowired
|
||||
EventService eventService;
|
||||
|
||||
@RequestMapping(value = "/log/v1/ntcEventKeyProtection", method = RequestMethod.GET)
|
||||
@RequestMapping(value = "/ntcEventKeyProtection", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "重点保障事件总览", httpMethod = "GET", notes = "获取重点保障事件信息", response = Map.class)
|
||||
public Map<String, ?> getEventKeyProtection(EventKeyProtection eventKeyProtection, HttpServletRequest request, HttpServletResponse response) {
|
||||
long start = System.currentTimeMillis();
|
||||
@@ -61,7 +61,7 @@ public class EventInfoController extends BaseRestController {
|
||||
eventKeyProtectionPage, 0);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/log/v1/ntcEventsMonitorOrBlock", method = RequestMethod.GET)
|
||||
@RequestMapping(value = "/ntcEventsMonitorOrBlock", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "事件监测、封堵", httpMethod = "GET", notes = "获取事件监测、封堵信息", response = Map.class)
|
||||
public Map<String, ?> getEventsMonitorOrBlock(EventMonitorOrBlock eventMonitorOrBlock, HttpServletRequest request, HttpServletResponse response) {
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
@@ -61,17 +61,17 @@ public class EventService {
|
||||
}catch(Exception ex){
|
||||
logger.error("时间参数处理转换异常,{}", ex);
|
||||
String rangeOfday = CalendarUtils.getRangeOfday(DateUtils.getDateTime());
|
||||
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24);
|
||||
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24*30);
|
||||
eventKeyProtection = new EventKeyProtection();
|
||||
eventKeyProtection.setSearchReportStartTime(startTemp);
|
||||
logger.info("获取重点保障事件API请求参数转换异常,默认查询昨天"+startTemp+"至今数据");
|
||||
logger.info("获取重点保障事件API请求参数转换异常,默认查询起始时间"+startTemp+"至今数据");
|
||||
}
|
||||
if(countParamEmpty == 6){
|
||||
if(countParamEmpty == 5){
|
||||
String rangeOfday = CalendarUtils.getRangeOfday(DateUtils.getDateTime());
|
||||
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24);
|
||||
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24*30);
|
||||
eventKeyProtection = new EventKeyProtection();
|
||||
eventKeyProtection.setSearchReportStartTime(startTemp);
|
||||
logger.info("获取重点保障事件API请求参数为空,默认查询昨天"+startTemp+"至今数据");
|
||||
logger.info("获取重点保障事件API请求参数为空,默认查询起始时间"+startTemp+"至今数据");
|
||||
}
|
||||
try {
|
||||
list = eventServiceDao.getEventsKeyProtection(eventKeyProtection);
|
||||
@@ -117,21 +117,21 @@ public class EventService {
|
||||
}catch(Exception ex){
|
||||
logger.error("时间参数处理转换异常,{}", ex);
|
||||
String rangeNhourOfTime = CalendarUtils.getRangeOfhour(DateUtils.getDateTime());
|
||||
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -1);
|
||||
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -24);
|
||||
int typeId = eventMonitorOrBlock.getReportType();
|
||||
eventMonitorOrBlock = new EventMonitorOrBlock();
|
||||
eventMonitorOrBlock.setSearchReportStartTime(startTemp);
|
||||
eventMonitorOrBlock.setReportType(typeId);
|
||||
logger.info("获取"+logMark+"API请求参数转换异常,默认查询上一小时"+startTemp+"到现在的数据");
|
||||
logger.info("获取"+logMark+"API请求参数转换异常,默认查询起始时间"+startTemp+"到现在的数据");
|
||||
}
|
||||
if(countParamEmpty==6){
|
||||
if(countParamEmpty==5){
|
||||
String rangeNhourOfTime = CalendarUtils.getRangeOfhour(DateUtils.getDateTime());
|
||||
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -1);
|
||||
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -24);
|
||||
int typeId = eventMonitorOrBlock.getReportType();
|
||||
eventMonitorOrBlock = new EventMonitorOrBlock();
|
||||
eventMonitorOrBlock.setSearchReportStartTime(startTemp);
|
||||
eventMonitorOrBlock.setReportType(typeId);
|
||||
logger.info("获取"+logMark+"API请求参数为空,默认查询上一小时"+startTemp+"到现在的数据");
|
||||
logger.info("获取"+logMark+"API请求参数为空,默认查询起始时间"+startTemp+"到现在的数据");
|
||||
}
|
||||
try {
|
||||
list = eventServiceDao.getEventsMonitorOrBlock(eventMonitorOrBlock);
|
||||
|
||||
Reference in New Issue
Block a user