ref: v3变更,,表结构变更coreId/neId
This commit is contained in:
@@ -4,14 +4,13 @@
|
||||
DROP TABLE IF EXISTS `alarm`;
|
||||
CREATE TABLE `alarm` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`alarm_seq` int DEFAULT '0' COMMENT '告警序号 同网元类型连续递增',
|
||||
`alarm_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '告警ID',
|
||||
`alarm_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警标题',
|
||||
`alarm_code` int DEFAULT '0' COMMENT '告警状态码',
|
||||
`event_time` bigint DEFAULT '0' COMMENT '事件产生时间',
|
||||
`event_time` bigint DEFAULT '0' COMMENT '产生时间',
|
||||
`alarm_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警类型',
|
||||
`orig_severity` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Minor' COMMENT '严重程度',
|
||||
`perceived_severity` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Minor' COMMENT '告警级别',
|
||||
@@ -29,9 +28,7 @@ CREATE TABLE `alarm` (
|
||||
`clear_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'NotClear' COMMENT '清除状态',
|
||||
`clear_time` bigint DEFAULT '0' COMMENT '清除时间',
|
||||
`clear_user` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '清除用户',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_alarm_aid_aseq_atype` (`ne_uid`, `alarm_id`, `alarm_seq`, `alarm_type`) USING BTREE COMMENT '唯一网元资源产生的ID与序号与状态',
|
||||
KEY `idx_alarm_status_severity_time` (`alarm_status`,`orig_severity`,`event_time`) USING BTREE COMMENT '索引-告警状态_告警级别_事件时间',
|
||||
KEY `idx_alarm_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
UNIQUE KEY `uk_alarm_aid_aseq_atype` (`ne_id`, `alarm_id`, `alarm_seq`, `alarm_type`) USING BTREE COMMENT '唯一网元资源产生的ID与序号与状态',
|
||||
KEY `idx_alarm_status_severity_time` (`alarm_status`,`orig_severity`,`event_time`) USING BTREE COMMENT '索引-告警状态_告警级别_事件时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='告警_记录表';
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
DROP TABLE IF EXISTS `alarm_event`;
|
||||
CREATE TABLE `alarm_event` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`alarm_seq` int DEFAULT '0' COMMENT '告警序号 同网元类型连续递增',
|
||||
`alarm_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '告警ID',
|
||||
`alarm_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警标题',
|
||||
@@ -23,11 +22,9 @@ CREATE TABLE `alarm_event` (
|
||||
`clear_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'NotClear' COMMENT '清除状态',
|
||||
`clear_time` bigint DEFAULT '0' COMMENT '清除时间',
|
||||
`clear_user` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '清除用户',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_aevent_aid_aseq` (`ne_uid`, `alarm_id`, `alarm_seq`) USING BTREE COMMENT '唯一网元资源产生的ID与序号与状态',
|
||||
KEY `idx_aevent_status_etime` (`alarm_status`,`event_time`) USING BTREE COMMENT '索引-告警状态_事件时间',
|
||||
KEY `idx_alarm_event_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
UNIQUE KEY `uk_aevent_ne_aid_aseq` (`ne_id`, `alarm_id`, `alarm_seq`) USING BTREE COMMENT '唯一网元资源产生的ID与序号与状态',
|
||||
KEY `idx_aevent_status_etime` (`alarm_status`,`event_time`) USING BTREE COMMENT '索引-告警状态_事件时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='告警_事件记录表';
|
||||
|
||||
-- Dump completed on 2025-02-14 15:26:56
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
DROP TABLE IF EXISTS `alarm_forward_log`;
|
||||
CREATE TABLE `alarm_forward_log` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`alarm_seq` int DEFAULT '0' COMMENT '告警序号 同网元类型连续递增',
|
||||
`alarm_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警ID',
|
||||
`alarm_code` int DEFAULT '0' COMMENT '告警状态码',
|
||||
@@ -15,13 +14,12 @@ CREATE TABLE `alarm_forward_log` (
|
||||
`alarm_status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Active' COMMENT '告警状态',
|
||||
`alarm_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警类型',
|
||||
`orig_severity` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Minor' COMMENT '严重程度 ',
|
||||
`event_time` bigint DEFAULT '0' COMMENT '事件产生时间',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`event_time` bigint DEFAULT '0' COMMENT '产生时间',
|
||||
`type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '转发方式 SMS/EMAIL',
|
||||
`target` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '发送目标用户',
|
||||
`result` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '发送结果',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_alarm_forward_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_alarm_forward_ne_id_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='告警_转发日志记录';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
DROP TABLE IF EXISTS `alarm_log`;
|
||||
CREATE TABLE `alarm_log` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`alarm_seq` int DEFAULT '0' COMMENT '告警序号 同网元类型连续递增',
|
||||
`alarm_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警ID',
|
||||
`alarm_code` int DEFAULT '0' COMMENT '告警状态码',
|
||||
@@ -15,10 +14,9 @@ CREATE TABLE `alarm_log` (
|
||||
`alarm_status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Active' COMMENT '告警状态',
|
||||
`alarm_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警类型',
|
||||
`orig_severity` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Minor' COMMENT '严重程度',
|
||||
`event_time` bigint DEFAULT '0' COMMENT '事件产生时间',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`event_time` bigint DEFAULT '0' COMMENT '产生时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_alog_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_alog_ne_id_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='告警_日志记录';
|
||||
|
||||
-- Dump completed on 2024-02-18 18:26:55
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for cdr_event
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `cdr_event`;
|
||||
CREATE TABLE `cdr_event` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`timestamp` bigint DEFAULT '0' COMMENT '接收到的timestamp秒级存储毫秒时间戳',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`cdr_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_cdr_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_cdr_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='CDR事件_基础表结构';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for cdr_event_ims
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `cdr_event_ims`;
|
||||
CREATE TABLE `cdr_event_ims` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`timestamp` bigint DEFAULT '0' COMMENT '接收到的timestamp秒级存储毫秒时间戳',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`cdr_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_cdr_ims_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_cdr_ims_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='CDR事件_IMS';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for cdr_event_sgwc
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `cdr_event_sgwc`;
|
||||
CREATE TABLE `cdr_event_sgwc` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`timestamp` bigint DEFAULT '0' COMMENT '接收到的timestamp秒级存储毫秒时间戳',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`cdr_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_cdr_sgwc_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_cdr_sgwc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='CDR事件_SGWC';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for cdr_event_smf
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `cdr_event_smf`;
|
||||
CREATE TABLE `cdr_event_smf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`timestamp` bigint DEFAULT '0' COMMENT '接收到的timestamp秒级存储毫秒时间戳',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`cdr_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_cdr_smf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_cdr_smf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='CDR事件_SMF';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for cdr_event_smsc
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `cdr_event_smsc`;
|
||||
CREATE TABLE `cdr_event_smsc` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`timestamp` bigint DEFAULT '0' COMMENT '接收到的timestamp秒级存储毫秒时间戳',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`cdr_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_cdr_smsc_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_cdr_smsc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='CDR事件_SMSC';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
@@ -17,13 +17,12 @@ CREATE TABLE `core_info` (
|
||||
`create_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` bigint DEFAULT '0' COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_core_name_sn` (`name`,`sn`) USING BTREE COMMENT '唯一名称和序号定义'
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='核心网_基础信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of core_info
|
||||
-- ----------------------------
|
||||
INSERT INTO `core_info` VALUES (1, 'YYMMDDHH', 'Default', '12345678', 'Omachine', '', 0, 0, '', '', 'admin', 1755863386664, 'admin', 1755863386664);
|
||||
INSERT INTO `core_info` VALUES (1, 'YYMMDDHH', 'Global', '12345678', '12345678', '', 0, 0, '', '', 'admin', 1755863386664, 'admin', 1755863386664);
|
||||
|
||||
-- Dump completed on 2025-06-04 15:26:56
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kpi_c_report
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kpi_c_report`;
|
||||
CREATE TABLE `kpi_c_report` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据记录基础表结构';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
KEY `idx_kpic_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据记录基础表';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_amf`;
|
||||
CREATE TABLE `kpi_c_report_amf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_amf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_amf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_AMF';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_ausf`;
|
||||
CREATE TABLE `kpi_c_report_ausf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_ausf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_ausf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_AUSF';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_cbc`;
|
||||
CREATE TABLE `kpi_c_report_cbc` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_cbc_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_cbc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_CBC';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_hlr`;
|
||||
CREATE TABLE `kpi_c_report_hlr` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_hlr_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_hlr_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_HLR';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_ims`;
|
||||
CREATE TABLE `kpi_c_report_ims` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_ims_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_ims_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_IMS';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_mme`;
|
||||
CREATE TABLE `kpi_c_report_mme` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_mme_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_mme_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_MME';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_mocngw`;
|
||||
CREATE TABLE `kpi_c_report_mocngw` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_mocngw_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_mocngw_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_MOCNGW';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_nssf`;
|
||||
CREATE TABLE `kpi_c_report_nssf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_nssf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_nssf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_NSSF';
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for kpi_c_report_pcf
|
||||
-- Table structure for kpi_c_report
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kpi_c_report_pcf`;
|
||||
CREATE TABLE `kpi_c_report_pcf` (
|
||||
DROP TABLE IF EXISTS `kpi_c_report`;
|
||||
CREATE TABLE `kpi_c_report` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_pcf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_PCF';
|
||||
KEY `idx_kpic_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据记录基础表';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_smf`;
|
||||
CREATE TABLE `kpi_c_report_smf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_smf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_smf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_SMF';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_smsc`;
|
||||
CREATE TABLE `kpi_c_report_smsc` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_smsc_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_smsc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_SMSC';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_udm`;
|
||||
CREATE TABLE `kpi_c_report_udm` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_udm_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_udm_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_UDM';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_c_report_upf`;
|
||||
CREATE TABLE `kpi_c_report_upf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpic_upf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_创建时间'
|
||||
KEY `idx_kpic_upf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_UPF';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report`;
|
||||
CREATE TABLE `kpi_report` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据记录基础表';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_amf`;
|
||||
CREATE TABLE `kpi_report_amf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_amf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_amf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_AMF';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_ausf`;
|
||||
CREATE TABLE `kpi_report_ausf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_ausf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_ausf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_AUSF';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_cbc`;
|
||||
CREATE TABLE `kpi_report_cbc` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_cbc_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_cbc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_CBC';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_hlr`;
|
||||
CREATE TABLE `kpi_report_hlr` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_hlr_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_hlr_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_HLR';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_ims`;
|
||||
CREATE TABLE `kpi_report_ims` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_ims_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_ims_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_IMS';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_mme`;
|
||||
CREATE TABLE `kpi_report_mme` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_mme_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_mme_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_MME';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_mocngw`;
|
||||
CREATE TABLE `kpi_report_mocngw` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_mocngw_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_mocngw_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_MOCNGW';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_nssf`;
|
||||
CREATE TABLE `kpi_report_nssf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_nssf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_nssf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_NSSF';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_pcf`;
|
||||
CREATE TABLE `kpi_report_pcf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_pcf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_pcf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_PCF';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_smf`;
|
||||
CREATE TABLE `kpi_report_smf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_smf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_smf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_SMF';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_smsc`;
|
||||
CREATE TABLE `kpi_report_smsc` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_smsc_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_smsc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_SMSC';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_udm`;
|
||||
CREATE TABLE `kpi_report_udm` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_udm_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_udm_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_UDM';
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
DROP TABLE IF EXISTS `kpi_report_upf`;
|
||||
CREATE TABLE `kpi_report_upf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_kpi_upf_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `created_at` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_kpi_upf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_UPF';
|
||||
|
||||
@@ -5,15 +5,12 @@
|
||||
DROP TABLE IF EXISTS `mml_log`;
|
||||
CREATE TABLE `mml_log` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`user` varchar(32) DEFAULT NULL,
|
||||
`ip` varchar(64) DEFAULT NULL,
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
|
||||
`create_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`command` varchar(512) DEFAULT NULL COMMENT '命令 ; 分隔',
|
||||
`result` varchar(255) DEFAULT NULL COMMENT '成功和有错误',
|
||||
`log_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||
|
||||
-- Dump completed on 2024-03-06 17:26:56
|
||||
-- Dump completed on 2025-09-11 17:26:56
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
DROP TABLE IF EXISTS `nb_state`;
|
||||
CREATE TABLE `nb_state` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`create_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '基站IP地址',
|
||||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '基站名称',
|
||||
@@ -15,5 +13,5 @@ CREATE TABLE `nb_state` (
|
||||
`state` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'OFF' COMMENT '基站状态 OFF ON',
|
||||
`time` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '状态时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_nbst_cn_uid_at` (`core_uid` DESC, `ne_uid` DESC, `ne_type` DESC, `create_time` DESC) USING BTREE COMMENT '索引-核心网_资源标识_记录时间'
|
||||
KEY `idx_nbst_ne_at` (`ne_id` DESC, `create_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='基站_状态记录表';
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
DROP TABLE IF EXISTS `ne_config_backup`;
|
||||
CREATE TABLE `ne_config_backup` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '压缩包名称',
|
||||
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '压缩包位置',
|
||||
`remark` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
|
||||
@@ -15,5 +13,5 @@ CREATE TABLE `ne_config_backup` (
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` bigint DEFAULT '0' COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_cfgbak_uid_type` (`core_uid`,`ne_uid`,`ne_type`) USING BTREE COMMENT '索引-核心网_资源标识_类型'
|
||||
KEY `idx_cfgbak_ne_name` (`ne_id`,`name`) USING BTREE COMMENT '索引-网元_包名'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='网元_配置文件备份记录';
|
||||
|
||||
@@ -4,7 +4,12 @@
|
||||
DROP TABLE IF EXISTS `ne_info`;
|
||||
CREATE TABLE `ne_info` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '网元ID',
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
|
||||
`create_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` bigint DEFAULT '0' COMMENT '更新时间',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
|
||||
`core_id` bigint DEFAULT '0' COMMENT '核心网ID 1为全局默认',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元名称',
|
||||
@@ -15,18 +20,19 @@ CREATE TABLE `ne_info` (
|
||||
`vendor_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '厂商名称',
|
||||
`dn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '网络标识',
|
||||
`mac_addr` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'MAC地址',
|
||||
`activation_request_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '激活申请代码',
|
||||
`license_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '激活授权文件',
|
||||
`serial_num` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '序列号',
|
||||
`expiry_date` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '许可证到期日期',
|
||||
`ue_number` bigint DEFAULT '0' COMMENT '用户容量',
|
||||
`nb_number` bigint DEFAULT '0' COMMENT '基站容量',
|
||||
`host_ids` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元主机ID组 数据格式(ssh,telnet) UDM(ssh,telnet,redis) UPF(ssh,telnet,telnet)',
|
||||
`status` int DEFAULT '0' COMMENT '网元状态 0离线 1在线 2配置待下发 3备用模式',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
|
||||
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
|
||||
`create_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` bigint DEFAULT '0' COMMENT '更新时间',
|
||||
`status` int DEFAULT '0' COMMENT '网元状态 0离线 1在线 2配置待下发 3备用模式 4授权无效',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_core_ne_type` (`core_uid`,`ne_uid`,`ne_type`) USING BTREE COMMENT '唯一核心网_资源标识_类型'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='网元_基础信息表 关联创建版本、授权、主机';
|
||||
UNIQUE KEY `uk_core_uid_type` (`core_id`,`ne_uid`,`ne_type`) USING BTREE COMMENT '唯一核心网_资源标识_类型'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='网元_基础信息表 关联创建版本、主机';
|
||||
|
||||
--
|
||||
-- Dumping data for table `ne_info`
|
||||
--
|
||||
INSERT INTO `ne_info` VALUES (1, 'YYMMDDHH', 'DCTHWYBT', 'OMC', 'OMC_001', '127.0.0.1', 33080, 'PNF', 'Area', '', '', '', '1,2', 1, '', 'system', 1755861727150, 'system', 1756286314456);
|
||||
INSERT INTO `ne_info` VALUES (1, 'system', 1756286314456, 'system', 1756286314456, '', 0, 'DCTHWYBT', 'OMC', 'OMC_ROOT', '127.0.0.1', 33080, 'PNF', 'AreaNet', '-', '-', '', '', '', '-', '-', 0, 0, '1,2', 0);
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
--
|
||||
-- Table structure for table `ne_license`
|
||||
--
|
||||
DROP TABLE IF EXISTS `ne_license`;
|
||||
CREATE TABLE `ne_license` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`activation_request_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '激活申请代码',
|
||||
`license_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '激活授权文件',
|
||||
`serial_num` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '序列号',
|
||||
`expiry_date` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '许可证到期日期',
|
||||
`ue_number` bigint DEFAULT '0' COMMENT '用户容量',
|
||||
`nb_number` bigint DEFAULT '0' COMMENT '基站容量',
|
||||
`status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '状态 0无效 1有效',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
|
||||
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
|
||||
`create_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` bigint DEFAULT '0' COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_lic_core_ne_type` (`core_uid`,`ne_uid`,`ne_type`) USING BTREE COMMENT '唯一核心网_资源标识_类型'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='网元_授权激活信息';
|
||||
|
||||
--
|
||||
-- Dumping data for table `ne_license`
|
||||
--
|
||||
INSERT INTO `ne_license` VALUES (1, 'YYMMDDHH', 'DCTHWYBT', 'OMC', '', '', '-', '-', 0, 0, '1', '', 'system', 1756089692896, 'system', 1756173372114);
|
||||
@@ -4,19 +4,13 @@
|
||||
DROP TABLE IF EXISTS `ne_state`;
|
||||
CREATE TABLE `ne_state` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`version` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '版本',
|
||||
`capability` bigint DEFAULT '0' COMMENT '用户容量',
|
||||
`serial_num` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '序列号',
|
||||
`expiry_date` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '许可证到期日期',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`create_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`sys_cpu_usage` float DEFAULT '0' COMMENT 'cpu使用率-sys',
|
||||
`sys_mem_usage` float DEFAULT '0' COMMENT '内存使用率-sys',
|
||||
`sys_disk_usage` float DEFAULT '0' COMMENT '磁盘使用率-sys',
|
||||
`nf_cpu_usage` float DEFAULT '0' COMMENT 'cpu使用率-nf',
|
||||
`nf_mem_used` bigint DEFAULT '0' COMMENT '内存使用KB-nf',
|
||||
`create_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_state_uid_type` (`core_uid`,`ne_uid`,`ne_type`) USING BTREE COMMENT '索引-核心网_资源标识_类型'
|
||||
KEY `idx_state_ne_at` (`ne_id`,`create_time`) USING BTREE COMMENT '索引-网元_创建时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='网元_状态记录内存/CPU/磁盘';
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
DROP TABLE IF EXISTS `ne_version`;
|
||||
CREATE TABLE `ne_version` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '当前包名',
|
||||
`version` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '当前版本',
|
||||
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '当前软件包',
|
||||
@@ -22,10 +20,10 @@ CREATE TABLE `ne_version` (
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` bigint DEFAULT '0' COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_ver_core_ne_type` (`core_uid`,`ne_uid`,`ne_type`) USING BTREE COMMENT '唯一核心网_资源标识_类型'
|
||||
UNIQUE KEY `uk_ver_ne_name_ver` (`ne_id`,`name`,`version`) USING BTREE COMMENT '唯一核心网_资源标识_类型'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='网元_版本信息';
|
||||
|
||||
--
|
||||
-- Dumping data for table `ne_version`
|
||||
--
|
||||
INSERT INTO `ne_version` VALUES (1, 'YYMMDDHH', 'DCTHWYBT', 'OMC', '-', '-', '-', '', '', '', '', '', '', '', 'system', 1756089685222, 'system', 1756089866077);
|
||||
INSERT INTO `ne_version` VALUES (1, 1, '-', '-', '-', '', '', '', '', '', '', '', 'system', 1756089685222, 'system', 1756089866077);
|
||||
|
||||
@@ -613,7 +613,7 @@ INSERT INTO `sys_i18n` VALUES (595, 'dictType.ne_info_status', '网元信息状
|
||||
INSERT INTO `sys_i18n` VALUES (596, 'menu.ne.neQuickSetup', '网元快速安装', 'NE Quick Setup');
|
||||
INSERT INTO `sys_i18n` VALUES (597, 'log.operate.title.neConfig', '网元参数配置', 'NE Parameter Configuration');
|
||||
INSERT INTO `sys_i18n` VALUES (598, 'menu.ne.neLicense', '网元许可', 'NE License');
|
||||
INSERT INTO `sys_i18n` VALUES (599, 'log.operate.title.neLicense', '网元许可', 'NE License');
|
||||
-- INSERT INTO `sys_i18n` VALUES (599, 'log.operate.title.neLicense', '网元许可', 'NE License');
|
||||
INSERT INTO `sys_i18n` VALUES (600, 'menu.ne.neSoftware', '网元软件包', 'NE Software');
|
||||
INSERT INTO `sys_i18n` VALUES (601, 'log.operate.title.neSoftware', '网元软件包', 'NE Software');
|
||||
INSERT INTO `sys_i18n` VALUES (602, 'log.operate.title.neVersion', '网元版本', 'NE Version');
|
||||
@@ -733,7 +733,7 @@ INSERT INTO `sys_i18n` VALUES (715, 'alarm.export.clearTime', '告警清除时
|
||||
INSERT INTO `sys_i18n` VALUES (716, 'log.operate.title.alarm', '告警', 'Alarm');
|
||||
INSERT INTO `sys_i18n` VALUES (717, 'ne.common.neType', '网元类型', 'NE Type');
|
||||
INSERT INTO `sys_i18n` VALUES (718, 'ne.common.neName', '网元名称', 'NE Name');
|
||||
INSERT INTO `sys_i18n` VALUES (719, 'ne.common.neId', '网元标识', 'NE ID');
|
||||
INSERT INTO `sys_i18n` VALUES (719, 'ne.common.neUid', '网元标识', 'NE UID');
|
||||
INSERT INTO `sys_i18n` VALUES (720, 'log.operate.title.udmVOIP', 'UDM VoIP', 'UDM VoIP');
|
||||
INSERT INTO `sys_i18n` VALUES (721, 'log.operate.title.udmVolteIMS', 'UDM VolteIMS', 'UDM VolteIMS');
|
||||
INSERT INTO `sys_i18n` VALUES (722, 'log.operate.title.backup', '备份', 'Backup');
|
||||
|
||||
@@ -35,6 +35,7 @@ INSERT INTO `sys_menu` VALUES (1, 'menu.system', 0, 90, 'system', '', '1', '1',
|
||||
INSERT INTO `sys_menu` VALUES (4, 'menu.ne', 0, 8, 'ne', '', '1', '0', 'D', '1', '1', '', 'icon-huizhiguize', '0', 'system', 1728641403588, 'system', 1728641403588, 'menu.configRemark', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (5, 'menu.ue', 0, 6, 'ue', '', '1', '0', 'D', '1', '1', '', 'icon-wocanyu', '0', 'system', 1728641403588, 'system', 1728641403588, 'menu.ueRemark', '0', '0', 'udm');
|
||||
INSERT INTO `sys_menu` VALUES (6, 'menu.neData', 0, 10, 'ne-data', '', '1', '0', 'D', '1', '1', '', 'icon-suofang', '0', 'system', 1728641403588, 'system', 1728641403588, 'menu.neDataRemark', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (8, 'menu.neCore', 0, 2, 'ne-core', '', '1', '0', 'D', '1', '1', '', 'icon-suofang', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (60, 'menu.tools', 0, 60, 'tool', '', '1', '1', 'D', '1', '1', '', 'icon-wenjian', '0', 'system', 1728641403588, 'system', 1728641403588, 'menu.toolsRemark', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (61, 'menu.tools.terminal', 60, 20, 'terminal', 'tool/terminal/index', '1', '1', 'M', '1', '1', 'tool:terminal:index', 'icon-suofang', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (62, 'menu.tools.help', 60, 62, 'help', 'tool/help/index', '1', '1', 'M', '0', '1', 'tool:help:list', 'icon-shuoming', '0', 'system', 1728641403588, 'system', 1728641403588, 'menu.tools.helpRemark', '0', '0', '');
|
||||
@@ -130,7 +131,7 @@ INSERT INTO `sys_menu` VALUES (2008, 'menu.ueUser.n3iwf', 6, 18, 'n3iwf', 'neDat
|
||||
INSERT INTO `sys_menu` VALUES (2009, 'menu.neData.pcfSub', 5, 24, 'pcf-sub', 'neData/pcf-sub/index', '1', '0', 'M', '1', '1', 'pcf:sub:index', 'icon-paixu', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '1', 'pcf');
|
||||
INSERT INTO `sys_menu` VALUES (2010, 'menu.neUser.nssf', 6, 19, 'nssf', 'neData/nssf-sub/index', '1', '0', 'M', '1', '1', 'nssf:sub:index', 'icon-daimayingyong', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '1', 'nssf');
|
||||
INSERT INTO `sys_menu` VALUES (2011, 'menu.neUser.nssfAmf', 6, 20, 'nssfAmf', 'neData/nssf-amf/index', '1', '0', 'M', '1', '1', 'nssf:sub:index', 'icon-paixu', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '1', 'nssf');
|
||||
INSERT INTO `sys_menu` VALUES (2082, 'menu.neCore.info', 8, 6, 'info', 'neCore/coreInfo/index', '1', '1', 'M', '1', '1', 'neCore:info:index', 'icon-xiangmuchengyuan', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2082, 'menu.neCore.info', 8, 6, 'info', 'ne/core/index', '1', '1', 'M', '1', '1', 'neCore:info:index', 'icon-xiangmuchengyuan', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2083, 'menu.trace', 2083, 30, 'trace', '', '1', '0', 'D', '1', '1', '', 'icon-paixu', '0', 'system', 1728641403588, 'system', 1728641403588, 'menu.traceRemark', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2084, 'menu.trace.task', 4, 40, 'task', 'ne/trace/task/index', '1', '0', 'M', '1', '1', 'traceManage:task:index', 'icon-chexiao', '0', 'system', 1728641403588, 'system', 1744453890548, 'menu.trace.taskRemark', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2085, 'menu.trace.taskData', 2084, 41, 'task/inline/data', 'ne/trace/task/data', '1', '0', 'M', '0', '1', 'traceManage:task:data', '#', '0', 'system', 1728641403588, 'system', 1744453921381, '', '0', '0', '');
|
||||
@@ -185,7 +186,7 @@ INSERT INTO `sys_menu` VALUES (2139, 'menu.perf.kpiOverviewIMS', 2099, 14, 'over
|
||||
INSERT INTO `sys_menu` VALUES (2140, 'menu.monitor.cdr', 6, 25, 'cdr', '', '1', '0', 'D', '1', '1', '', 'icon-tubiaoku', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2141, 'menu.monitor.event', 6, 26, 'event', '', '1', '0', 'D', '1', '1', '', 'icon-gengduo', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2142, 'menu.ne.neQuickSetup', 4, 50, 'neQuickSetup', 'ne/neQuickSetup/index', '1', '1', 'M', '1', '1', 'ne:neQuickSetup:list', 'icon-wofaqi', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2143, 'menu.ne.neLicense', 4, 20, 'neLicense', 'ne/neLicense/index', '1', '0', 'M', '1', '1', 'ne:neLicense:list', 'icon-fuzhidaima', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
-- INSERT INTO `sys_menu` VALUES (2143, 'menu.ne.neLicense', 4, 20, 'neLicense', 'ne/neLicense/index', '1', '0', 'M', '1', '1', 'ne:neLicense:list', 'icon-fuzhidaima', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2144, 'menu.ne.neSoftware', 4, 24, 'neSoftware', 'ne/neSoftware/index', '1', '0', 'M', '1', '1', 'ne:neSoftware:list', 'icon-fuzhidaima', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2145, 'menu.ne.neVersion', 4, 22, 'neVersion', 'ne/neVersion/index', '1', '0', 'M', '1', '1', 'ne:neVersion:list', 'icon-fuzhidaima', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2146, 'menu.ne.neConfig', 4, 28, 'neConfig', 'ne/neConfig/index', '1', '0', 'M', '1', '1', 'ne:neConfig:list', 'icon-wofaqi', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
@@ -201,7 +202,7 @@ INSERT INTO `sys_menu` VALUES (2155, 'menu.common.delete', 2154, 1, '#', '', '1'
|
||||
INSERT INTO `sys_menu` VALUES (2156, 'menu.common.edit', 2154, 2, '#', '', '1', '1', 'B', '1', '1', 'ne:neConfigBackup:edit', '#', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2157, 'menu.dashboard.smscCDR', 2140, 9, 'smsc-cdr', 'neData/smsc-cdr/index', '1', '0', 'M', '1', '1', 'smsc:cdr:index', 'icon-paixu', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '1', 'smsc');
|
||||
INSERT INTO `sys_menu` VALUES (2158, 'menu.trace.pcapFile', 60, 12, 'pcap/inline/file', 'tool/pcap/file', '1', '0', 'M', '0', '1', 'traceManage:pcap:index', '#', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2159, 'menu.neCore.overview', 8, 2, 'overview', 'neCore/overview/index', '1', '1', 'M', '1', '1', 'neCore:overview:index', 'icon-xiangmuchengyuan', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2159, 'menu.neCore.overview', 8, 2, 'overview', 'ne/core/index', '1', '1', 'M', '1', '1', 'neCore:overview:index', 'icon-xiangmuchengyuan', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2160, 'menu.perf.kpic', 2099, 100, 'kpic', 'perfManage/kpic/index', '1', '0', 'M', '1', '1', 'perfManage:kpiCReport:index', 'icon-tubiaoku', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2161, 'menu.trace.taskHLR', 4, 45, 'taskHLR', 'ne/trace/task-hlr/index', '1', '0', 'M', '0', '1', 'traceManage:taskHLR:index', 'icon-chexiao', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2162, 'menu.trace.taskAnalyze', 2084, 42, 'task/inline/analyze', 'ne/trace/task/analyze', '1', '0', 'M', '0', '1', 'traceManage:task:analyze', '#', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
@@ -212,5 +213,89 @@ INSERT INTO `sys_menu` VALUES (2166, 'menu.dashboard.overview.smfUeNum', 2132, 4
|
||||
INSERT INTO `sys_menu` VALUES (2167, 'menu.dashboard.overview.imsUeNum', 2132, 2, '', '', '1', '1', 'B', '1', '1', 'dashboard:overview:imsUeNum', '#', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2168, 'menu.dashboard.overview.gnbBase', 2132, 6, '', '', '1', '1', 'B', '1', '1', 'dashboard:overview:gnbBase', '#', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2169, 'menu.dashboard.overview.enbBase', 2132, 8, '', '', '1', '1', 'B', '1', '1', 'dashboard:overview:enbBase', '#', '0', 'system', 1728641403588, 'system', 1728641403588, '', '0', '0', '');
|
||||
INSERT INTO `sys_menu` VALUES (2170, '核心网', 0, 100, 'core', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757401126626, 'system', 1757401126626, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2171, '概览', 2170, 2, 'overview', 'core/overview/index', '1', '0', 'M', '1', '1', 'core:overview:index', '#', '0', 'system', 1757401522417, 'system', 1757401522417, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2172, '信息', 2170, 4, 'info', 'core/info/index', '1', '0', 'M', '1', '1', 'core:info:index', '#', '0', 'system', 1757401600724, 'system', 1757401615163, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2173, '网元', 0, 102, 'nee', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757401739013, 'system', 1757401739013, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2174, '概览', 2173, 2, 'overview', 'ne/overview/index', '1', '0', 'M', '1', '1', 'ne:overview:index', '#', '0', 'system', 1757401788559, 'system', 1757401788559, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2175, '信息', 2173, 4, 'info', 'ne/info/index', '1', '0', 'M', '1', '1', 'ne:info:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2176, '快速安装', 2173, 10, 'quick-setup', 'ne/quick-setup/index', '1', '0', 'M', '1', '1', 'ne:quick-setup:index', '#', '0', 'system', 1757401938544, 'system', 1757401938544, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2177, '软件版本', 0, 104, 'software-version', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757402016433, 'system', 1757402016433, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2178, '日志', 0, 106, 'logs', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757402098794, 'system', 1757403441029, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2179, '账户', 0, 108, 'account', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757402144050, 'system', 1757402144050, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2180, '设置', 0, 110, 'setting', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757402186822, 'system', 1757402186822, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2181, '登录日志', 2178, 2, 'login', 'log/login/index', '1', '0', 'M', '1', '1', 'log:login:index', '#', '0', 'system', 1757404772833, 'system', 1757404772833, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2182, '操作日志', 2178, 4, 'operation', 'log/operation/index', '1', '0', 'M', '1', '1', 'log:operation:index', '#', '0', 'system', 1757404834569, 'system', 1757404834569, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2183, 'User Management', 2179, 2, 'user', 'account/user/index', '1', '0', 'M', '1', '1', 'account:user:index', '#', '0', 'system', 1757404907051, 'system', 1757404907051, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2184, '角色管理', 2179, 4, 'role', 'account/role/index', '1', '0', 'M', '1', '1', 'account:role:index', '#', '0', 'system', 1757405385768, 'system', 1757405385768, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2185, '第三方认证', 2179, 8, 'third-party-login', 'account/third-party-login/index', '1', '0', 'M', '1', '1', 'account:third-party-login:index', '#', '0', 'system', 1757406008575, 'system', 1757406008575, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2186, 'System Info', 2180, 2, 'system', 'setting/system/index', '1', '0', 'M', '1', '1', 'setting:system:index', '#', '0', 'system', 1757406157936, 'system', 1757406157936, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2187, 'Backup Storage', 2180, 4, 'backup', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757406157936, 'system', 1757407541052, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2188, '平台集成', 2180, 6, 'platform', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757406157936, 'system', 1757407559184, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2189, 'Maintenance', 2180, 8, 'maintenance', 'setting/maintenance/index', '1', '0', 'M', '1', '1', 'setting:maintenance:index', '#', '0', 'system', 1757406157936, 'system', 1757407571739, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2190, 'Cloud Access', 2180, 10, 'cloud', 'setting/cloud/index', '1', '0', 'M', '1', '1', 'setting:cloud:index', '#', '0', 'system', 1757406157936, 'system', 1757406157936, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2191, '备份状态', 2187, 2, 'status', 'setting/backup/status/index', '1', '0', 'M', '1', '1', 'setting:backup:status:index', '#', '0', 'system', 1757408869101, 'system', 1757408869101, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2192, 'FTP 配置', 2187, 4, 'ftp', 'setting/backup/ftp/index', '1', '0', 'M', '1', '1', 'setting:backup:ftp:index', '#', '0', 'system', 1757408869101, 'system', 1757408869101, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2193, '功能配置', 2187, 6, 'config', 'setting/backup/config/index', '1', '0', 'M', '1', '1', 'setting:backup:config:index', '#', '0', 'system', 1757408869101, 'system', 1757408869101, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2194, '备份列表', 2187, 8, 'files', 'setting/backup/files/index', '1', '0', 'M', '1', '1', 'setting:backup:files:index', '#', '0', 'system', 1757408869101, 'system', 1757408869101, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2195, 'Open API', 2188, 2, 'open-api', 'setting/platform/open-api/index', '1', '0', 'M', '1', '1', 'setting:platform:open-api:index', '#', '0', 'system', 1757408869101, 'system', 1757408869101, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2196, 'Scope', 2188, 4, 'scope', 'setting/platform/scope/index', '1', '0', 'M', '1', '1', 'setting:platform:scope:index', '#', '0', 'system', 1757408869101, 'system', 1757408869101, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2197, '版本信息', 2177, 2, 'version', 'software-version/version/index', '1', '0', 'M', '1', '1', 'software-version:version:index', '#', '0', 'system', 1757408869101, 'system', 1757408869101, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2198, '软件包', 2177, 4, 'software', 'software-version/software/index', '1', '0', 'M', '1', '1', 'software-version:software:index', '#', '0', 'system', 1757408869101, 'system', 1757408869101, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2200, '核心网-网元功能', 0, 200, 'core-ne', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757401126626, 'system', 1757401126626, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2201, '监控', 2200, 4, 'monitor', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757415742565, 'system', 1757415742565, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2202, '网元', 2200, 6, 'ne', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757415742565, 'system', 1757415742565, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2203, '告警', 2200, 8, 'alarm', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757415742565, 'system', 1757415742565, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2204, 'UE', 2200, 8, 'ue', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757415742565, 'system', 1757415742565, '', '0', '1', 'UDM,PCF');
|
||||
INSERT INTO `sys_menu` VALUES (2205, 'Insights Data', 2200, 10, 'ne-data', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757415742565, 'system', 1757415742565, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2206, 'Metrics Report', 2200, 12, 'metrics', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757415742565, 'system', 1757415742565, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2207, '工具', 2200, 16, 'tool', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757415742565, 'system', 1757415742565, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2208, '拓扑图', 2201, 2, 'topology', 'core-ne/monitor/topology/index', '1', '0', 'M', '1', '1', 'core-ne:monitor:topology:index', '#', '0', 'system', 1757418475487, 'system', 1757418475487, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2209, '数据大屏', 2201, 4, 'dashboard', 'core-ne/monitor/dashboard/index', '1', '0', 'M', '1', '1', 'core-ne:monitor:dashboard:index', '#', '0', 'system', 1757418475487, 'system', 1757418475487, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2210, '指标概览', 2201, 6, 'dashboard-kpi', 'core-ne/monitor/dashboard-kpi/index', '1', '0', 'M', '1', '1', 'core-ne:monitor:dashboard:index', '#', '0', 'system', 1757418475487, 'system', 1757418475487, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2211, '网元VM资源', 2201, 8, 'vm', 'core-ne/monitor/vm/index', '1', '0', 'M', '1', '1', 'core-ne:monitor:vm:index', '#', '0', 'system', 1757418475487, 'system', 1757418475487, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2212, 'UE接入事件', 2201, 10, 'ue-event', 'core-ne/monitor/ue-event/index', '1', '0', 'M', '1', '1', 'core-ne:monitor:ue-event:index', '#', '0', 'system', 1757418475487, 'system', 1757418475487, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2213, '信息', 2202, 2, 'info', 'core-ne/ne/info/index', '1', '0', 'M', '1', '1', 'core-ne:ne:info:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2214, '版本', 2202, 4, 'version', 'core-ne/ne/version/index', '1', '0', 'M', '1', '1', 'core-ne:ne:version:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2215, '配置', 2202, 6, 'config', 'core-ne/ne/config/index', '1', '0', 'M', '1', '1', 'core-ne:ne:config:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2216, '活动告警', 2203, 2, 'active', 'core-ne/alarm/active/index', '1', '0', 'M', '1', '1', 'core-ne:alarm:active:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2217, '历史告警', 2203, 4, 'historical', 'core-ne/alarm/historical/index', '1', '0', 'M', '1', '1', 'core-ne:alarm:historical:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2218, '事件告警', 2203, 8, 'event', 'core-ne/alarm/event/index', '1', '0', 'M', '1', '1', 'core-ne:alarm:event:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2219, '接收日志', 2203, 10, 'logs', 'core-ne/alarm/logs/index', '1', '0', 'M', '1', '1', 'core-ne:alarm:logs:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2220, '转发通知', 2203, 12, 'forward', 'core-ne/alarm/forward/index', '1', '0', 'M', '1', '1', 'core-ne:alarm:forward:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2221, 'UDM Authentication', 2204, 2, 'udm-auth', 'core-ne/ue/udm-auth/index', '1', '0', 'M', '1', '1', 'core-ne:ue:udm-auth:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'UDM');
|
||||
INSERT INTO `sys_menu` VALUES (2222, 'UDM Subscriber', 2204, 4, 'udm-sub', 'core-ne/ue/udm-sub/index', '1', '0', 'M', '1', '1', 'core-ne:ue:udm-sub:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'UDM');
|
||||
INSERT INTO `sys_menu` VALUES (2223, 'UDM VoIP User', 2204, 8, 'udm-voip', 'core-ne/ue/udm-voip/index', '1', '0', 'M', '1', '1', 'core-ne:ue:udm-voip:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'UDM');
|
||||
INSERT INTO `sys_menu` VALUES (2224, 'UDM VoLTE User', 2204, 10, 'udm-volte', 'core-ne/ue/udm-volte/index', '1', '0', 'M', '1', '1', 'core-ne:ue:udm-volte:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'UDM');
|
||||
INSERT INTO `sys_menu` VALUES (2225, 'PCF User Rule', 2204, 16, 'pcf-rule', 'core-ne/ue/pcf-rule/index', '1', '0', 'M', '1', '1', 'core-ne:ue:pcf-rule:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'PCF');
|
||||
INSERT INTO `sys_menu` VALUES (2226, 'IMS Online Voice Session', 2205, 2, 'ims-session', 'core-ne/ne-data/ims-session/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:ims-session:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'IMS');
|
||||
INSERT INTO `sys_menu` VALUES (2227, 'SMF Online Data Session', 2205, 4, 'smf-session', 'core-ne/ne-data/smf-session/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:smf-session:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'SMF');
|
||||
INSERT INTO `sys_menu` VALUES (2228, 'N3IWF Online User', 2205, 6, 'n3iwf-session', 'core-ne/ne-data/n3iwf-session/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:n3iwf-session:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'N3IWF');
|
||||
INSERT INTO `sys_menu` VALUES (2229, 'NSSF Subscription Info', 2205, 8, 'nssf-session', 'core-ne/ne-data/nssf-session/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:nssf-session:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'NSSF');
|
||||
INSERT INTO `sys_menu` VALUES (2230, 'NSSF Available AMFs', 2205, 10, 'nssf-amf', 'core-ne/ne-data/nssf-amf/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:nssf-amf:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'NSSF');
|
||||
INSERT INTO `sys_menu` VALUES (2231, 'Radio State', 2205, 12, 'radio-state', 'core-ne/ne-data/radio-state/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:radio-state:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'AMF,MME');
|
||||
INSERT INTO `sys_menu` VALUES (2232, 'UE Events', 2205, 14, 'ue-event', 'core-ne/ne-data/ue-event/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:ue-event:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'AMF,MME');
|
||||
INSERT INTO `sys_menu` VALUES (2233, 'CDR', 2205, 16, 'cdr', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757415742565, 'system', 1757415742565, '', '0', '1', 'IMS,SMF,SMSC,SGWC');
|
||||
INSERT INTO `sys_menu` VALUES (2234, 'IMS Voice CDR', 2233, 2, 'ims-cdr', 'core-ne/ne-data/cdr/ims-cdr/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:cdr:ims-cdr:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'IMS');
|
||||
INSERT INTO `sys_menu` VALUES (2235, 'SMF Data CDR', 2233, 4, 'smf-cdr', 'core-ne/ne-data/cdr/smf-cdr/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:cdr:smf-cdr:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'SMF');
|
||||
INSERT INTO `sys_menu` VALUES (2236, 'SMSC SMS CDR', 2233, 6, 'smsc-cdr', 'core-ne/ne-data/cdr/smsc-cdr/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:cdr:smsc-cdr:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'SMSC');
|
||||
INSERT INTO `sys_menu` VALUES (2237, 'SGWC Roaming Data CDR', 2233, 8, 'sgwc-cdr', 'core-ne/ne-data/cdr/sgwc-cdr/index', '1', '0', 'M', '1', '1', 'core-ne:ne-data:cdr:sgwc-cdr:index', '#', '0', 'system', 1757401824418, 'system', 1757401824418, '', '0', '1', 'SGWC');
|
||||
INSERT INTO `sys_menu` VALUES (2238, 'Key Performance', 2206, 2, 'kpi', 'core-ne/metrics/kpi/index', '1', '0', 'M', '1', '1', 'core-ne:metrics:kpi:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2239, 'Key Performance Custom', 2206, 4, 'kpic', 'core-ne/metrics/kpic/index', '1', '0', 'M', '1', '1', 'core-ne:metrics:kpic:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2240, 'Voice Calls Dashboard', 2206, 6, 'overview-ims', 'core-ne/metrics/overview-ims/index', '1', '0', 'M', '1', '1', 'core-ne:metrics:overview-ims:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2241, 'MML', 2207, 2, 'mml', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757476055992, 'system', 1757476055992, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2242, '网络测试', 2207, 4, 'test', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757476055992, 'system', 1757476055992, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2243, '信令', 2207, 6, 'signal', '', '1', '1', 'D', '1', '1', '', '#', '0', 'system', 1757476055992, 'system', 1757476055992, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2244, 'Terminal', 2207, 10, 'terminal', 'core-ne/tool/terminal/index', '1', '0', 'M', '1', '1', 'core-ne:tool:terminal:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2245, 'NE Operation', 2241, 2, 'ne', 'core-ne/tool/mml/oper-ne/index', '1', '0', 'M', '1', '1', 'core-ne:tool:mml:oper-ne:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2246, 'UDM Operation', 2241, 4, 'udm', 'core-ne/tool/mml/oper-udm/index', '1', '0', 'M', '1', '1', 'core-ne:tool:mml:oper-udm:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2248, 'MML Logs', 2241, 6, 'logs', 'core-ne/tool/mml/logs/index', '1', '0', 'M', '1', '1', 'core-ne:tool:mml:logs:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2249, 'Net Probing Test', 2242, 2, 'ping', 'core-ne/tool/test/ping/index', '1', '0', 'M', '1', '1', 'core-ne:tool:test:ping:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2250, 'Net Performance Test', 2242, 4, 'iperf', 'core-ne/tool/test/iperf/index', '1', '0', 'M', '1', '1', 'core-ne:tool:test:iperf:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2251, 'Process Running Program', 2242, 6, 'ps', 'core-ne/tool/test/ps/index', '1', '0', 'M', '1', '1', 'core-ne:tool:test:ps:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2252, 'Process Net Connection', 2242, 8, 'net', 'core-ne/tool/test/net/index', '1', '0', 'M', '1', '1', 'core-ne:tool:test:net:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2253, 'Signaling Capture', 2243, 2, 'tcpdump', 'core-ne/tool/signal/tcpdump/index', '1', '0', 'M', '1', '1', 'core-ne:tool:signal:tcpdump:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2254, 'Signaling Analysis', 2243, 4, 'wireshark', 'core-ne/tool/signal/wireshark/index', '1', '0', 'M', '1', '1', 'core-ne:tool:signal:wireshark:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
INSERT INTO `sys_menu` VALUES (2255, 'Signaling Trace', 2243, 8, 'packet', 'core-ne/tool/signal/packet/index', '1', '0', 'M', '1', '1', 'core-ne:tool:signal:wireshark:index', '#', '0', 'system', 1757475772860, 'system', 1757475772860, '', '0', '1', '');
|
||||
|
||||
-- Dump completed on 2025-02-14 15:26:56
|
||||
|
||||
@@ -17,8 +17,8 @@ CREATE TABLE `trace_task` (
|
||||
`create_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '任务标题',
|
||||
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '备注',
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_list` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '网元列表 neUid,neUid',
|
||||
`core_id` bigint DEFAULT '0' COMMENT '核心网ID',
|
||||
`ne_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元ID列表 neId,neId',
|
||||
`notify_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '信息数据通知回调地址UDP 例如udp:192.168.5.58:33033',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='跟踪_任务';
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
DROP TABLE IF EXISTS `udm_auth`;
|
||||
CREATE TABLE `udm_auth` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`imsi` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'SIM卡/USIM卡ID',
|
||||
`amf` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'AMF',
|
||||
`status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '状态',
|
||||
@@ -15,6 +13,5 @@ CREATE TABLE `udm_auth` (
|
||||
`opc` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'OPC',
|
||||
`create_time` bigint(20) DEFAULT 0 COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_udm_auth_imsi_ne` (`ne_uid`,`imsi`) USING BTREE COMMENT '唯一主键-IMSI_网元ID',
|
||||
KEY `idx_udm_auth_uid_type` (`core_uid`,`ne_uid`,`ne_type`) USING BTREE COMMENT '索引-核心网_资源标识_类型'
|
||||
UNIQUE KEY `uk_udm_auth_ne_imsi` (`ne_id`,`imsi`) USING BTREE COMMENT '唯一索引-网元_IMSI'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='UDM用户数据_鉴权';
|
||||
|
||||
@@ -4,13 +4,10 @@
|
||||
DROP TABLE IF EXISTS `udm_extend`;
|
||||
CREATE TABLE `udm_extend` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '默认ID',
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`imsi` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'SIM卡/USIM卡ID',
|
||||
`msisdn` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '用户电话号码',
|
||||
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_udm_extend_imsi_ne` (`ne_uid`,`imsi`,`msisdn`) USING BTREE COMMENT '唯一索引-SIM卡_网元标识',
|
||||
KEY `idx_udm_extend_uid_type` (`core_uid`,`ne_uid`) USING BTREE COMMENT '索引-核心网_资源标识_类型'
|
||||
UNIQUE KEY `uk_udm_extend_ne_imsi` (`ne_id`,`imsi`) USING BTREE COMMENT '唯一索引-网元_IMSI'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UDM用户数据_IMSI扩展信息';
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
DROP TABLE IF EXISTS `udm_sub`;
|
||||
CREATE TABLE `udm_sub` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`imsi` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'SIM卡/USIM卡ID',
|
||||
`msisdn` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '用户电话号码',
|
||||
`am_dat` varchar(1500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'AmData',
|
||||
@@ -37,6 +35,5 @@ CREATE TABLE `udm_sub` (
|
||||
`smf_sel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'smfSel',
|
||||
`cag` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'CAG',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_udm_sub_imsi_ne` (`ne_uid`,`imsi`,`msisdn`) USING BTREE COMMENT '唯一索引-SIM卡_网元标识',
|
||||
KEY `idx_udm_sub_uid_type` (`core_uid`,`ne_uid`) USING BTREE COMMENT '索引-核心网_资源标识_类型'
|
||||
UNIQUE KEY `uk_udm_sub_ne_imsi` (`ne_id`,`imsi`) USING BTREE COMMENT '唯一索引-网元_IMSI'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UDM用户数据_签约';
|
||||
|
||||
@@ -4,12 +4,9 @@
|
||||
DROP TABLE IF EXISTS `udm_voip`;
|
||||
CREATE TABLE `udm_voip` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '用户名',
|
||||
`password` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '密码',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_udm_voip_smsc_uid_type` (`ne_uid`,`username`) USING BTREE COMMENT '唯一主键-用户名_网元ID',
|
||||
KEY `idx_udm_voip_uid_type` (`core_uid`,`ne_uid`) USING BTREE COMMENT '索引-核心网_资源标识_类型'
|
||||
UNIQUE KEY `uk_udm_voip_ne_name` (`ne_id`,`username`) USING BTREE COMMENT '唯一主键-网元_用户名'
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='UDM用户数据_VOIP';
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
--
|
||||
-- Table structure for table `udm_volte_ims`
|
||||
-- Table structure for table `udm_volte`
|
||||
--
|
||||
DROP TABLE IF EXISTS `udm_volte_ims`;
|
||||
CREATE TABLE `udm_volte_ims` (
|
||||
DROP TABLE IF EXISTS `udm_volte`;
|
||||
CREATE TABLE `udm_volte` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`imsi` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'SIM卡/USIM卡ID',
|
||||
`msisdn` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '用户电话号码',
|
||||
`tag` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '0=VoIP, 1=VoLTE',
|
||||
`vni` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'VNI',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_udm_volte_imsi_ne` (`ne_uid`,`imsi`,`msisdn`) USING BTREE COMMENT 'imsi_msisdn_neid唯一主键',
|
||||
KEY `idx_udm_volte_uid_tag` (`core_uid`,`ne_uid`,`tag`) USING BTREE COMMENT '索引-核心网_资源标识_类型'
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UDM用户数据_VolteIMS用户';
|
||||
UNIQUE KEY `uk_udm_volte_ne_imsi` (`ne_id`,`imsi`) USING BTREE COMMENT '唯一索引-网元_IMSI'
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UDM用户数据_VoLTE用户';
|
||||
|
||||
@@ -4,13 +4,11 @@
|
||||
DROP TABLE IF EXISTS `ue_event`;
|
||||
CREATE TABLE `ue_event` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`timestamp` bigint DEFAULT '0' COMMENT '接收到时间戳',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
`event_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '事件类型',
|
||||
`event_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_ue_uid_type_at` (`core_uid` DESC, `ne_uid` DESC,`event_type` DESC, `timestamp` DESC) USING BTREE COMMENT '索引-核心网_资源标识_类型_时间'
|
||||
KEY `idx_ue_ne_type_at` (`ne_id` DESC,`event_type` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_类型_时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UE事件_基础表结构';
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
DROP TABLE IF EXISTS `ue_event_amf`;
|
||||
CREATE TABLE `ue_event_amf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`timestamp` bigint DEFAULT '0' COMMENT '接收到时间戳',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
`event_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '事件类型',
|
||||
`event_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_ue_amf_uid_type_at` (`core_uid` DESC, `ne_uid` DESC,`event_type` DESC, `timestamp` DESC) USING BTREE COMMENT '索引-核心网_资源标识_类型_时间'
|
||||
KEY `idx_ue_ne_type_at` (`ne_id` DESC,`event_type` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_类型_时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UE事件_AMF终端接入';
|
||||
|
||||
-- Dump completed on 2025-02-14 15:26:56
|
||||
-- Dump completed on 2025-09-11 15:26:56
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
DROP TABLE IF EXISTS `ue_event_mme`;
|
||||
CREATE TABLE `ue_event_mme` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`core_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '核心网唯一标识',
|
||||
`ne_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元唯一标识',
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
|
||||
`timestamp` bigint DEFAULT '0' COMMENT '接收到时间戳',
|
||||
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
|
||||
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
|
||||
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
`event_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '事件类型',
|
||||
`event_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_ue_mme_uid_type_at` (`core_uid` DESC, `ne_uid` DESC,`event_type` DESC, `timestamp` DESC) USING BTREE COMMENT '索引-核心网_资源标识_类型_时间'
|
||||
KEY `idx_ue_ne_type_at` (`ne_id` DESC,`event_type` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_类型_时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UE事件_MME终端接入';
|
||||
|
||||
-- Dump completed on 2025-02-14 15:26:56
|
||||
-- Dump completed on 2025-09-11 15:26:56
|
||||
|
||||
@@ -22,8 +22,8 @@ const (
|
||||
CACHE_OAUTH2_CODE = "oauth2_codes"
|
||||
// CACHE_I18N 国际化语言管理
|
||||
CACHE_I18N = "i18n"
|
||||
// CACHE_NE_INFO 网元信息管理
|
||||
// CACHE_NE_INFO 网元信息管理 ne_info:ne_type:ne_id:ne_uid
|
||||
CACHE_NE_INFO = "ne_info"
|
||||
// CACHE_NE_DATA 网元数据管理
|
||||
// CACHE_NE_DATA 网元数据管理 ne_data:{x}:{x}:{x}
|
||||
CACHE_NE_DATA = "ne_data"
|
||||
)
|
||||
|
||||
@@ -65,23 +65,23 @@ func (s *BackupExportCDRProcessor) Execute(data any) (any, error) {
|
||||
switch v {
|
||||
case "ims":
|
||||
neList := s.neInfoService.Find(neModel.NeInfo{NeType: "IMS"}, false, false)
|
||||
for _, ne := range neList {
|
||||
result[ne.NeName] = s.exportIMS(ne.CoreUID, ne.NeUID, params.Hour, params.FileType)
|
||||
for _, neinfo := range neList {
|
||||
result[neinfo.NeUid] = s.exportIMS(neinfo.ID, neinfo.NeUid, params.Hour, params.FileType)
|
||||
}
|
||||
case "smsc":
|
||||
neList := s.neInfoService.Find(neModel.NeInfo{NeType: "SMSC"}, false, false)
|
||||
for _, ne := range neList {
|
||||
result[ne.NeName] = s.exportSMSC(ne.CoreUID, ne.NeUID, params.Hour, params.FileType)
|
||||
for _, neinfo := range neList {
|
||||
result[neinfo.NeUid] = s.exportSMSC(neinfo.ID, neinfo.NeUid, params.Hour, params.FileType)
|
||||
}
|
||||
case "smf":
|
||||
neList := s.neInfoService.Find(neModel.NeInfo{NeType: "SMF"}, false, false)
|
||||
for _, ne := range neList {
|
||||
result[ne.NeName] = s.exportSMF(ne.CoreUID, ne.NeUID, params.Hour, params.FileType)
|
||||
for _, neinfo := range neList {
|
||||
result[neinfo.NeUid] = s.exportSMF(neinfo.ID, neinfo.NeUid, params.Hour, params.FileType)
|
||||
}
|
||||
case "sgwc":
|
||||
neList := s.neInfoService.Find(neModel.NeInfo{NeType: "SGWC"}, false, false)
|
||||
for _, ne := range neList {
|
||||
result[ne.NeName] = s.exportSGWC(ne.CoreUID, ne.NeUID, params.Hour, params.FileType)
|
||||
for _, neinfo := range neList {
|
||||
result[neinfo.NeUid] = s.exportSGWC(neinfo.ID, neinfo.NeUid, params.Hour, params.FileType)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ func (s *BackupExportCDRProcessor) Execute(data any) (any, error) {
|
||||
}
|
||||
|
||||
// exportIMS 导出IMS-CDR会话事件数据
|
||||
func (s BackupExportCDRProcessor) exportIMS(coreUid, neUid string, hour int, fileType string) string {
|
||||
func (s BackupExportCDRProcessor) exportIMS(neId int64, neUid string, hour int, fileType string) string {
|
||||
// 前 hour 小时
|
||||
now := time.Now()
|
||||
end := time.Date(now.Year(), now.Month(), now.Day(), now.Hour(), 0, 0, 0, now.Location())
|
||||
@@ -99,14 +99,9 @@ func (s BackupExportCDRProcessor) exportIMS(coreUid, neUid string, hour int, fil
|
||||
|
||||
language := "en"
|
||||
query := map[string]string{
|
||||
"sortField": "timestamp",
|
||||
"sortOrder": "asc",
|
||||
"coreUid": coreUid,
|
||||
"neUid": neUid,
|
||||
"neId": fmt.Sprint(neId),
|
||||
"beginTime": fmt.Sprint(start.UnixMilli()),
|
||||
"endTime": fmt.Sprint(end.UnixMilli()),
|
||||
"pageNum": fmt.Sprint(1),
|
||||
"pageSize": fmt.Sprint(1000_0000),
|
||||
}
|
||||
rows, total := s.cdrEventService.FindByPage("IMS", query)
|
||||
if total == 0 {
|
||||
@@ -115,7 +110,7 @@ func (s BackupExportCDRProcessor) exportIMS(coreUid, neUid string, hour int, fil
|
||||
|
||||
// 导出文件名称
|
||||
fileName := fmt.Sprintf("ims_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/ims_cdr_event", coreUid, neUid, fileName)
|
||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/ims_cdr_event", neUid, fileName)
|
||||
if runtime.GOOS == "windows" {
|
||||
filePath = fmt.Sprintf("C:%s", filePath)
|
||||
}
|
||||
@@ -125,7 +120,6 @@ func (s BackupExportCDRProcessor) exportIMS(coreUid, neUid string, hour int, fil
|
||||
data := [][]string{
|
||||
{
|
||||
"ID",
|
||||
"NE Name",
|
||||
"Record Behavior",
|
||||
"Type",
|
||||
"Caller",
|
||||
@@ -227,7 +221,6 @@ func (s BackupExportCDRProcessor) exportIMS(coreUid, neUid string, hour int, fil
|
||||
|
||||
data = append(data, []string{
|
||||
fmt.Sprint(row.ID),
|
||||
row.NeUID,
|
||||
recordType,
|
||||
callTypeLable,
|
||||
caller,
|
||||
@@ -250,16 +243,15 @@ func (s BackupExportCDRProcessor) exportIMS(coreUid, neUid string, hour int, fil
|
||||
// 第一行表头标题
|
||||
headerCells := map[string]string{
|
||||
"A1": "ID",
|
||||
"B1": "NE Name",
|
||||
"C1": "Record Behavior",
|
||||
"D1": "Type",
|
||||
"E1": "Caller",
|
||||
"F1": "Called",
|
||||
"G1": "Duration",
|
||||
"H1": "Result Code",
|
||||
"I1": "Result Cause",
|
||||
"J1": "Call Start Time",
|
||||
"K1": "Hangup Time",
|
||||
"B1": "Record Behavior",
|
||||
"C1": "Type",
|
||||
"D1": "Caller",
|
||||
"E1": "Called",
|
||||
"F1": "Duration",
|
||||
"G1": "Result Code",
|
||||
"H1": "Result Cause",
|
||||
"I1": "Call Start Time",
|
||||
"J1": "Hangup Time",
|
||||
}
|
||||
// 读取字典数据 CDR SIP响应代码类别类型
|
||||
dictCDRSipCode := s.sysDictService.FindByType("cdr_sip_code")
|
||||
@@ -354,16 +346,15 @@ func (s BackupExportCDRProcessor) exportIMS(coreUid, neUid string, hour int, fil
|
||||
|
||||
dataCells = append(dataCells, map[string]any{
|
||||
"A" + idx: row.ID,
|
||||
"B" + idx: row.NeUID,
|
||||
"C" + idx: recordType,
|
||||
"D" + idx: callTypeLable,
|
||||
"E" + idx: caller,
|
||||
"F" + idx: called,
|
||||
"G" + idx: duration,
|
||||
"H" + idx: callResult,
|
||||
"I" + idx: callCause,
|
||||
"J" + idx: seizureTimeStr,
|
||||
"K" + idx: releaseTimeStr,
|
||||
"B" + idx: recordType,
|
||||
"C" + idx: callTypeLable,
|
||||
"D" + idx: caller,
|
||||
"E" + idx: called,
|
||||
"F" + idx: duration,
|
||||
"G" + idx: callResult,
|
||||
"H" + idx: callCause,
|
||||
"I" + idx: seizureTimeStr,
|
||||
"J" + idx: releaseTimeStr,
|
||||
})
|
||||
}
|
||||
// 导出数据表格
|
||||
@@ -381,7 +372,7 @@ func (s BackupExportCDRProcessor) exportIMS(coreUid, neUid string, hour int, fil
|
||||
}
|
||||
|
||||
// exportSMSC 导出SMSC-CDR会话事件数据
|
||||
func (s BackupExportCDRProcessor) exportSMSC(coreUid, neUid string, hour int, fileType string) string {
|
||||
func (s BackupExportCDRProcessor) exportSMSC(neId int64, neUid string, hour int, fileType string) string {
|
||||
// 前 hour 小时
|
||||
now := time.Now()
|
||||
end := time.Date(now.Year(), now.Month(), now.Day(), now.Hour(), 0, 0, 0, now.Location())
|
||||
@@ -389,14 +380,9 @@ func (s BackupExportCDRProcessor) exportSMSC(coreUid, neUid string, hour int, fi
|
||||
|
||||
language := "en"
|
||||
query := map[string]string{
|
||||
"sortField": "timestamp",
|
||||
"sortOrder": "asc",
|
||||
"coreUid": coreUid,
|
||||
"neUid": neUid,
|
||||
"neId": fmt.Sprint(neId),
|
||||
"beginTime": fmt.Sprint(start.UnixMilli()),
|
||||
"endTime": fmt.Sprint(end.UnixMilli()),
|
||||
"pageNum": fmt.Sprint(1),
|
||||
"pageSize": fmt.Sprint(1000_0000),
|
||||
}
|
||||
rows, total := s.cdrEventService.FindByPage("SMSC", query)
|
||||
if total == 0 {
|
||||
@@ -405,7 +391,7 @@ func (s BackupExportCDRProcessor) exportSMSC(coreUid, neUid string, hour int, fi
|
||||
|
||||
// 导出文件名称
|
||||
fileName := fmt.Sprintf("smsc_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/smsc_cdr_event", coreUid, neUid, fileName)
|
||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/smsc_cdr_event", neUid, fileName)
|
||||
if runtime.GOOS == "windows" {
|
||||
filePath = fmt.Sprintf("C:%s", filePath)
|
||||
}
|
||||
@@ -415,7 +401,6 @@ func (s BackupExportCDRProcessor) exportSMSC(coreUid, neUid string, hour int, fi
|
||||
data := [][]string{
|
||||
{
|
||||
"ID",
|
||||
"NE Name",
|
||||
"Record Behavior",
|
||||
"Service Type",
|
||||
"Caller",
|
||||
@@ -484,7 +469,6 @@ func (s BackupExportCDRProcessor) exportSMSC(coreUid, neUid string, hour int, fi
|
||||
|
||||
data = append(data, []string{
|
||||
fmt.Sprint(row.ID),
|
||||
row.NeUID,
|
||||
recordType,
|
||||
serviceType,
|
||||
caller,
|
||||
@@ -504,13 +488,12 @@ func (s BackupExportCDRProcessor) exportSMSC(coreUid, neUid string, hour int, fi
|
||||
// 第一行表头标题
|
||||
headerCells := map[string]string{
|
||||
"A1": "ID",
|
||||
"B1": "NE Name",
|
||||
"C1": "Record Behavior",
|
||||
"D1": "Service Type",
|
||||
"E1": "Caller",
|
||||
"F1": "Called",
|
||||
"G1": "Result",
|
||||
"H1": "Time",
|
||||
"B1": "Record Behavior",
|
||||
"C1": "Service Type",
|
||||
"D1": "Caller",
|
||||
"E1": "Called",
|
||||
"F1": "Result",
|
||||
"G1": "Time",
|
||||
}
|
||||
// 读取字典数据 CDR 原因码
|
||||
dictCDRCauseCode := s.sysDictService.FindByType("cdr_cause_code")
|
||||
@@ -575,13 +558,12 @@ func (s BackupExportCDRProcessor) exportSMSC(coreUid, neUid string, hour int, fi
|
||||
|
||||
dataCells = append(dataCells, map[string]any{
|
||||
"A" + idx: row.ID,
|
||||
"B" + idx: row.NeUID,
|
||||
"C" + idx: recordType,
|
||||
"D" + idx: serviceType,
|
||||
"E" + idx: caller,
|
||||
"F" + idx: called,
|
||||
"G" + idx: callResult,
|
||||
"H" + idx: timeStr,
|
||||
"B" + idx: recordType,
|
||||
"C" + idx: serviceType,
|
||||
"D" + idx: caller,
|
||||
"E" + idx: called,
|
||||
"F" + idx: callResult,
|
||||
"G" + idx: timeStr,
|
||||
})
|
||||
}
|
||||
// 导出数据表格
|
||||
@@ -599,21 +581,16 @@ func (s BackupExportCDRProcessor) exportSMSC(coreUid, neUid string, hour int, fi
|
||||
}
|
||||
|
||||
// exportSMF 导出SMF-CDR会话事件数据
|
||||
func (s BackupExportCDRProcessor) exportSMF(coreUid, neUid string, hour int, fileType string) string {
|
||||
func (s BackupExportCDRProcessor) exportSMF(neId int64, neUid string, hour int, fileType string) string {
|
||||
// 前 hour 小时
|
||||
now := time.Now()
|
||||
end := time.Date(now.Year(), now.Month(), now.Day(), now.Hour(), 0, 0, 0, now.Location())
|
||||
start := end.Add(-time.Duration(hour) * time.Hour)
|
||||
|
||||
query := map[string]string{
|
||||
"sortField": "timestamp",
|
||||
"sortOrder": "asc",
|
||||
"coreUid": coreUid,
|
||||
"neUid": neUid,
|
||||
"neId": fmt.Sprint(neId),
|
||||
"beginTime": fmt.Sprint(start.UnixMilli()),
|
||||
"endTime": fmt.Sprint(end.UnixMilli()),
|
||||
"pageNum": fmt.Sprint(1),
|
||||
"pageSize": fmt.Sprint(1000_0000),
|
||||
}
|
||||
rows, total := s.cdrEventService.FindByPage("SMF", query)
|
||||
if total == 0 {
|
||||
@@ -622,7 +599,7 @@ func (s BackupExportCDRProcessor) exportSMF(coreUid, neUid string, hour int, fil
|
||||
|
||||
// 导出文件名称
|
||||
fileName := fmt.Sprintf("smf_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/smf_cdr_event", coreUid, neUid, fileName)
|
||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/smf_cdr_event", neUid, fileName)
|
||||
if runtime.GOOS == "windows" {
|
||||
filePath = fmt.Sprintf("C:%s", filePath)
|
||||
}
|
||||
@@ -784,8 +761,6 @@ func (s BackupExportCDRProcessor) exportSMF(coreUid, neUid string, hour int, fil
|
||||
data = append(data, []string{
|
||||
fmt.Sprint(row.ID),
|
||||
chargingID,
|
||||
row.NeType,
|
||||
row.NeUID,
|
||||
subscriptionIDData,
|
||||
subscriptionIDType,
|
||||
fmt.Sprint(dataVolumeUplink),
|
||||
@@ -818,26 +793,24 @@ func (s BackupExportCDRProcessor) exportSMF(coreUid, neUid string, hour int, fil
|
||||
headerCells := map[string]string{
|
||||
"A1": "ID",
|
||||
"B1": "Charging ID",
|
||||
"C1": "NE Name",
|
||||
"D1": "Resource Unique ID",
|
||||
"E1": "Subscriber ID Data",
|
||||
"F1": "Subscriber ID Type",
|
||||
"G1": "Data Volume Uplink",
|
||||
"H1": "Data Volume Downlink",
|
||||
"I1": "Data Total Volume",
|
||||
"J1": "Duration",
|
||||
"K1": "Invocation Time",
|
||||
"L1": "User Identifier",
|
||||
"M1": "SSC Mode",
|
||||
"N1": "DNN ID",
|
||||
"O1": "PDU Type",
|
||||
"P1": "RAT Type",
|
||||
"Q1": "PDU IPv4 Address",
|
||||
"R1": "Network Function IPv4",
|
||||
"S1": "PDU IPv6 Address Swith Prefix",
|
||||
"T1": "Record Network Function ID",
|
||||
"U1": "Record Type",
|
||||
"V1": "Record Opening Time",
|
||||
"C1": "Subscriber ID Data",
|
||||
"D1": "Subscriber ID Type",
|
||||
"E1": "Data Volume Uplink",
|
||||
"F1": "Data Volume Downlink",
|
||||
"G1": "Data Total Volume",
|
||||
"H1": "Duration",
|
||||
"I1": "Invocation Time",
|
||||
"J1": "User Identifier",
|
||||
"K1": "SSC Mode",
|
||||
"L1": "DNN ID",
|
||||
"M1": "PDU Type",
|
||||
"N1": "RAT Type",
|
||||
"O1": "PDU IPv4 Address",
|
||||
"P1": "Network Function IPv4",
|
||||
"Q1": "PDU IPv6 Address Swith Prefix",
|
||||
"R1": "Record Network Function ID",
|
||||
"S1": "Record Type",
|
||||
"T1": "Record Opening Time",
|
||||
}
|
||||
// 从第二行开始的数据
|
||||
dataCells := make([]map[string]any, 0)
|
||||
@@ -971,26 +944,24 @@ func (s BackupExportCDRProcessor) exportSMF(coreUid, neUid string, hour int, fil
|
||||
dataCells = append(dataCells, map[string]any{
|
||||
"A" + idx: row.ID,
|
||||
"B" + idx: chargingID,
|
||||
"C" + idx: row.NeType,
|
||||
"D" + idx: row.NeUID,
|
||||
"E" + idx: subscriptionIDData,
|
||||
"F" + idx: subscriptionIDType,
|
||||
"G" + idx: dataVolumeUplink,
|
||||
"H" + idx: dataVolumeDownlink,
|
||||
"I" + idx: dataTotalVolume,
|
||||
"J" + idx: duration,
|
||||
"K" + idx: invocationTimestamp,
|
||||
"L" + idx: User_Identifier,
|
||||
"M" + idx: SSC_Mode,
|
||||
"N" + idx: DNN_ID,
|
||||
"O" + idx: PDU_Type,
|
||||
"P" + idx: RAT_Type,
|
||||
"Q" + idx: PDU_IPv4,
|
||||
"R" + idx: networkFunctionIPv4Address,
|
||||
"S" + idx: PDU_IPv6,
|
||||
"T" + idx: recordNFID,
|
||||
"U" + idx: recordType,
|
||||
"V" + idx: recordOpeningTime,
|
||||
"C" + idx: subscriptionIDData,
|
||||
"D" + idx: subscriptionIDType,
|
||||
"E" + idx: dataVolumeUplink,
|
||||
"F" + idx: dataVolumeDownlink,
|
||||
"G" + idx: dataTotalVolume,
|
||||
"H" + idx: duration,
|
||||
"I" + idx: invocationTimestamp,
|
||||
"J" + idx: User_Identifier,
|
||||
"K" + idx: SSC_Mode,
|
||||
"L" + idx: DNN_ID,
|
||||
"M" + idx: PDU_Type,
|
||||
"N" + idx: RAT_Type,
|
||||
"O" + idx: PDU_IPv4,
|
||||
"P" + idx: networkFunctionIPv4Address,
|
||||
"Q" + idx: PDU_IPv6,
|
||||
"R" + idx: recordNFID,
|
||||
"S" + idx: recordType,
|
||||
"T" + idx: recordOpeningTime,
|
||||
})
|
||||
}
|
||||
// 导出数据表格
|
||||
@@ -1008,21 +979,16 @@ func (s BackupExportCDRProcessor) exportSMF(coreUid, neUid string, hour int, fil
|
||||
}
|
||||
|
||||
// exportSGWC 导出SGWC-CDR会话事件数据
|
||||
func (s BackupExportCDRProcessor) exportSGWC(coreUid, neUid string, hour int, fileType string) string {
|
||||
func (s BackupExportCDRProcessor) exportSGWC(neId int64, neUid string, hour int, fileType string) string {
|
||||
// 前 hour 小时
|
||||
now := time.Now()
|
||||
end := time.Date(now.Year(), now.Month(), now.Day(), now.Hour(), 0, 0, 0, now.Location())
|
||||
start := end.Add(-time.Duration(hour) * time.Hour)
|
||||
|
||||
query := map[string]string{
|
||||
"sortField": "timestamp",
|
||||
"sortOrder": "asc",
|
||||
"coreUid": coreUid,
|
||||
"neUid": neUid,
|
||||
"neId": fmt.Sprint(neId),
|
||||
"beginTime": fmt.Sprint(start.UnixMilli()),
|
||||
"endTime": fmt.Sprint(end.UnixMilli()),
|
||||
"pageNum": fmt.Sprint(1),
|
||||
"pageSize": fmt.Sprint(1000_0000),
|
||||
}
|
||||
rows, total := s.cdrEventService.FindByPage("SGWC", query)
|
||||
if total == 0 {
|
||||
@@ -1031,7 +997,7 @@ func (s BackupExportCDRProcessor) exportSGWC(coreUid, neUid string, hour int, fi
|
||||
|
||||
// 导出文件名称
|
||||
fileName := fmt.Sprintf("sgwc_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/sgwc_cdr_event", coreUid, neUid, fileName)
|
||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/sgwc_cdr_event", neUid, fileName)
|
||||
if runtime.GOOS == "windows" {
|
||||
filePath = fmt.Sprintf("C:%s", filePath)
|
||||
}
|
||||
@@ -1041,8 +1007,6 @@ func (s BackupExportCDRProcessor) exportSGWC(coreUid, neUid string, hour int, fi
|
||||
data := [][]string{
|
||||
{
|
||||
"ID",
|
||||
"NE Name",
|
||||
"Resource Unique ID",
|
||||
"Charging ID",
|
||||
"IMSI",
|
||||
"MSISDN",
|
||||
@@ -1195,8 +1159,6 @@ func (s BackupExportCDRProcessor) exportSGWC(coreUid, neUid string, hour int, fi
|
||||
|
||||
data = append(data, []string{
|
||||
fmt.Sprint(row.ID),
|
||||
row.NeType,
|
||||
row.NeUID,
|
||||
chargingID,
|
||||
servedIMSI,
|
||||
servedMSISDN,
|
||||
@@ -1230,28 +1192,26 @@ func (s BackupExportCDRProcessor) exportSGWC(coreUid, neUid string, hour int, fi
|
||||
// 第一行表头标题
|
||||
headerCells := map[string]string{
|
||||
"A1": "ID",
|
||||
"B1": "NE Name",
|
||||
"C1": "Resource Unique ID",
|
||||
"D1": "Charging ID",
|
||||
"E1": "IMSI",
|
||||
"F1": "MSISDN",
|
||||
"G1": "GPRS Uplink",
|
||||
"H1": "GPRS Downlink",
|
||||
"I1": "Duration",
|
||||
"J1": "Invocation Time",
|
||||
"K1": "PGW Address",
|
||||
"L1": "SGW Address",
|
||||
"M1": "RAT Type",
|
||||
"N1": "PDPPDN Type",
|
||||
"O1": "PDPPDN Address",
|
||||
"P1": "Node Address",
|
||||
"Q1": "Node Type",
|
||||
"R1": "Record Access Point Name NI",
|
||||
"S1": "Record Cause For Rec Closing",
|
||||
"T1": "Record Sequence Number",
|
||||
"U1": "Local Record Sequence Number",
|
||||
"V1": "Record Type",
|
||||
"W1": "Record Opening Time",
|
||||
"B1": "Charging ID",
|
||||
"C1": "IMSI",
|
||||
"D1": "MSISDN",
|
||||
"E1": "GPRS Uplink",
|
||||
"F1": "GPRS Downlink",
|
||||
"G1": "Duration",
|
||||
"H1": "Invocation Time",
|
||||
"I1": "PGW Address",
|
||||
"J1": "SGW Address",
|
||||
"K1": "RAT Type",
|
||||
"L1": "PDPPDN Type",
|
||||
"M1": "PDPPDN Address",
|
||||
"N1": "Node Address",
|
||||
"O1": "Node Type",
|
||||
"P1": "Record Access Point Name NI",
|
||||
"Q1": "Record Cause For Rec Closing",
|
||||
"R1": "Record Sequence Number",
|
||||
"S1": "Local Record Sequence Number",
|
||||
"T1": "Record Type",
|
||||
"U1": "Record Opening Time",
|
||||
}
|
||||
// 从第二行开始的数据
|
||||
dataCells := make([]map[string]any, 0)
|
||||
@@ -1386,28 +1346,26 @@ func (s BackupExportCDRProcessor) exportSGWC(coreUid, neUid string, hour int, fi
|
||||
|
||||
dataCells = append(dataCells, map[string]any{
|
||||
"A" + idx: row.ID,
|
||||
"B" + idx: row.NeType,
|
||||
"C" + idx: row.NeUID,
|
||||
"D" + idx: chargingID,
|
||||
"E" + idx: servedIMSI,
|
||||
"F" + idx: servedMSISDN,
|
||||
"G" + idx: dataVolumeGPRSUplink,
|
||||
"H" + idx: dataVolumeGPRSDownlink,
|
||||
"I" + idx: duration,
|
||||
"J" + idx: invocationTimestamp,
|
||||
"K" + idx: pGWAddressUsed,
|
||||
"L" + idx: sGWAddress,
|
||||
"M" + idx: rATType,
|
||||
"N" + idx: pdpPDNType,
|
||||
"O" + idx: servedPDPPDNAddress,
|
||||
"P" + idx: strings.Join(servingNodeAddress, ","),
|
||||
"Q" + idx: strings.Join(servingNodeType, ","),
|
||||
"R" + idx: accessPointNameNI,
|
||||
"S" + idx: causeForRecClosing,
|
||||
"T" + idx: recordSequenceNumber,
|
||||
"U" + idx: localRecordSequenceNumber,
|
||||
"V" + idx: recordType,
|
||||
"W" + idx: invocationTimestamp,
|
||||
"B" + idx: chargingID,
|
||||
"C" + idx: servedIMSI,
|
||||
"D" + idx: servedMSISDN,
|
||||
"E" + idx: dataVolumeGPRSUplink,
|
||||
"F" + idx: dataVolumeGPRSDownlink,
|
||||
"G" + idx: duration,
|
||||
"H" + idx: invocationTimestamp,
|
||||
"I" + idx: pGWAddressUsed,
|
||||
"J" + idx: sGWAddress,
|
||||
"K" + idx: rATType,
|
||||
"L" + idx: pdpPDNType,
|
||||
"M" + idx: servedPDPPDNAddress,
|
||||
"N" + idx: strings.Join(servingNodeAddress, ","),
|
||||
"O" + idx: strings.Join(servingNodeType, ","),
|
||||
"P" + idx: accessPointNameNI,
|
||||
"Q" + idx: causeForRecClosing,
|
||||
"R" + idx: recordSequenceNumber,
|
||||
"S" + idx: localRecordSequenceNumber,
|
||||
"T" + idx: recordType,
|
||||
"U" + idx: invocationTimestamp,
|
||||
})
|
||||
}
|
||||
// 导出数据表格
|
||||
|
||||
@@ -344,9 +344,6 @@ func (s BackupExportTableProcessor) exportSMF(hour int, columns []string, filePa
|
||||
if col == "id" {
|
||||
arr[i] = fmt.Sprintf("%d", row.ID)
|
||||
}
|
||||
if col == "neType" || col == "ne_type" {
|
||||
arr[i] = fmt.Sprintf("%v", row.NeType)
|
||||
}
|
||||
// 单层json
|
||||
if strings.HasPrefix("json", col) {
|
||||
key := strings.TrimPrefix(col, "json")
|
||||
@@ -463,9 +460,6 @@ func (s BackupExportTableProcessor) exportIMS(hour int, columns []string, filePa
|
||||
if col == "id" {
|
||||
arr[i] = fmt.Sprintf("%d", row.ID)
|
||||
}
|
||||
if col == "neType" || col == "ne_type" {
|
||||
arr[i] = fmt.Sprintf("%v", row.NeType)
|
||||
}
|
||||
// 单层json
|
||||
if strings.HasPrefix("json", col) {
|
||||
key := strings.TrimPrefix(col, "json")
|
||||
@@ -653,9 +647,6 @@ func (s BackupExportTableProcessor) exportSMSC(hour int, columns []string, fileP
|
||||
if v == "id" {
|
||||
arr[i] = fmt.Sprintf("%d", row.ID)
|
||||
}
|
||||
if v == "neType" || v == "ne_type" {
|
||||
arr[i] = fmt.Sprintf("%v", row.NeType)
|
||||
}
|
||||
// 单层json
|
||||
if strings.HasPrefix("json", v) {
|
||||
key := strings.TrimPrefix(v, "json")
|
||||
@@ -842,9 +833,6 @@ func (s BackupExportTableProcessor) exportSGWC(hour int, columns []string, fileP
|
||||
if v == "id" {
|
||||
arr[i] = fmt.Sprintf("%d", row.ID)
|
||||
}
|
||||
if v == "neType" || v == "ne_type" {
|
||||
arr[i] = fmt.Sprintf("%v", row.NeType)
|
||||
}
|
||||
// 单层json
|
||||
if strings.HasPrefix("json", v) {
|
||||
key := strings.TrimPrefix(v, "json")
|
||||
|
||||
@@ -64,13 +64,13 @@ func (s *BackupExportUDMProcessor) Execute(data any) (any, error) {
|
||||
for _, v := range params.DataType {
|
||||
switch v {
|
||||
case "auth":
|
||||
result[fmt.Sprintf("%s-%s", neInfo.NeUID, v)] = s.exportAuth(neInfo.CoreUID, neInfo.NeUID, params.FileType)
|
||||
result[fmt.Sprintf("%s-%s", v, neInfo.NeUid)] = s.exportAuth(neInfo.ID, neInfo.NeUid, params.FileType)
|
||||
case "sub":
|
||||
result[fmt.Sprintf("%s-%s", neInfo.NeUID, v)] = s.exportSub(neInfo.CoreUID, neInfo.NeUID, params.FileType)
|
||||
result[fmt.Sprintf("%s-%s", v, neInfo.NeUid)] = s.exportSub(neInfo.ID, neInfo.NeUid, params.FileType)
|
||||
case "voip":
|
||||
result[fmt.Sprintf("%s-%s", neInfo.NeUID, v)] = s.exportVOIP(neInfo.CoreUID, neInfo.NeUID, params.FileType)
|
||||
result[fmt.Sprintf("%s-%s", v, neInfo.NeUid)] = s.exportVOIP(neInfo.ID, neInfo.NeUid, params.FileType)
|
||||
case "volte":
|
||||
result[fmt.Sprintf("%s-%s", neInfo.NeUID, v)] = s.exportVolte(neInfo.CoreUID, neInfo.NeUID, params.FileType)
|
||||
result[fmt.Sprintf("%s-%s", v, neInfo.NeUid)] = s.exportVolte(neInfo.ID, neInfo.NeUid, params.FileType)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,8 +80,8 @@ func (s *BackupExportUDMProcessor) Execute(data any) (any, error) {
|
||||
}
|
||||
|
||||
// exportAuth 导出鉴权用户数据
|
||||
func (s BackupExportUDMProcessor) exportAuth(coreUid, neUid, fileType string) string {
|
||||
rows := s.udmAuthService.Find(neDataNfModel.UDMAuthUser{CoreUID: coreUid, NeUID: neUid})
|
||||
func (s BackupExportUDMProcessor) exportAuth(neId int64, neUid, fileType string) string {
|
||||
rows := s.udmAuthService.Find(neDataNfModel.UDMAuthUser{NeID: neId})
|
||||
if len(rows) <= 0 {
|
||||
return "no data"
|
||||
}
|
||||
@@ -134,8 +134,8 @@ func (s BackupExportUDMProcessor) exportAuth(coreUid, neUid, fileType string) st
|
||||
}
|
||||
|
||||
// exportSub 导出签约用户数据
|
||||
func (s BackupExportUDMProcessor) exportSub(coreUid, neUid, fileType string) string {
|
||||
rows := s.udmSubService.Find(neDataNfModel.UDMSubUser{CoreUID: coreUid, NeUID: neUid})
|
||||
func (s BackupExportUDMProcessor) exportSub(neId int64, neUid, fileType string) string {
|
||||
rows := s.udmSubService.Find(neDataNfModel.UDMSubUser{NeID: neId})
|
||||
if len(rows) <= 0 {
|
||||
return "no data"
|
||||
}
|
||||
@@ -182,8 +182,8 @@ func (s BackupExportUDMProcessor) exportSub(coreUid, neUid, fileType string) str
|
||||
}
|
||||
|
||||
// exportVOIP 导出VOIP用户数据
|
||||
func (s BackupExportUDMProcessor) exportVOIP(coreUid, neUid, fileType string) string {
|
||||
rows := s.udmVOIPService.Find(neDataNfModel.UDMVOIPUser{CoreUID: coreUid, NeUID: neUid})
|
||||
func (s BackupExportUDMProcessor) exportVOIP(neId int64, neUid, fileType string) string {
|
||||
rows := s.udmVOIPService.Find(neDataNfModel.UDMVOIPUser{NeID: neId})
|
||||
if len(rows) <= 0 {
|
||||
return "no data"
|
||||
}
|
||||
@@ -228,8 +228,8 @@ func (s BackupExportUDMProcessor) exportVOIP(coreUid, neUid, fileType string) st
|
||||
}
|
||||
|
||||
// exportVolte 导出Volte用户数据
|
||||
func (s BackupExportUDMProcessor) exportVolte(coreUid, neUid, fileType string) string {
|
||||
rows := s.udmVolteIMSService.Find(neDataNfModel.UDMVolteIMSUser{CoreUID: coreUid, NeUID: neUid})
|
||||
func (s BackupExportUDMProcessor) exportVolte(neId int64, neUid, fileType string) string {
|
||||
rows := s.udmVolteIMSService.Find(neDataNfModel.UDMVolteIMSUser{NeID: neId})
|
||||
if len(rows) <= 0 {
|
||||
return "no data"
|
||||
}
|
||||
|
||||
@@ -56,16 +56,16 @@ func (s *DeleteNeConfigBackupProcessor) Execute(data any) (any, error) {
|
||||
neList := s.neInfoService.Find(neModel.NeInfo{}, false, false)
|
||||
for _, neInfo := range neList {
|
||||
tx := db.DB("").Model(&neModel.NeConfigBackup{})
|
||||
tx = tx.Where("core_uid = ? and ne_uid = ?", neInfo.CoreUID, neInfo.NeUID)
|
||||
tx = tx.Where("ne_id = ?", neInfo.ID)
|
||||
|
||||
// 查询数量为0直接返回
|
||||
var total int64 = 0
|
||||
if err := tx.Count(&total).Error; err != nil {
|
||||
result[neInfo.NeUID] = err.Error()
|
||||
result[neInfo.NeUid] = err.Error()
|
||||
continue
|
||||
}
|
||||
if total <= int64(params.StoreNum) {
|
||||
result[neInfo.NeUID] = "less than storeNum"
|
||||
result[neInfo.NeUid] = "less than storeNum"
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -73,11 +73,11 @@ func (s *DeleteNeConfigBackupProcessor) Execute(data any) (any, error) {
|
||||
var lastCreateTime int64 = 0
|
||||
lastTx := tx.Select("create_time").Order("create_time DESC").Limit(1)
|
||||
if err := lastTx.Find(&lastCreateTime).Error; err != nil {
|
||||
result[neInfo.NeUID] = err.Error()
|
||||
result[neInfo.NeUid] = err.Error()
|
||||
continue
|
||||
}
|
||||
if lastCreateTime <= 1e12 {
|
||||
result[neInfo.NeUID] = "no data"
|
||||
result[neInfo.NeUid] = "no data"
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -88,13 +88,13 @@ func (s *DeleteNeConfigBackupProcessor) Execute(data any) (any, error) {
|
||||
// 删除小于最后时间的数据
|
||||
delTx := tx.Delete("create_time < ?", ltTime.UnixMilli())
|
||||
if err := delTx.Error; err != nil {
|
||||
result[neInfo.NeUID] = err.Error()
|
||||
result[neInfo.NeUid] = err.Error()
|
||||
continue
|
||||
}
|
||||
result[neInfo.NeUID] = tx.RowsAffected
|
||||
result[neInfo.NeUid] = tx.RowsAffected
|
||||
|
||||
// 删除本地文件
|
||||
s.deleteFile(neInfo.CoreUID, neInfo.NeUID, ltTime)
|
||||
s.deleteFile(neInfo.NeType, neInfo.NeUid, ltTime)
|
||||
}
|
||||
|
||||
return result, nil
|
||||
|
||||
@@ -75,7 +75,7 @@ func (s *NeAlarmStateCheckProcessor) Execute(data any) (any, error) {
|
||||
}
|
||||
// 创建告警
|
||||
alarm := oam.Alarm{
|
||||
NeUid: neInfo.NeUID, // 网元唯一标识
|
||||
NeUid: neInfo.NeUid, // 网元唯一标识
|
||||
AlarmTime: time.Now().UnixMilli(), // 事件产生时间
|
||||
AlarmId: params.AlarmId, // 告警ID 唯一,清除时对应
|
||||
AlarmCode: constants.ALARM_STATE_CHECK, // 告警状态码
|
||||
@@ -89,7 +89,7 @@ func (s *NeAlarmStateCheckProcessor) Execute(data any) (any, error) {
|
||||
LocationInfo: "NE State: Heartbeat", // 告警定位信息
|
||||
}
|
||||
if err = oamService.NewAlarm.Resolve(alarm); err == nil {
|
||||
result[neInfo.NeUID] = "state alarm"
|
||||
result[neInfo.NeUid] = "state alarm"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ func (s *NeAlarmStateCheckCMDProcessor) Execute(data any) (any, error) {
|
||||
if len(warnMsg) > 0 {
|
||||
currentTime := time.Now()
|
||||
validTimes := []time.Time{}
|
||||
if v, ok := triggerCount.Load(neInfo.NeUID); ok {
|
||||
if v, ok := triggerCount.Load(neInfo.NeUid); ok {
|
||||
times := v.([]time.Time)
|
||||
// 清理过期的记录:10秒前的触发记录不再计入
|
||||
for _, t := range times {
|
||||
@@ -127,11 +127,11 @@ func (s *NeAlarmStateCheckCMDProcessor) Execute(data any) (any, error) {
|
||||
}
|
||||
}
|
||||
validTimes = append(validTimes, currentTime)
|
||||
triggerCount.Store(neInfo.NeUID, validTimes)
|
||||
triggerCount.Store(neInfo.NeUid, validTimes)
|
||||
} else {
|
||||
// 事件第一次触发,初始化记录
|
||||
validTimes = append(validTimes, currentTime)
|
||||
triggerCount.Store(neInfo.NeUID, validTimes)
|
||||
triggerCount.Store(neInfo.NeUid, validTimes)
|
||||
}
|
||||
if int64(len(validTimes)) >= triggerMax {
|
||||
err = fmt.Errorf("greater than %s", strings.Join(warnMsg, ", "))
|
||||
@@ -149,14 +149,12 @@ func (s *NeAlarmStateCheckCMDProcessor) Execute(data any) (any, error) {
|
||||
addInfo = err.Error()
|
||||
}
|
||||
|
||||
// 事件产生时间
|
||||
alarmTime := time.Now().UnixMilli()
|
||||
// 告警ID
|
||||
params.AlarmId = fmt.Sprintf("%d%d", constants.ALARM_CMD_CHECK, alarmTime)
|
||||
params.AlarmId = fmt.Sprintf("%d%d", constants.ALARM_LICENSE_CHECK, neInfo.CreateTime)
|
||||
// 创建告警
|
||||
alarm := oam.Alarm{
|
||||
NeUid: neInfo.NeUID, // 网元唯一标识
|
||||
AlarmTime: alarmTime, // 事件产生时间
|
||||
NeUid: neInfo.NeUid, // 网元唯一标识
|
||||
AlarmTime: time.Now().UnixMilli(), // 事件产生时间
|
||||
AlarmId: params.AlarmId, // 告警ID 唯一,清除时对应
|
||||
AlarmCode: constants.ALARM_CMD_CHECK, // 告警状态码
|
||||
AlarmType: params.AlarmType, // 告警类型
|
||||
@@ -169,9 +167,9 @@ func (s *NeAlarmStateCheckCMDProcessor) Execute(data any) (any, error) {
|
||||
LocationInfo: "NE CPU/Menory/Disk: Heartbeat", // 告警定位信息
|
||||
}
|
||||
if err = oamService.NewAlarm.Resolve(alarm); err == nil {
|
||||
result[neInfo.NeUID] = "cmd alarm"
|
||||
result[neInfo.NeUid] = "cmd alarm"
|
||||
}
|
||||
triggerCount.Delete(neInfo.NeUID)
|
||||
triggerCount.Delete(neInfo.NeUid)
|
||||
}
|
||||
|
||||
// 返回结果,用于记录执行结果
|
||||
@@ -221,27 +219,20 @@ func (s NeAlarmStateCheckCMDProcessor) serverState(state map[string]any) (float6
|
||||
}
|
||||
|
||||
// 插入网元状态记录
|
||||
neState := neDataModel.NEState{
|
||||
CoreUID: fmt.Sprint(state["coreUid"]),
|
||||
NeUID: fmt.Sprint(state["neUid"]),
|
||||
NeType: fmt.Sprint(state["neType"]),
|
||||
Version: fmt.Sprint(state["version"]),
|
||||
Capability: parse.Number(state["capability"]),
|
||||
SerialNum: fmt.Sprint(state["sn"]),
|
||||
ExpiryDate: fmt.Sprint(state["expire"]),
|
||||
neState := neDataModel.NeState{
|
||||
NeID: parse.Number(state["neId"]),
|
||||
SysCpuUsage: sysCpuUsage,
|
||||
SysMemUsage: sysMemUsage,
|
||||
SysDiskUsage: sysDiskUsage,
|
||||
NfCpuUsage: nfCpuUsage,
|
||||
NfMemUsed: nfMemUsed,
|
||||
CreateTime: parse.Number(state["refreshTime"]),
|
||||
}
|
||||
s.neStateService.Insert(neState)
|
||||
// 删除网元状态记录7天前
|
||||
ltTime := time.Now().AddDate(0, 0, -7).UnixMilli()
|
||||
s.neStateService.DeleteByTime(ltTime)
|
||||
// 推送ws消息
|
||||
groupID := fmt.Sprintf("%s_%s_%s", wsService.GROUP_NE_STATE, neState.CoreUID, neState.NeUID)
|
||||
groupID := fmt.Sprintf("%s_%s", wsService.GROUP_NE_STATE, state["neUid"])
|
||||
s.wsSendService.ByGroupID(groupID, neState)
|
||||
|
||||
return sysCpuUsage, sysMemUsage, sysDiskUsage
|
||||
|
||||
@@ -91,7 +91,7 @@ func (s *NeAlarmStateCheckLicenseProcessor) Execute(data any) (any, error) {
|
||||
params.AlarmId = fmt.Sprintf("%d%d", constants.ALARM_LICENSE_CHECK, neInfo.CreateTime)
|
||||
// 创建告警
|
||||
alarm := oam.Alarm{
|
||||
NeUid: neInfo.NeUID, // 网元唯一标识
|
||||
NeUid: neInfo.NeUid, // 网元唯一标识
|
||||
AlarmTime: time.Now().UnixMilli(), // 事件产生时间
|
||||
AlarmId: params.AlarmId, // 告警ID 唯一,清除时对应
|
||||
AlarmCode: constants.ALARM_LICENSE_CHECK, // 告警状态码
|
||||
@@ -105,7 +105,7 @@ func (s *NeAlarmStateCheckLicenseProcessor) Execute(data any) (any, error) {
|
||||
LocationInfo: "NE License: Heartbeat", // 告警定位信息
|
||||
}
|
||||
if err = oamService.NewAlarm.Resolve(alarm); err == nil {
|
||||
result[neInfo.NeUID] = "license alarm"
|
||||
result[neInfo.NeUid] = "license alarm"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,31 +40,29 @@ func (s *NeConfigBackupProcessor) Execute(data any) (any, error) {
|
||||
// 将网元文件备份到本地
|
||||
zipFilePath, err := s.neConfigBackupService.FileNeToLocal(neInfo)
|
||||
if err != nil {
|
||||
result[neInfo.NeUID] = err.Error()
|
||||
result[neInfo.NeUid] = err.Error()
|
||||
continue
|
||||
}
|
||||
|
||||
// 新增备份记录
|
||||
item := neModel.NeConfigBackup{
|
||||
CoreUID: neInfo.CoreUID,
|
||||
NeUID: neInfo.NeUID,
|
||||
NeType: neInfo.NeType,
|
||||
NeID: neInfo.ID,
|
||||
Name: filepath.Base(zipFilePath),
|
||||
Path: zipFilePath,
|
||||
CreateBy: "system",
|
||||
}
|
||||
rows := s.neConfigBackupService.Insert(item)
|
||||
if rows <= 0 {
|
||||
result[neInfo.NeUID] = "failed"
|
||||
result[neInfo.NeUid] = "failed"
|
||||
continue
|
||||
}
|
||||
|
||||
msg := "ok"
|
||||
// 上传到FTP服务器
|
||||
if err := s.backupService.FTPPushFile(zipFilePath, ""); err != nil {
|
||||
result[neInfo.NeUID] = msg + ", ftp err:" + err.Error()
|
||||
result[neInfo.NeUid] = msg + ", ftp err:" + err.Error()
|
||||
}
|
||||
result[neInfo.NeUID] = msg
|
||||
result[neInfo.NeUid] = msg
|
||||
}
|
||||
|
||||
return result, nil
|
||||
|
||||
@@ -41,10 +41,10 @@ func (s *NeDataUDM) Execute(data any) (any, error) {
|
||||
|
||||
neList := s.neInfoService.Find(neModel.NeInfo{NeType: "UDM"}, false, false)
|
||||
for _, neInfo := range neList {
|
||||
result[fmt.Sprintf("AuthNumber_%s", neInfo.NeUID)] = s.udmAuthService.ResetData(neInfo.CoreUID, neInfo.NeUID)
|
||||
result[fmt.Sprintf("SubNumber_%s", neInfo.NeUID)] = s.udmSubService.ResetData(neInfo.CoreUID, neInfo.NeUID)
|
||||
result[fmt.Sprintf("VOIPNumber_%s", neInfo.NeUID)] = s.udmVOIPService.ResetData(neInfo.CoreUID, neInfo.NeUID)
|
||||
result[fmt.Sprintf("VolteIMSNumber_%s", neInfo.NeUID)] = s.udmVolteIMSService.ResetData(neInfo.CoreUID, neInfo.NeUID)
|
||||
result[fmt.Sprintf("auth_%s", neInfo.NeUid)] = s.udmAuthService.ResetData(neInfo.ID)
|
||||
result[fmt.Sprintf("sub_%s", neInfo.NeUid)] = s.udmSubService.ResetData(neInfo.ID)
|
||||
result[fmt.Sprintf("voip_%s", neInfo.NeUid)] = s.udmVOIPService.ResetData(neInfo.ID)
|
||||
result[fmt.Sprintf("volte_%s", neInfo.NeUid)] = s.udmVolteIMSService.ResetData(neInfo.ID)
|
||||
}
|
||||
|
||||
return result, nil
|
||||
|
||||
@@ -46,7 +46,6 @@ type NeActionController struct {
|
||||
func (s *NeActionController) FilePush(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
|
||||
UploadPath string `json:"uploadPath" binding:"required"`
|
||||
DelTemp bool `json:"delTemp"` // 删除本地临时文件
|
||||
@@ -58,14 +57,14 @@ func (s *NeActionController) FilePush(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
|
||||
if neInfo.CoreUID != body.CoreUID || neInfo.NeUID != body.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(body.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != body.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := s.neInfoService.NeRunSSHClient(neInfo.CoreUID, neInfo.NeUID)
|
||||
sshClient, err := s.neInfoService.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(err.Error()))
|
||||
return
|
||||
@@ -105,9 +104,7 @@ func (s *NeActionController) FilePush(c *gin.Context) {
|
||||
// @Tags network_element/action
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param coreUid query string true "CoreUID" default(8I73Y01Z)
|
||||
// @Param neUid query string true "NeUID" default(5AKF59BZ)
|
||||
// @Param path query string true "dir path" default(/var/log)
|
||||
// @Param neUid query string true "NE UID" default(8I73Y01Z)// @Param path query string true "dir path" default(/var/log)
|
||||
// @Param fileName query string true "file name"
|
||||
// @Param delTemp query boolean false "Delete Temp File" default(false)
|
||||
// @Success 200 {object} object "Response Results"
|
||||
@@ -118,7 +115,6 @@ func (s *NeActionController) FilePush(c *gin.Context) {
|
||||
func (s *NeActionController) FilePull(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
Path string `form:"path" binding:"required"`
|
||||
FileName string `form:"fileName" binding:"required"`
|
||||
@@ -131,14 +127,14 @@ func (s *NeActionController) FilePull(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(query.CoreUID, query.NeUID)
|
||||
if neInfo.CoreUID != query.CoreUID || neInfo.NeUID != query.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := s.neInfoService.NeRunSSHClient(neInfo.CoreUID, neInfo.NeUID)
|
||||
sshClient, err := s.neInfoService.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(err.Error()))
|
||||
return
|
||||
@@ -179,9 +175,7 @@ func (s *NeActionController) FilePull(c *gin.Context) {
|
||||
// @Tags network_element/action
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param coreUid query string true "CoreUID" default(8I73Y01Z)
|
||||
// @Param neUid query string true "NeUID" default(5AKF59BZ)
|
||||
// @Param path query string true "dir path" default(/var/log)
|
||||
// @Param neUid query string true "NE UID" default(8I73Y01Z)// @Param path query string true "dir path" default(/var/log)
|
||||
// @Param delTemp query boolean false "Delete Temp File" default(false)
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
@@ -190,27 +184,26 @@ func (s *NeActionController) FilePull(c *gin.Context) {
|
||||
// @Router /ne/action/file/pull/dirzip [get]
|
||||
func (s *NeActionController) FilePullDirZip(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var querys struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
var query struct {
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
Path string `form:"path" binding:"required"`
|
||||
DelTemp bool `form:"delTemp"` // 删除本地临时文件
|
||||
}
|
||||
if err := c.ShouldBindQuery(&querys); err != nil {
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(querys.CoreUID, querys.NeUID)
|
||||
if neInfo.CoreUID != querys.CoreUID || neInfo.NeUID != querys.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := s.neInfoService.NeRunSSHClient(neInfo.CoreUID, neInfo.NeUID)
|
||||
sshClient, err := s.neInfoService.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(err.Error()))
|
||||
return
|
||||
@@ -224,7 +217,7 @@ func (s *NeActionController) FilePullDirZip(c *gin.Context) {
|
||||
}
|
||||
defer sftpClient.Close()
|
||||
|
||||
nePath := querys.Path
|
||||
nePath := query.Path
|
||||
dirName := generate.Code(6)
|
||||
localFilePath := filepath.Join("/tmp/omc/pull/", dirName)
|
||||
if runtime.GOOS == "windows" {
|
||||
@@ -238,7 +231,7 @@ func (s *NeActionController) FilePullDirZip(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 压缩zip文件名
|
||||
zipFileName := fmt.Sprintf("%s-%s-%s.zip", neInfo.NeType, neInfo.NeUID, dirName)
|
||||
zipFileName := fmt.Sprintf("%s-%s-%s.zip", neInfo.NeType, neInfo.NeUid, dirName)
|
||||
zipFilePath := filepath.Join(localFilePath, zipFileName)
|
||||
if err := file.CompressZipByDir(zipFilePath, localDirFilePath); err != nil {
|
||||
c.JSON(200, resp.ErrMsg(err.Error()))
|
||||
@@ -246,7 +239,7 @@ func (s *NeActionController) FilePullDirZip(c *gin.Context) {
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if querys.DelTemp {
|
||||
if query.DelTemp {
|
||||
_ = os.RemoveAll(localFilePath)
|
||||
}
|
||||
}()
|
||||
@@ -271,27 +264,26 @@ func (s *NeActionController) FilePullDirZip(c *gin.Context) {
|
||||
// @Router /ne/action/file/view [get]
|
||||
func (s *NeActionController) FileView(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var querys struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
var query struct {
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
Path string `form:"path" binding:"required"`
|
||||
FileName string `form:"fileName" binding:"required"`
|
||||
}
|
||||
if err := c.ShouldBindQuery(&querys); err != nil {
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(querys.CoreUID, querys.NeUID)
|
||||
if neInfo.CoreUID != querys.CoreUID || neInfo.NeUID != querys.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := s.neInfoService.NeRunSSHClient(neInfo.CoreUID, neInfo.NeUID)
|
||||
sshClient, err := s.neInfoService.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(err.Error()))
|
||||
return
|
||||
@@ -299,7 +291,7 @@ func (s *NeActionController) FileView(c *gin.Context) {
|
||||
defer sshClient.Close()
|
||||
|
||||
// 网元端文件
|
||||
nePath := filepath.ToSlash(filepath.Join(querys.Path, querys.FileName))
|
||||
nePath := filepath.ToSlash(filepath.Join(query.Path, query.FileName))
|
||||
// 网元端临时目录
|
||||
output, err := sshClient.RunCMD(fmt.Sprintf("cat %s", nePath))
|
||||
output = strings.TrimSpace(output)
|
||||
@@ -330,29 +322,28 @@ func (s *NeActionController) FileView(c *gin.Context) {
|
||||
// @Router /ne/action/file/list [get]
|
||||
func (s *NeActionController) FileList(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var querys struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
var query struct {
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
Path string `form:"path" binding:"required"`
|
||||
PageNum int64 `form:"pageNum" binding:"required"`
|
||||
PageSize int64 `form:"pageSize" binding:"required"`
|
||||
Search string `form:"search"`
|
||||
}
|
||||
if err := c.ShouldBindQuery(&querys); err != nil {
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(querys.CoreUID, querys.NeUID)
|
||||
if neInfo.CoreUID != querys.CoreUID || neInfo.NeUID != querys.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := s.neInfoService.NeRunSSHClient(neInfo.CoreUID, neInfo.NeUID)
|
||||
sshClient, err := s.neInfoService.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(err.Error()))
|
||||
return
|
||||
@@ -360,10 +351,10 @@ func (s *NeActionController) FileList(c *gin.Context) {
|
||||
defer sshClient.Close()
|
||||
|
||||
// 获取文件列表
|
||||
rows, err := ssh.FileList(sshClient, querys.Path, querys.Search)
|
||||
rows, err := ssh.FileList(sshClient, query.Path, query.Search)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.OkData(map[string]any{
|
||||
"path": querys.Path,
|
||||
"path": query.Path,
|
||||
"total": len(rows),
|
||||
"rows": []ssh.FileListRow{},
|
||||
}))
|
||||
@@ -372,8 +363,8 @@ func (s *NeActionController) FileList(c *gin.Context) {
|
||||
|
||||
// 对数组进行切片分页
|
||||
lenNum := int64(len(rows))
|
||||
start := (querys.PageNum - 1) * querys.PageSize
|
||||
end := start + querys.PageSize
|
||||
start := (query.PageNum - 1) * query.PageSize
|
||||
end := start + query.PageSize
|
||||
var splitRows []ssh.FileListRow
|
||||
if start >= lenNum {
|
||||
splitRows = []ssh.FileListRow{}
|
||||
@@ -384,7 +375,7 @@ func (s *NeActionController) FileList(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(200, resp.OkData(map[string]any{
|
||||
"path": querys.Path,
|
||||
"path": query.Path,
|
||||
"total": lenNum,
|
||||
"rows": splitRows,
|
||||
}))
|
||||
@@ -406,7 +397,6 @@ func (s *NeActionController) FileList(c *gin.Context) {
|
||||
func (s *NeActionController) Service(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
|
||||
Action string `json:"action" binding:"required,oneof=start restart stop reboot poweroff"` // 操作行为
|
||||
}
|
||||
@@ -417,8 +407,8 @@ func (s *NeActionController) Service(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
|
||||
if neInfo.CoreUID != body.CoreUID || neInfo.NeUID != body.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(body.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != body.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
@@ -443,7 +433,7 @@ func (s *NeActionController) Service(c *gin.Context) {
|
||||
cmdStr = "sudo shutdown -h now"
|
||||
}
|
||||
|
||||
_, err := s.neInfoService.NeRunSSHCmd(neInfo.CoreUID, neInfo.NeUID, cmdStr)
|
||||
_, err := s.neInfoService.NeRunSSHCmd(neInfo.ID, cmdStr)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(err.Error()))
|
||||
return
|
||||
|
||||
@@ -197,7 +197,6 @@ func (s NeConfigController) ListByNeType(c *gin.Context) {
|
||||
func (s NeConfigController) DataInfo(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
ParamName string `form:"paramName" binding:"required"` // 可用属性
|
||||
}
|
||||
@@ -207,8 +206,8 @@ func (s NeConfigController) DataInfo(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(query.CoreUID, query.NeUID)
|
||||
if neInfo.CoreUID != query.CoreUID || neInfo.NeUID != query.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
@@ -245,7 +244,6 @@ func (s NeConfigController) DataInfo(c *gin.Context) {
|
||||
func (s NeConfigController) DataEdit(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
|
||||
ParamName string `json:"paramName" binding:"required"`
|
||||
ParamData map[string]any `json:"paramData" binding:"required"`
|
||||
@@ -257,8 +255,8 @@ func (s NeConfigController) DataEdit(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
|
||||
if neInfo.CoreUID != body.CoreUID || neInfo.NeUID != body.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(body.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != body.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
@@ -301,7 +299,6 @@ func (s NeConfigController) DataEdit(c *gin.Context) {
|
||||
func (s NeConfigController) DataAdd(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
|
||||
ParamName string `json:"paramName" binding:"required"` // 根据配置可选值
|
||||
ParamData map[string]any `json:"paramData" binding:"required"` // 数据对象
|
||||
@@ -313,8 +310,8 @@ func (s NeConfigController) DataAdd(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
|
||||
if neInfo.CoreUID != body.CoreUID || neInfo.NeUID != body.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(body.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != body.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
@@ -360,7 +357,6 @@ func (s NeConfigController) DataAdd(c *gin.Context) {
|
||||
func (s NeConfigController) DataRemove(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
ParamName string `form:"paramName" binding:"required"`
|
||||
Loc string `form:"loc" binding:"required"` // 与数据对象内index一致,有多层时划分嵌套层(index/subParamName/index)
|
||||
@@ -371,8 +367,8 @@ func (s NeConfigController) DataRemove(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(query.CoreUID, query.NeUID)
|
||||
if neInfo.CoreUID != query.CoreUID || neInfo.NeUID != query.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"be.ems/src/framework/reqctx"
|
||||
"be.ems/src/framework/resp"
|
||||
"be.ems/src/framework/utils/file"
|
||||
"be.ems/src/framework/utils/parse"
|
||||
"be.ems/src/modules/ne/model"
|
||||
neService "be.ems/src/modules/ne/service"
|
||||
|
||||
@@ -35,11 +36,6 @@ type NeConfigBackupController struct {
|
||||
// GET /list
|
||||
func (s NeConfigBackupController) List(c *gin.Context) {
|
||||
query := reqctx.QueryMap(c)
|
||||
coreUid, coreUidOk := query["coreUid"]
|
||||
if !coreUidOk || coreUid == "" {
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: coreUid is empty"))
|
||||
return
|
||||
}
|
||||
rows, total := s.neConfigBackupService.FindByPage(query)
|
||||
c.JSON(200, resp.OkData(map[string]any{"rows": rows, "total": total}))
|
||||
}
|
||||
@@ -50,8 +46,6 @@ func (s NeConfigBackupController) List(c *gin.Context) {
|
||||
func (s NeConfigBackupController) Download(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
ID int64 `form:"id" binding:"required"` // 记录ID
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
@@ -62,8 +56,6 @@ func (s NeConfigBackupController) Download(c *gin.Context) {
|
||||
|
||||
// 检查是否存在
|
||||
rows := s.neConfigBackupService.Find(model.NeConfigBackup{
|
||||
CoreUID: query.CoreUID,
|
||||
NeUID: query.NeUID,
|
||||
ID: query.ID,
|
||||
})
|
||||
if len(rows) <= 0 {
|
||||
@@ -85,8 +77,6 @@ func (s NeConfigBackupController) Download(c *gin.Context) {
|
||||
func (s NeConfigBackupController) Edit(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
|
||||
ID int64 `json:"id" binding:"required"` // 记录ID
|
||||
Name string `json:"name" binding:"required"` // 名称
|
||||
Remark string `json:"remark" binding:"required"` // 备注
|
||||
@@ -99,8 +89,6 @@ func (s NeConfigBackupController) Edit(c *gin.Context) {
|
||||
|
||||
// 检查是否存在
|
||||
rows := s.neConfigBackupService.Find(model.NeConfigBackup{
|
||||
CoreUID: body.CoreUID,
|
||||
NeUID: body.NeUID,
|
||||
ID: body.ID,
|
||||
})
|
||||
if len(rows) <= 0 {
|
||||
@@ -125,9 +113,7 @@ func (s NeConfigBackupController) Edit(c *gin.Context) {
|
||||
func (s NeConfigBackupController) Remove(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
ID int64 `form:"id" binding:"required"` // 记录ID
|
||||
ID string `form:"id" binding:"required"` // 记录ID 批量多个逗号分隔
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
@@ -135,7 +121,15 @@ func (s NeConfigBackupController) Remove(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
rows, err := s.neConfigBackupService.DeleteByIds(query.ID, query.CoreUID, query.NeUID)
|
||||
// 处理字符转id数组后去重
|
||||
uniqueIDs := parse.RemoveDuplicatesToArray(query.ID, ",")
|
||||
// 转换成int64数组类型
|
||||
ids := make([]int64, 0)
|
||||
for _, v := range uniqueIDs {
|
||||
ids = append(ids, parse.Number(v))
|
||||
}
|
||||
|
||||
rows, err := s.neConfigBackupService.DeleteByIds(ids)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, err.Error())))
|
||||
return
|
||||
@@ -150,7 +144,6 @@ func (s NeConfigBackupController) Remove(c *gin.Context) {
|
||||
func (s NeConfigBackupController) Import(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
|
||||
Type string `json:"type" binding:"required,oneof=backup upload"` // 导入类型 backup upload
|
||||
Path string `json:"path" binding:"required"` // 备份文件zip文件路径
|
||||
@@ -166,8 +159,8 @@ func (s NeConfigBackupController) Import(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 查网元
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
|
||||
if neInfo.CoreUID != body.CoreUID || neInfo.NeUID != body.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(body.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != body.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
@@ -189,7 +182,6 @@ func (s NeConfigBackupController) Import(c *gin.Context) {
|
||||
func (s NeConfigBackupController) Export(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
|
||||
}
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
@@ -198,8 +190,8 @@ func (s NeConfigBackupController) Export(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
// 查网元
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
|
||||
if neInfo.CoreUID != body.CoreUID || neInfo.NeUID != body.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(body.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != body.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
@@ -211,9 +203,7 @@ func (s NeConfigBackupController) Export(c *gin.Context) {
|
||||
}
|
||||
// 新增备份记录
|
||||
item := model.NeConfigBackup{
|
||||
CoreUID: neInfo.CoreUID,
|
||||
NeUID: neInfo.NeUID,
|
||||
NeType: neInfo.NeType,
|
||||
NeID: neInfo.ID,
|
||||
Name: filepath.Base(zipFilePath),
|
||||
Path: zipFilePath,
|
||||
CreateBy: reqctx.LoginUserToUserName(c),
|
||||
|
||||
@@ -38,9 +38,7 @@ var mutex sync.Mutex
|
||||
// @Tags network_element/info
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param coreUid query string true "CoreUID" default(8I73Y01Z)
|
||||
// @Param neUid query string true "NeUID" default(5AKF59BZ)
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Param neUid query string true "NE UID" default(8I73Y01Z)// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Network element information state
|
||||
// @Description Network element information state
|
||||
@@ -48,7 +46,6 @@ var mutex sync.Mutex
|
||||
func (s NeInfoController) State(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
@@ -57,12 +54,12 @@ func (s NeInfoController) State(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(query.CoreUID, query.NeUID)
|
||||
if neInfo.CoreUID != query.CoreUID || neInfo.NeUID != query.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
neKey := fmt.Sprintf("%s_%s", neInfo.CoreUID, neInfo.NeUID)
|
||||
neKey := fmt.Sprintf("%s_%s", neInfo.NeUid, neInfo.NeType)
|
||||
|
||||
// 网元直连
|
||||
resData, err := neFetchlink.NeState(neInfo)
|
||||
@@ -75,11 +72,12 @@ func (s NeInfoController) State(c *gin.Context) {
|
||||
} else {
|
||||
resDataCache = map[string]any{
|
||||
"online": false,
|
||||
"coreUid": neInfo.CoreUID,
|
||||
"neUid": neInfo.NeUID,
|
||||
"coreId": neInfo.CoreId,
|
||||
"neId": neInfo.ID,
|
||||
"neUid": neInfo.NeUid,
|
||||
"neType": neInfo.NeType,
|
||||
"neName": neInfo.NeName,
|
||||
"ipAddr": neInfo.IPAddr,
|
||||
"ipAddr": neInfo.IpAddr,
|
||||
}
|
||||
}
|
||||
neStateCacheMap.Store(neKey, resDataCache)
|
||||
@@ -103,9 +101,7 @@ func (s NeInfoController) State(c *gin.Context) {
|
||||
// @Tags network_element/info
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param coreUid query string true "CoreUID" default(8I73Y01Z)
|
||||
// @Param neUid query string true "NeUID" default(5AKF59BZ)
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Param neUid query string true "NE UID" default(8I73Y01Z)// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Network element neType and neID queries
|
||||
// @Description Network element neType and neID queries
|
||||
@@ -113,7 +109,6 @@ func (s NeInfoController) State(c *gin.Context) {
|
||||
func (s NeInfoController) Nf(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
@@ -122,8 +117,8 @@ func (s NeInfoController) Nf(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(query.CoreUID, query.NeUID)
|
||||
if neInfo.CoreUID != query.CoreUID || neInfo.NeUID != query.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
@@ -137,9 +132,7 @@ func (s NeInfoController) Nf(c *gin.Context) {
|
||||
// @Tags network_element/info
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param coreUid query string true "CoreUID" default(8I73Y01Z)
|
||||
// @Param neUid query string true "NeUID" default(5AKF59BZ)
|
||||
// @Param neType query string true "NE Type"
|
||||
// @Param neUid query string true "NE UID" default(8I73Y01Z)// @Param neType query string true "NE Type"
|
||||
// @Param bandStatus query boolean true "With status information"
|
||||
// @Param bandHost query boolean true "With host information"
|
||||
// @Success 200 {object} object "Response Results"
|
||||
@@ -150,8 +143,8 @@ func (s NeInfoController) Nf(c *gin.Context) {
|
||||
func (s NeInfoController) ListAll(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var querys struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid"` // 网元唯一标识
|
||||
CoreId int64 `form:"coreId"` // 核心网唯一标识
|
||||
NeUid string `form:"neUid"` // 网元唯一标识
|
||||
NeType string `form:"neType"`
|
||||
BandStatus bool `form:"bandStatus"`
|
||||
BandHost bool `form:"bandHost"`
|
||||
@@ -164,11 +157,11 @@ func (s NeInfoController) ListAll(c *gin.Context) {
|
||||
|
||||
// 查询实体参数
|
||||
ne := model.NeInfo{}
|
||||
if querys.CoreUID != "" {
|
||||
ne.CoreUID = querys.CoreUID
|
||||
if querys.CoreId != 0 {
|
||||
ne.CoreId = querys.CoreId
|
||||
}
|
||||
if querys.NeUID != "" {
|
||||
ne.NeUID = querys.NeUID
|
||||
if querys.NeUid != "" {
|
||||
ne.NeUid = querys.NeUid
|
||||
}
|
||||
if querys.NeType != "" {
|
||||
ne.NeType = querys.NeType
|
||||
@@ -178,9 +171,121 @@ func (s NeInfoController) ListAll(c *gin.Context) {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
// 过滤屏蔽授权文件
|
||||
arr := &neList
|
||||
for i := range *arr {
|
||||
(*arr)[i].ActivationRequestCode = "-"
|
||||
(*arr)[i].LicensePath = "-"
|
||||
}
|
||||
|
||||
c.JSON(200, resp.OkData(neList))
|
||||
}
|
||||
|
||||
// 网元授权激活授权申请码
|
||||
//
|
||||
// GET /license/code
|
||||
//
|
||||
// @Tags network_element/license
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param neType query string true "NE Type" Enums(IMS,AMF,AUSF,UDM,SMF,PCF,NSSF,NRF,UPF,MME,CBC,OMC,SGWC,SMSC)
|
||||
// @Param neId query string true "NE ID" default(001)
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Network Element License Activation License Application Code
|
||||
// @Description Network Element License Activation License Application Code
|
||||
// @Router /ne/info/license/code [get]
|
||||
func (s NeInfoController) LicenseCode(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
// 读取授权码
|
||||
code, licensePath := s.neInfoService.NeConfLicenseRead(neInfo)
|
||||
// 更新授权码
|
||||
if code != "" && licensePath != "" && neInfo.ActivationRequestCode != code {
|
||||
// 检查是否存在
|
||||
neInfo = s.neInfoService.FindById(neInfo.ID, false)
|
||||
if neInfo.ID == 0 || neInfo.NeUid == "" {
|
||||
// 没有可访问网元信息数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neInfo.noData")))
|
||||
return
|
||||
}
|
||||
neInfo.ActivationRequestCode = code
|
||||
neInfo.LicensePath = licensePath
|
||||
neInfo.UpdateBy = reqctx.LoginUserToUserName(c)
|
||||
s.neInfoService.Update(neInfo)
|
||||
}
|
||||
c.JSON(200, resp.OkData(code))
|
||||
}
|
||||
|
||||
// 网元授权激活授权文件替换
|
||||
//
|
||||
// POST /license/update
|
||||
//
|
||||
// @Tags network_element/license
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param data body object true "Request Param"
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Network element authorization activation status
|
||||
// @Description Network element authorization activation status
|
||||
// @Router /ne/license/update [post]
|
||||
func (s NeInfoController) LicenseUpdate(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
|
||||
LicensePath string `json:"licensePath"` // 上传的文件路径
|
||||
Reload bool `json:"reload"` // 刷新重启网元
|
||||
}
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByNeUid(body.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != body.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
// 进行上传替换
|
||||
neInfo.LicensePath = body.LicensePath
|
||||
err := s.neInfoService.NeConfLicenseUpload(neInfo, body.Reload)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否存在
|
||||
neInfo = s.neInfoService.FindById(neInfo.ID, false)
|
||||
if neInfo.ID == 0 || neInfo.NeUid == "" {
|
||||
// 没有可访问网元信息数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neInfo.noData")))
|
||||
return
|
||||
}
|
||||
neInfo.LicensePath = body.LicensePath
|
||||
neInfo.UpdateBy = reqctx.LoginUserToUserName(c)
|
||||
s.neInfoService.Update(neInfo)
|
||||
c.JSON(200, resp.Ok(nil))
|
||||
}
|
||||
|
||||
// 网元端Para5G配置文件读取
|
||||
//
|
||||
// GET /file/para5g
|
||||
@@ -199,7 +304,7 @@ func (s NeInfoController) Para5GFileRead(c *gin.Context) {
|
||||
func (s NeInfoController) Para5GFileWrite(c *gin.Context) {
|
||||
var body struct {
|
||||
Content map[string]any `json:"content" binding:"required"` // 内容
|
||||
SyncNE []string `json:"syncNe"` // 同步到网元
|
||||
SyncNE []string `json:"syncNe"` // 同步到网元neUid,neUid网元唯一标识
|
||||
}
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
@@ -219,17 +324,24 @@ func (s NeInfoController) Para5GFileWrite(c *gin.Context) {
|
||||
//
|
||||
// GET /file/oam
|
||||
func (s NeInfoController) OAMFileRead(c *gin.Context) {
|
||||
var querys struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
}
|
||||
if err := c.ShouldBindQuery(&querys); err != nil {
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
data, err := s.neInfoService.NeConfOAMReadSync(querys.CoreUID, querys.NeUID)
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
data, err := s.neInfoService.NeConfOAMReadSync(neInfo)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(err.Error()))
|
||||
return
|
||||
@@ -243,8 +355,7 @@ func (s NeInfoController) OAMFileRead(c *gin.Context) {
|
||||
func (s NeInfoController) OAMFileWrite(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
Content map[string]any `json:"content" binding:"required"` // 内容
|
||||
Sync bool `json:"sync"` // 同步到网元
|
||||
}
|
||||
@@ -255,8 +366,8 @@ func (s NeInfoController) OAMFileWrite(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
|
||||
if neInfo.CoreUID != body.CoreUID || neInfo.NeUID != body.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(body.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != body.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
@@ -288,16 +399,19 @@ func (s NeInfoController) OAMFileWrite(c *gin.Context) {
|
||||
// @Router /ne/info/list [get]
|
||||
func (s NeInfoController) List(c *gin.Context) {
|
||||
query := reqctx.QueryMap(c)
|
||||
coreUid, coreUidOk := query["coreUid"]
|
||||
if !coreUidOk || coreUid == "" {
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: coreUid is empty"))
|
||||
return
|
||||
}
|
||||
bandStatus := false
|
||||
if v, ok := query["bandStatus"]; ok {
|
||||
bandStatus = parse.Boolean(v)
|
||||
}
|
||||
rows, total := s.neInfoService.FindByPage(query, bandStatus)
|
||||
|
||||
// 过滤屏蔽授权文件
|
||||
arr := &rows
|
||||
for i := range *arr {
|
||||
(*arr)[i].ActivationRequestCode = "-"
|
||||
(*arr)[i].LicensePath = "-"
|
||||
}
|
||||
|
||||
c.JSON(200, resp.OkData(map[string]any{"rows": rows, "total": total}))
|
||||
}
|
||||
|
||||
@@ -317,7 +431,6 @@ func (s NeInfoController) List(c *gin.Context) {
|
||||
func (s NeInfoController) Info(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
ID int64 `form:"id" binding:"required"` // ID
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
@@ -327,7 +440,7 @@ func (s NeInfoController) Info(c *gin.Context) {
|
||||
}
|
||||
|
||||
info := s.neInfoService.FindById(query.ID, true)
|
||||
if info.ID != query.ID || info.CoreUID != query.CoreUID {
|
||||
if info.ID != query.ID {
|
||||
// 没有可访问网元信息数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neInfo.noData")))
|
||||
return
|
||||
@@ -361,10 +474,6 @@ func (s NeInfoController) Add(c *gin.Context) {
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: id not is empty"))
|
||||
return
|
||||
}
|
||||
if body.CoreUID == "" {
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: coreUid is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
body.CreateBy = reqctx.LoginUserToUserName(c)
|
||||
insertId := s.neInfoService.Insert(body)
|
||||
@@ -410,8 +519,6 @@ func (s NeInfoController) Edit(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
body.CoreUID = neInfo.CoreUID
|
||||
body.NeUID = neInfo.NeUID
|
||||
body.UpdateBy = reqctx.LoginUserToUserName(c)
|
||||
rows := s.neInfoService.Update(body)
|
||||
if rows > 0 {
|
||||
@@ -423,7 +530,7 @@ func (s NeInfoController) Edit(c *gin.Context) {
|
||||
|
||||
// 网元信息删除
|
||||
//
|
||||
// DELETE /:id
|
||||
// DELETE /
|
||||
//
|
||||
// @Tags network_element/info
|
||||
// @Accept json
|
||||
@@ -437,8 +544,6 @@ func (s NeInfoController) Edit(c *gin.Context) {
|
||||
func (s NeInfoController) Remove(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
ID string `form:"id" binding:"required"` // 记录ID 批量多个逗号分隔
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
@@ -455,7 +560,7 @@ func (s NeInfoController) Remove(c *gin.Context) {
|
||||
ids = append(ids, parse.Number(v))
|
||||
}
|
||||
|
||||
rows, err := s.neInfoService.DeleteByIds(ids, query.CoreUID, query.NeUID)
|
||||
rows, err := s.neInfoService.DeleteByIds(ids)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, err.Error())))
|
||||
return
|
||||
|
||||
@@ -1,302 +0,0 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"be.ems/src/framework/i18n"
|
||||
"be.ems/src/framework/reqctx"
|
||||
"be.ems/src/framework/resp"
|
||||
"be.ems/src/framework/utils/parse"
|
||||
"be.ems/src/modules/ne/model"
|
||||
"be.ems/src/modules/ne/service"
|
||||
neFetchlink "be.ems/src/modules/ne_data_nf/fetch_link"
|
||||
)
|
||||
|
||||
// 实例化控制层 NeLicenseController 结构体
|
||||
var NewNeLicense = &NeLicenseController{
|
||||
neLicenseService: service.NewNeLicense,
|
||||
neInfoService: service.NewNeInfo,
|
||||
}
|
||||
|
||||
// 网元授权激活请求
|
||||
//
|
||||
// PATH /license
|
||||
type NeLicenseController struct {
|
||||
neLicenseService *service.NeLicense // 网元授权激活服务
|
||||
neInfoService *service.NeInfo // 网元信息服务
|
||||
}
|
||||
|
||||
// 网元授权激活列表
|
||||
//
|
||||
// GET /list
|
||||
//
|
||||
// @Tags network_element/license
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param neType query string false "NE Type" Enums(IMS,AMF,AUSF,UDM,SMF,PCF,NSSF,NRF,UPF,MME,CBC,OMC,SGWC,SMSC)
|
||||
// @Param neId query string false "NE ID"
|
||||
// @Param expiryDate query string false "ExpiryDate"
|
||||
// @Param pageNum query number true "pageNum" default(1)
|
||||
// @Param pageSize query number true "pageSize" default(10)
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Net Element License Activation List
|
||||
// @Description Net Element License Activation List
|
||||
// @Router /ne/license/list [get]
|
||||
func (s *NeLicenseController) List(c *gin.Context) {
|
||||
query := reqctx.QueryMap(c)
|
||||
coreUid, coreUidOk := query["coreUid"]
|
||||
if !coreUidOk || coreUid == "" {
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: coreUid is empty"))
|
||||
return
|
||||
}
|
||||
rows, total := s.neLicenseService.FindByPage(query)
|
||||
|
||||
// 过滤屏蔽授权文件
|
||||
arr := &rows
|
||||
for i := range *arr {
|
||||
(*arr)[i].ActivationRequestCode = "-"
|
||||
(*arr)[i].LicensePath = "-"
|
||||
}
|
||||
|
||||
c.JSON(200, resp.OkData(map[string]any{"total": total, "rows": rows}))
|
||||
}
|
||||
|
||||
// 网元授权激活信息
|
||||
//
|
||||
// GET /
|
||||
func (s *NeLicenseController) Info(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
ID int64 `form:"id" binding:"required"` // ID
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
neLicense := s.neLicenseService.FindById(query.ID)
|
||||
if neLicense.ID != query.ID || neLicense.CoreUID != query.CoreUID {
|
||||
// 没有可访问网元授权激活数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neLicense.noData")))
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(200, resp.OkData(neLicense))
|
||||
}
|
||||
|
||||
// 网元信息查询
|
||||
//
|
||||
// GET /nf
|
||||
//
|
||||
// @Tags network_element/license
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param coreUid query string true "CoreUID" default(8I73Y01Z)
|
||||
// @Param neUid query string true "NeUID" default(5AKF59BZ)
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Network element neType and neID queries
|
||||
// @Description Network element neType and neID queries
|
||||
// @Router /ne/license/nf [get]
|
||||
func (s *NeLicenseController) Nf(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var querys struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
}
|
||||
if err := c.ShouldBindQuery(&querys); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
neLicense := s.neLicenseService.FindByCoreUidAndNeUid(querys.CoreUID, querys.NeUID)
|
||||
if neLicense.CoreUID != querys.CoreUID || neLicense.NeUID != querys.NeUID {
|
||||
// 没有可访问网元授权激活数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neLicense.noData")))
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(200, resp.OkData(neLicense))
|
||||
}
|
||||
|
||||
// 网元授权激活授权申请码
|
||||
//
|
||||
// GET /code
|
||||
//
|
||||
// @Tags network_element/license
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param neType query string true "NE Type" Enums(IMS,AMF,AUSF,UDM,SMF,PCF,NSSF,NRF,UPF,MME,CBC,OMC,SGWC,SMSC)
|
||||
// @Param neId query string true "NE ID" default(001)
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Network Element License Activation License Application Code
|
||||
// @Description Network Element License Activation License Application Code
|
||||
// @Router /ne/license/code [get]
|
||||
func (s *NeLicenseController) Code(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var querys struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
}
|
||||
if err := c.ShouldBindQuery(&querys); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否存在授权记录
|
||||
neLicense := s.neLicenseService.FindByCoreUidAndNeUid(querys.CoreUID, querys.NeUID)
|
||||
if neLicense.CoreUID != querys.CoreUID || neLicense.NeUID != querys.NeUID {
|
||||
// 没有可访问网元授权激活数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neLicense.noData")))
|
||||
return
|
||||
}
|
||||
|
||||
// 更新授权码
|
||||
code, licensePath := s.neLicenseService.ReadLicenseInfo(neLicense)
|
||||
neLicense.ActivationRequestCode = code
|
||||
if licensePath != "" {
|
||||
neLicense.LicensePath = licensePath
|
||||
} else {
|
||||
neLicense.SerialNum = ""
|
||||
neLicense.ExpiryDate = ""
|
||||
neLicense.UeNumber = 0
|
||||
neLicense.NbNumber = 0
|
||||
neLicense.Status = "0"
|
||||
}
|
||||
neLicense.UpdateBy = reqctx.LoginUserToUserName(c)
|
||||
s.neLicenseService.Update(neLicense)
|
||||
|
||||
c.JSON(200, resp.OkData(code))
|
||||
}
|
||||
|
||||
// 网元授权激活授权文件替换
|
||||
//
|
||||
// POST /change
|
||||
//
|
||||
// @Tags network_element/license
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param data body object true "Request Param"
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Network element authorization activation status
|
||||
// @Description Network element authorization activation status
|
||||
// @Router /ne/license/change [post]
|
||||
func (s *NeLicenseController) Change(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body model.NeLicense
|
||||
err := c.ShouldBindBodyWithJSON(&body)
|
||||
if err != nil || body.LicensePath == "" {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否存在授权记录
|
||||
neLicense := s.neLicenseService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
|
||||
if neLicense.CoreUID != body.CoreUID || neLicense.NeUID != body.NeUID {
|
||||
// 没有可访问网元授权激活数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neLicense.noData")))
|
||||
return
|
||||
}
|
||||
|
||||
// 更新授权记录
|
||||
if body.Remark != "" {
|
||||
neLicense.Remark = body.Remark
|
||||
}
|
||||
neLicense.LicensePath = body.LicensePath
|
||||
neLicense.Status = "0"
|
||||
neLicense.UpdateBy = reqctx.LoginUserToUserName(c)
|
||||
upRows := s.neLicenseService.Update(neLicense)
|
||||
if upRows > 0 {
|
||||
// 进行上传替换
|
||||
err = s.neLicenseService.UploadLicense(body)
|
||||
if err != nil {
|
||||
c.JSON(200, resp.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
c.JSON(200, resp.Ok(nil))
|
||||
return
|
||||
}
|
||||
c.JSON(200, resp.Err(nil))
|
||||
}
|
||||
|
||||
// 网元授权激活状态
|
||||
//
|
||||
// GET /state
|
||||
//
|
||||
// @Tags network_element/license
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param neType query string true "NE Type" Enums(IMS,AMF,AUSF,UDM,SMF,PCF,NSSF,NRF,UPF,MME,CBC,OMC,SGWC,SMSC)
|
||||
// @Param neId query string true "NE ID" default(001)
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Network element authorization activation status
|
||||
// @Description Network element authorization activation status
|
||||
// @Router /ne/license/state [get]
|
||||
func (s *NeLicenseController) State(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var querys struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
}
|
||||
if err := c.ShouldBindQuery(&querys); err != nil {
|
||||
c.JSON(400, resp.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否存在授权记录
|
||||
neLicense := s.neLicenseService.FindByCoreUidAndNeUid(querys.CoreUID, querys.NeUID)
|
||||
if neLicense.CoreUID != querys.CoreUID || neLicense.NeUID != querys.NeUID {
|
||||
// 没有可访问网元授权激活数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neLicense.noData")))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元获取IP获取网元状态
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(neLicense.CoreUID, neLicense.NeUID)
|
||||
if neInfo.CoreUID != neLicense.CoreUID || neInfo.NeUID != neLicense.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
if neState, err := neFetchlink.NeState(neInfo); err == nil && neState["sn"] != nil {
|
||||
neLicense.Status = "1"
|
||||
neLicense.SerialNum = fmt.Sprint(neState["sn"])
|
||||
neLicense.ExpiryDate = fmt.Sprint(neState["expire"])
|
||||
neLicense.UeNumber = parse.Number(neState["ueNumber"])
|
||||
neLicense.NbNumber = parse.Number(neState["nbNumber"])
|
||||
} else {
|
||||
neLicense.Status = "0"
|
||||
}
|
||||
// 更新授权码
|
||||
if neLicense.ActivationRequestCode == "" || strings.HasPrefix(neLicense.ActivationRequestCode, "SN") || neLicense.Status == "0" {
|
||||
code, licensePath := s.neLicenseService.ReadLicenseInfo(neLicense)
|
||||
neLicense.ActivationRequestCode = code
|
||||
neLicense.LicensePath = licensePath
|
||||
}
|
||||
|
||||
// 更新授权信息
|
||||
neLicense.UpdateBy = reqctx.LoginUserToUserName(c)
|
||||
s.neLicenseService.Update(neLicense)
|
||||
|
||||
if neLicense.Status == "1" {
|
||||
c.JSON(200, resp.OkData(map[string]any{
|
||||
"sn": neLicense.SerialNum,
|
||||
"expire": neLicense.ExpiryDate,
|
||||
"ueNumber": neLicense.UeNumber,
|
||||
"nbNumber": neLicense.NbNumber,
|
||||
}))
|
||||
return
|
||||
}
|
||||
c.JSON(200, resp.ErrMsg(fmt.Sprintf("%s service status exception", neLicense.NeType)))
|
||||
}
|
||||
@@ -221,10 +221,8 @@ func (s NeSoftwareController) NewNeVersion(c *gin.Context) {
|
||||
})
|
||||
if len(neSoftwares) > 0 {
|
||||
neSoftware := neSoftwares[0]
|
||||
s.neSoftwareService.UpdateVersions(neSoftware, model.NeVersion{
|
||||
NeType: neSoftware.NeType,
|
||||
UpdateBy: reqctx.LoginUserToUserName(c),
|
||||
})
|
||||
neSoftware.UpdateBy = reqctx.LoginUserToUserName(c)
|
||||
s.neSoftwareService.UpdateVersion(neSoftware)
|
||||
c.JSON(200, resp.Ok(nil))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -29,11 +29,6 @@ type NeVersionController struct {
|
||||
// GET /list
|
||||
func (s *NeVersionController) List(c *gin.Context) {
|
||||
query := reqctx.QueryMap(c)
|
||||
coreUid, coreUidOk := query["coreUid"]
|
||||
if !coreUidOk || coreUid == "" {
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: coreUid is empty"))
|
||||
return
|
||||
}
|
||||
checkVersion := true
|
||||
if v, ok := query["checkVersion"]; ok {
|
||||
checkVersion = parse.Boolean(v)
|
||||
@@ -48,7 +43,6 @@ func (s *NeVersionController) List(c *gin.Context) {
|
||||
func (s *NeVersionController) Info(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
ID int64 `form:"id" binding:"required"` // 记录ID
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
@@ -58,7 +52,7 @@ func (s *NeVersionController) Info(c *gin.Context) {
|
||||
}
|
||||
|
||||
neVersion := s.neVersionService.FindById(query.ID)
|
||||
if neVersion.ID != query.ID || neVersion.CoreUID != query.CoreUID {
|
||||
if neVersion.ID != query.ID {
|
||||
// 没有可访问网元版本数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neVersion.noData")))
|
||||
return
|
||||
@@ -72,18 +66,17 @@ func (s *NeVersionController) Info(c *gin.Context) {
|
||||
// GET /nf
|
||||
func (s *NeVersionController) Nf(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var querys struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
var query struct {
|
||||
NeUID string `form:"neUid" binding:"required"` // 网元唯一标识
|
||||
}
|
||||
if err := c.ShouldBindQuery(&querys); err != nil {
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
neVersion := s.neVersionService.FindByCoreUidAndNeUid(querys.CoreUID, querys.NeUID)
|
||||
if neVersion.CoreUID != querys.CoreUID || neVersion.NeUID != querys.NeUID {
|
||||
neVersion := s.neVersionService.FindByNeUid(query.NeUID)
|
||||
if neVersion.ID <= 0 {
|
||||
// 没有可访问网元授权激活数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neLicense.noData")))
|
||||
return
|
||||
@@ -108,8 +101,7 @@ func (s *NeVersionController) Nf(c *gin.Context) {
|
||||
func (s *NeVersionController) Operate(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
|
||||
NeID int64 `json:"neId" binding:"required"` // 网元唯一标识
|
||||
Action string `json:"action" binding:"required,oneof=install upgrade rollback"` // 操作行为
|
||||
Preinput map[string]string `json:"preinput" ` // 预先输入参数
|
||||
}
|
||||
@@ -119,8 +111,8 @@ func (s *NeVersionController) Operate(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
neVersion := s.neVersionService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
|
||||
if neVersion.CoreUID != body.CoreUID || neVersion.NeUID != body.NeUID {
|
||||
neVersion := s.neVersionService.FindByNeId(body.NeID)
|
||||
if neVersion.NeID != body.NeID {
|
||||
// 没有可访问网元版本数据!
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "neVersion.noData")))
|
||||
return
|
||||
|
||||
@@ -3,9 +3,7 @@ package model
|
||||
// NeConfigBackup 网元配置文件备份记录 ne_config_backup
|
||||
type NeConfigBackup struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||
CoreUID string `json:"coreUid" gorm:"column:core_uid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" gorm:"column:ne_uid" binding:"required"` // 网元唯一标识
|
||||
NeType string `json:"neType" gorm:"column:ne_type" binding:"required"` // 网元类型
|
||||
NeID int64 `json:"neId" gorm:"column:ne_id" binding:"required"` // 网元ID
|
||||
Name string `json:"name" gorm:"column:name"` // 压缩包名称
|
||||
Path string `json:"path" gorm:"column:path"` // 压缩包位置
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
|
||||
@@ -1,34 +1,37 @@
|
||||
package model
|
||||
|
||||
// NeInfo 网元信息对象 ne_info
|
||||
// NeInfo 网元_基础信息表 关联创建版本、主机
|
||||
type NeInfo struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"` // 网元ID
|
||||
CoreUID string `json:"coreUid" gorm:"column:core_uid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" gorm:"column:ne_uid"` // 网元唯一标识
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
CoreId int64 `json:"coreId" gorm:"column:core_id"` // 核心网ID 1为全局默认
|
||||
NeUid string `json:"neUid" gorm:"column:ne_uid"` // 网元唯一标识
|
||||
NeType string `json:"neType" gorm:"column:ne_type" binding:"required"` // 网元类型
|
||||
NeName string `json:"neName" gorm:"column:ne_name"` // 网元名称
|
||||
IPAddr string `json:"ipAddr" gorm:"column:ip_addr" binding:"required"` // 网元服务IP
|
||||
Port int64 `json:"port" gorm:"column:port" binding:"required,number,max=65535,min=1"` // 端口
|
||||
IpAddr string `json:"ipAddr" gorm:"column:ip_addr" binding:"required"` // 网元服务IP
|
||||
Port int64 `json:"port" gorm:"column:port"` // 端口
|
||||
PvFlag string `json:"pvFlag" gorm:"column:pv_flag" binding:"omitempty,oneof=PNF VNF"` // 网元虚拟化标识 物理PNF 虚拟VNF
|
||||
Province string `json:"province" gorm:"column:province"` // 省份地域
|
||||
VendorName string `json:"vendorName" gorm:"column:vendor_name"` // 厂商名称
|
||||
Dn string `json:"dn" gorm:"column:dn"` // 网络标识
|
||||
MacAddr string `json:"macAddr" gorm:"column:mac_addr"` // MAC地址
|
||||
HostIDs string `json:"hostIds" gorm:"column:host_ids"` // 网元主机ID组 数据格式(ssh,telnet) UDM(ssh,telnet,redis) UPF(ssh,telnet,telnet)
|
||||
Status int64 `json:"status" gorm:"column:status"` // 网元状态 0离线 1在线 2配置待下发 3备用模式
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
ActivationRequestCode string `json:"activationRequestCode" gorm:"column:activation_request_code"` // 激活申请代码
|
||||
LicensePath string `json:"licensePath" gorm:"column:license_path"` // 激活授权文件
|
||||
SerialNum string `json:"serialNum" gorm:"column:serial_num"` // 序列号
|
||||
ExpiryDate string `json:"expiryDate" gorm:"column:expiry_date"` // 许可证到期日期
|
||||
UeNumber int64 `json:"ueNumber" gorm:"column:ue_number"` // 用户容量
|
||||
NbNumber int64 `json:"nbNumber" gorm:"column:nb_number"` // 基站容量
|
||||
HostIds string `json:"hostIds" gorm:"column:host_ids"` // 网元主机ID组 数据格式(ssh,telnet) UDM(ssh,telnet,redis) UPF(ssh,telnet,telnet)
|
||||
Status int64 `json:"status" gorm:"column:status"` // 网元状态 0离线 1在线 2配置待下发 3备用模式 4授权无效
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
// 服务状态
|
||||
ServerState map[string]any `json:"serverState,omitempty" gorm:"-"`
|
||||
|
||||
// 主机对象组
|
||||
Hosts []NeHost `json:"hosts,omitempty" gorm:"-"`
|
||||
ServerState map[string]any `json:"serverState,omitempty" gorm:"-"` // 服务状态
|
||||
Hosts []NeHost `json:"hosts,omitempty" gorm:"-"` // 主机对象组
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package model
|
||||
|
||||
// NeLicense 网元授权激活信息 ne_license
|
||||
type NeLicense struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||
CoreUID string `json:"coreUid" gorm:"column:core_uid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" gorm:"column:ne_uid" binding:"required"` // 网元唯一标识
|
||||
NeType string `json:"neType" gorm:"column:ne_type" binding:"required"` // 网元类型
|
||||
ActivationRequestCode string `json:"activationRequestCode" gorm:"column:activation_request_code"` // 激活申请代码
|
||||
LicensePath string `json:"licensePath" gorm:"column:license_path"` // 激活授权文件
|
||||
SerialNum string `json:"serialNum" gorm:"column:serial_num"` // 序列号
|
||||
ExpiryDate string `json:"expiryDate" gorm:"column:expiry_date"` // 许可证到期日期
|
||||
UeNumber int64 `json:"ueNumber" gorm:"ue_number"` // 用户容量
|
||||
NbNumber int64 `json:"nbNumber" gorm:"nb_number"` // 基站容量
|
||||
Status string `json:"status" gorm:"column:status"` // 状态 0无效 1有效
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
Reload bool `json:"reload,omitempty" gorm:"-"` // 刷新重启网元
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*NeLicense) TableName() string {
|
||||
return "ne_license"
|
||||
}
|
||||
@@ -3,9 +3,7 @@ package model
|
||||
// NeVersion 网元版本信息 ne_version
|
||||
type NeVersion struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||
CoreUID string `json:"coreUid" gorm:"column:core_uid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" gorm:"column:ne_uid" binding:"required"` // 网元唯一标识
|
||||
NeType string `json:"neType" gorm:"column:ne_type" binding:"required"` // 网元类型
|
||||
NeID int64 `json:"neId" gorm:"column:ne_id" binding:"required"` // 网元ID
|
||||
Name string `json:"name" gorm:"column:name"` // 当前包名
|
||||
Version string `json:"version" gorm:"column:version" binding:"required"` // 当前版本
|
||||
Path string `json:"path" gorm:"column:path" binding:"required"` // 当前软件包
|
||||
@@ -20,6 +18,12 @@ type NeVersion struct {
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
NeUid string `json:"neUid,omitempty" gorm:"->"` // 网元唯一标识
|
||||
NeName string `json:"neName,omitempty" gorm:"->"` // 网元名称
|
||||
NeType string `json:"neType,omitempty" gorm:"->"` // 网元类型
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
|
||||
@@ -63,6 +63,14 @@ func Setup(router *gin.Engine) {
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewNeInfo.ListAll,
|
||||
)
|
||||
neInfoGroup.GET("/license/code",
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewNeInfo.LicenseCode,
|
||||
)
|
||||
neInfoGroup.POST("/license/update",
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewNeInfo.LicenseUpdate,
|
||||
)
|
||||
neInfoGroup.GET("/file/para5g",
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewNeInfo.Para5GFileRead,
|
||||
@@ -241,36 +249,6 @@ func Setup(router *gin.Engine) {
|
||||
)
|
||||
}
|
||||
|
||||
// 网元授权激活信息
|
||||
neLicenseGroup := router.Group("/ne/license")
|
||||
{
|
||||
neLicenseGroup.GET("/list",
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewNeLicense.List,
|
||||
)
|
||||
neLicenseGroup.GET("",
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewNeLicense.Info,
|
||||
)
|
||||
neLicenseGroup.GET("/nf",
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewNeLicense.Nf,
|
||||
)
|
||||
neLicenseGroup.GET("/code",
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewNeLicense.Code,
|
||||
)
|
||||
neLicenseGroup.POST("/change",
|
||||
middleware.AuthorizeUser(nil),
|
||||
collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.neLicense", collectlogs.BUSINESS_TYPE_OTHER)),
|
||||
controller.NewNeLicense.Change,
|
||||
)
|
||||
neLicenseGroup.GET("/state",
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewNeLicense.State,
|
||||
)
|
||||
}
|
||||
|
||||
// 网元参数配置
|
||||
neConfigGroup := router.Group("/ne/config")
|
||||
{
|
||||
@@ -361,13 +339,13 @@ func Setup(router *gin.Engine) {
|
||||
// InitLoad 初始参数
|
||||
func InitLoad() {
|
||||
// 启动时,清除缓存-网元类型
|
||||
service.NewNeInfo.ClearNeCacheByCoreUid("*")
|
||||
service.NewNeInfo.RefreshNeCacheByCoreUid("*")
|
||||
service.NewNeInfo.ClearNeCacheByNeId(0)
|
||||
service.NewNeInfo.RefreshNeCacheByNeId(0)
|
||||
// 启动时,网元公共参数数据记录到全局变量
|
||||
if para5GMap, err := service.NewNeInfo.NeConfPara5GRead(); para5GMap != nil && err == nil {
|
||||
service.NewNeInfo.NeConfPara5GWirte(para5GMap, nil)
|
||||
}
|
||||
// 启动时,清除缓存-网元参数配置可用属性值
|
||||
service.NewNeConfig.ClearNeCacheByNeType("*")
|
||||
service.NewNeConfig.RefreshByNeTypeAndNeID("*")
|
||||
service.NewNeConfig.ClearByNeType("*")
|
||||
service.NewNeConfig.RefreshByNeType("*")
|
||||
}
|
||||
|
||||
@@ -22,12 +22,6 @@ func (r NeConfigBackup) SelectByPage(query map[string]string) ([]model.NeConfigB
|
||||
if v, ok := query["neType"]; ok && v != "" {
|
||||
tx = tx.Where("ne_type = ?", v)
|
||||
}
|
||||
if v, ok := query["coreUid"]; ok && v != "" {
|
||||
tx = tx.Where("core_uid = ?", v)
|
||||
}
|
||||
if v, ok := query["neUid"]; ok && v != "" {
|
||||
tx = tx.Where("ne_uid = ?", v)
|
||||
}
|
||||
if v, ok := query["name"]; ok && v != "" {
|
||||
tx = tx.Where("name like ?", fmt.Sprintf("%%%s%%", v))
|
||||
}
|
||||
@@ -56,14 +50,8 @@ func (r NeConfigBackup) SelectByPage(query map[string]string) ([]model.NeConfigB
|
||||
func (r NeConfigBackup) Select(param model.NeConfigBackup) []model.NeConfigBackup {
|
||||
tx := db.DB("").Model(&model.NeConfigBackup{})
|
||||
// 查询条件拼接
|
||||
if param.CoreUID != "" {
|
||||
tx = tx.Where("core_uid = ?", param.CoreUID)
|
||||
}
|
||||
if param.NeUID != "" {
|
||||
tx = tx.Where("ne_uid = ?", param.NeUID)
|
||||
}
|
||||
if param.NeType != "" {
|
||||
tx = tx.Where("ne_type = ?", param.NeType)
|
||||
if param.NeID != 0 {
|
||||
tx = tx.Where("ne_id = ?", param.NeID)
|
||||
}
|
||||
if param.CreateBy != "" {
|
||||
tx = tx.Where("create_by like ?", fmt.Sprintf("%s%%", param.CreateBy))
|
||||
|
||||
@@ -74,11 +74,11 @@ func (r NeInfo) SelectByPage(query map[string]string) ([]model.NeInfo, int64) {
|
||||
if v, ok := query["neType"]; ok && v != "" {
|
||||
tx = tx.Where("ne_type = ?", v)
|
||||
}
|
||||
if v, ok := query["coreUid"]; ok && v != "" {
|
||||
tx = tx.Where("core_uid = ?", v)
|
||||
if v, ok := query["coreId"]; ok && v != "" {
|
||||
tx = tx.Where("core_id = ?", v)
|
||||
}
|
||||
if v, ok := query["neUid"]; ok && v != "" {
|
||||
tx = tx.Where("ne_uid like ?", fmt.Sprintf("%s%%", v))
|
||||
if v, ok := query["neName"]; ok && v != "" {
|
||||
tx = tx.Where("ne_name like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
|
||||
// 查询结果
|
||||
@@ -109,7 +109,11 @@ func (r NeInfo) SelectByIds(ids []int64) []model.NeInfo {
|
||||
}
|
||||
tx := db.DB("").Model(&model.NeInfo{})
|
||||
// 构建查询条件
|
||||
if len(ids) == 1 {
|
||||
tx = tx.Where("id = ?", ids[0])
|
||||
} else {
|
||||
tx = tx.Where("id in ?", ids)
|
||||
}
|
||||
// 查询数据
|
||||
if err := tx.Find(&rows).Error; err != nil {
|
||||
logger.Errorf("query find err => %v", err.Error())
|
||||
@@ -174,11 +178,11 @@ func (r NeInfo) SelectList(neInfo model.NeInfo) []model.NeInfo {
|
||||
if neInfo.NeType != "" {
|
||||
tx = tx.Where("ne_type = ?", neInfo.NeType)
|
||||
}
|
||||
if neInfo.CoreUID != "" {
|
||||
tx = tx.Where("core_uid = ?", neInfo.CoreUID)
|
||||
if neInfo.CoreId != 0 {
|
||||
tx = tx.Where("core_id = ?", neInfo.CoreId)
|
||||
}
|
||||
if neInfo.NeUID != "" {
|
||||
tx = tx.Where("ne_uid = ?", neInfo.NeUID)
|
||||
if neInfo.NeUid != "" {
|
||||
tx = tx.Where("ne_uid = ?", neInfo.NeUid)
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
@@ -190,16 +194,14 @@ func (r NeInfo) SelectList(neInfo model.NeInfo) []model.NeInfo {
|
||||
return r.neListSort(rows)
|
||||
}
|
||||
|
||||
// SelectNeInfoByCoreUidAndNeUid 通过core_uid和ne_uid查询网元信息
|
||||
// coreUid 为*或空字符时,根据neUid查询
|
||||
func (r NeInfo) SelectNeInfoByCoreUidAndNeUid(coreUid, neUid string) model.NeInfo {
|
||||
// SelectNeInfoByNeUid 通过ne_uid查询网元信息
|
||||
func (r NeInfo) SelectNeInfoByNeUid(neUid string) model.NeInfo {
|
||||
if neUid == "" {
|
||||
return model.NeInfo{}
|
||||
}
|
||||
tx := db.DB("").Model(&model.NeInfo{})
|
||||
// 构建查询条件
|
||||
if coreUid == "*" || coreUid == "" {
|
||||
tx = tx.Where("ne_uid = ?", neUid)
|
||||
} else {
|
||||
tx = tx.Where("core_uid = ? and ne_uid = ?", coreUid, neUid)
|
||||
}
|
||||
// 查询数据
|
||||
row := model.NeInfo{}
|
||||
if err := tx.Limit(1).Find(&row).Error; err != nil {
|
||||
@@ -210,15 +212,20 @@ func (r NeInfo) SelectNeInfoByCoreUidAndNeUid(coreUid, neUid string) model.NeInf
|
||||
}
|
||||
|
||||
// UpdateState 修改状态
|
||||
func (r NeInfo) UpdateState(id int64, status int64) int64 {
|
||||
if id <= 0 {
|
||||
func (r NeInfo) UpdateState(neInfo model.NeInfo) int64 {
|
||||
if neInfo.ID <= 0 {
|
||||
return 0
|
||||
}
|
||||
tx := db.DB("").Model(&model.NeInfo{})
|
||||
// 构建查询条件
|
||||
tx = tx.Where("id = ?", id)
|
||||
tx = tx.Where("id = ?", neInfo.ID)
|
||||
tx.Updates(map[string]any{
|
||||
"status": status,
|
||||
"status": neInfo.Status,
|
||||
"ne_type": neInfo.NeType,
|
||||
"serial_num": neInfo.SerialNum,
|
||||
"expiry_date": neInfo.ExpiryDate,
|
||||
"ue_number": neInfo.UeNumber,
|
||||
"nb_number": neInfo.NbNumber,
|
||||
"update_time": time.Now().UnixMilli(),
|
||||
})
|
||||
// 执行更新
|
||||
|
||||
@@ -1,158 +0,0 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"be.ems/src/framework/database/db"
|
||||
"be.ems/src/framework/logger"
|
||||
"be.ems/src/modules/ne/model"
|
||||
)
|
||||
|
||||
// 实例化数据层 NeLicense 结构体
|
||||
var NewNeLicense = &NeLicense{}
|
||||
|
||||
// NeLicense 网元授权激活信息 数据层处理
|
||||
type NeLicense struct{}
|
||||
|
||||
// SelectByPage 分页查询集合
|
||||
func (r NeLicense) SelectByPage(query map[string]string) ([]model.NeLicense, int64) {
|
||||
tx := db.DB("").Model(&model.NeLicense{})
|
||||
// 查询条件拼接
|
||||
if v, ok := query["neType"]; ok && v != "" {
|
||||
tx = tx.Where("ne_type = ?", v)
|
||||
}
|
||||
if v, ok := query["neUid"]; ok && v != "" {
|
||||
tx = tx.Where("ne_uid = ?", v)
|
||||
}
|
||||
if v, ok := query["coreUid"]; ok && v != "" {
|
||||
tx = tx.Where("core_uid = ?", v)
|
||||
}
|
||||
if v, ok := query["expiryDate"]; ok && v != "" {
|
||||
tx = tx.Where("expiry_date like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["serialNum"]; ok && v != "" {
|
||||
tx = tx.Where("serial_num like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["createBy"]; ok && v != "" {
|
||||
tx = tx.Where("create_by like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
|
||||
// 查询结果
|
||||
var total int64 = 0
|
||||
rows := []model.NeLicense{}
|
||||
|
||||
// 查询数量为0直接返回
|
||||
if err := tx.Count(&total).Error; err != nil || total <= 0 {
|
||||
return rows, total
|
||||
}
|
||||
|
||||
// 查询数据分页
|
||||
pageNum, pageSize := db.PageNumSize(query["pageNum"], query["pageSize"])
|
||||
tx = tx.Limit(pageSize).Offset(pageSize * pageNum)
|
||||
tx = tx.Order("id desc")
|
||||
err := tx.Find(&rows).Error
|
||||
if err != nil {
|
||||
logger.Errorf("query find err => %v", err.Error())
|
||||
return rows, total
|
||||
}
|
||||
return rows, total
|
||||
}
|
||||
|
||||
// Select 查询集合
|
||||
func (r NeLicense) Select(param model.NeLicense) []model.NeLicense {
|
||||
tx := db.DB("").Model(&model.NeLicense{})
|
||||
// 查询条件拼接
|
||||
if param.CoreUID != "" {
|
||||
tx = tx.Where("core_uid = ?", param.CoreUID)
|
||||
}
|
||||
if param.NeUID != "" {
|
||||
tx = tx.Where("ne_uid = ?", param.NeUID)
|
||||
}
|
||||
if param.NeType != "" {
|
||||
tx = tx.Where("ne_type = ?", param.NeType)
|
||||
}
|
||||
if param.ExpiryDate != "" {
|
||||
tx = tx.Where("expiry_date = ?", param.ExpiryDate)
|
||||
}
|
||||
if param.SerialNum != "" {
|
||||
tx = tx.Where("serial_num = ?", param.SerialNum)
|
||||
}
|
||||
if param.CreateBy != "" {
|
||||
tx = tx.Where("create_by like ?", fmt.Sprintf("%s%%", param.CreateBy))
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
rows := []model.NeLicense{}
|
||||
if err := tx.Find(&rows).Error; err != nil {
|
||||
logger.Errorf("query find err => %v", err.Error())
|
||||
return rows
|
||||
}
|
||||
return rows
|
||||
}
|
||||
|
||||
// SelectByIds 通过ID查询
|
||||
func (r NeLicense) SelectByIds(ids []int64) []model.NeLicense {
|
||||
rows := []model.NeLicense{}
|
||||
if len(ids) <= 0 {
|
||||
return rows
|
||||
}
|
||||
tx := db.DB("").Model(&model.NeLicense{})
|
||||
// 构建查询条件
|
||||
tx = tx.Where("id in ?", ids)
|
||||
// 查询数据
|
||||
if err := tx.Find(&rows).Error; err != nil {
|
||||
logger.Errorf("query find err => %v", err.Error())
|
||||
return rows
|
||||
}
|
||||
return rows
|
||||
}
|
||||
|
||||
// Insert 新增信息
|
||||
func (r NeLicense) Insert(neInfo model.NeLicense) int64 {
|
||||
if neInfo.CreateBy != "" {
|
||||
ms := time.Now().UnixMilli()
|
||||
neInfo.CreateTime = ms
|
||||
neInfo.UpdateTime = ms
|
||||
neInfo.UpdateBy = neInfo.CreateBy
|
||||
}
|
||||
tx := db.DB("").Create(&neInfo)
|
||||
if err := tx.Error; err != nil {
|
||||
logger.Errorf("CreateInBatches err => %v", err)
|
||||
}
|
||||
return neInfo.ID
|
||||
}
|
||||
|
||||
// Update 修改信息
|
||||
func (r NeLicense) Update(param model.NeLicense) int64 {
|
||||
if param.ID <= 0 {
|
||||
return 0
|
||||
}
|
||||
if param.UpdateBy != "" {
|
||||
param.UpdateTime = time.Now().UnixMilli()
|
||||
}
|
||||
param.UpdateTime = time.Now().UnixMilli()
|
||||
tx := db.DB("").Model(&model.NeLicense{})
|
||||
// 构建查询条件
|
||||
tx = tx.Where("id = ?", param.ID)
|
||||
tx = tx.Omit("id", "create_by", "create_time")
|
||||
// 执行更新
|
||||
if err := tx.Updates(param).Error; err != nil {
|
||||
logger.Errorf("update err => %v", err.Error())
|
||||
return 0
|
||||
}
|
||||
return tx.RowsAffected
|
||||
}
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
func (r NeLicense) DeleteByIds(ids []int64) int64 {
|
||||
if len(ids) <= 0 {
|
||||
return 0
|
||||
}
|
||||
tx := db.DB("").Where("id in ?", ids)
|
||||
if err := tx.Delete(&model.NeLicense{}).Error; err != nil {
|
||||
logger.Errorf("delete err => %v", err.Error())
|
||||
return 0
|
||||
}
|
||||
return tx.RowsAffected
|
||||
}
|
||||
@@ -19,14 +19,8 @@ type NeVersion struct{}
|
||||
func (r NeVersion) SelectByPage(query map[string]string) ([]model.NeVersion, int64) {
|
||||
tx := db.DB("").Model(&model.NeVersion{})
|
||||
// 查询条件拼接
|
||||
if v, ok := query["neType"]; ok && v != "" {
|
||||
tx = tx.Where("ne_type = ?", v)
|
||||
}
|
||||
if v, ok := query["coreUid"]; ok && v != "" {
|
||||
tx = tx.Where("core_uid = ?", v)
|
||||
}
|
||||
if v, ok := query["neUid"]; ok && v != "" {
|
||||
tx = tx.Where("ne_uid = ?", v)
|
||||
if v, ok := query["neId"]; ok && v != "" {
|
||||
tx = tx.Where("ne_id = ?", v)
|
||||
}
|
||||
if v, ok := query["version"]; ok && v != "" {
|
||||
tx = tx.Where("version like ?", fmt.Sprintf("%s%%", v))
|
||||
@@ -47,6 +41,10 @@ func (r NeVersion) SelectByPage(query map[string]string) ([]model.NeVersion, int
|
||||
// 查询数据分页
|
||||
pageNum, pageSize := db.PageNumSize(query["pageNum"], query["pageSize"])
|
||||
tx = tx.Limit(pageSize).Offset(pageSize * pageNum)
|
||||
|
||||
// 关联查询
|
||||
tx = tx.Joins("left join ne_info on ne_info.id = ne_version.ne_id")
|
||||
tx = tx.Select("ne_version.*, ne_info.ne_name, ne_info.ne_type, ne_info.ne_uid")
|
||||
tx = tx.Order("update_time desc")
|
||||
err := tx.Find(&rows).Error
|
||||
if err != nil {
|
||||
@@ -60,14 +58,8 @@ func (r NeVersion) SelectByPage(query map[string]string) ([]model.NeVersion, int
|
||||
func (r NeVersion) Select(param model.NeVersion) []model.NeVersion {
|
||||
tx := db.DB("").Model(&model.NeVersion{})
|
||||
// 查询条件拼接
|
||||
if param.CoreUID != "" {
|
||||
tx = tx.Where("core_uid = ?", param.CoreUID)
|
||||
}
|
||||
if param.NeUID != "" {
|
||||
tx = tx.Where("ne_uid = ?", param.NeUID)
|
||||
}
|
||||
if param.NeType != "" {
|
||||
tx = tx.Where("ne_type = ?", param.NeType)
|
||||
if param.NeID != 0 {
|
||||
tx = tx.Where("ne_id = ?", param.NeID)
|
||||
}
|
||||
if param.Version != "" {
|
||||
tx = tx.Where("version like ?", fmt.Sprintf("%s%%", param.Version))
|
||||
|
||||
@@ -22,7 +22,7 @@ type NeConfig struct {
|
||||
}
|
||||
|
||||
// RefreshByNeType 通过ne_type刷新redis中的缓存
|
||||
func (r *NeConfig) RefreshByNeTypeAndNeID(neType string) []model.NeConfig {
|
||||
func (r *NeConfig) RefreshByNeType(neType string) []model.NeConfig {
|
||||
// 多个
|
||||
if neType == "" || neType == "*" {
|
||||
neConfigList := r.neConfigRepository.Select(model.NeConfig{})
|
||||
@@ -40,7 +40,8 @@ func (r *NeConfig) RefreshByNeTypeAndNeID(neType string) []model.NeConfig {
|
||||
redis.Del("", key)
|
||||
if len(v) > 0 {
|
||||
for i, item := range v {
|
||||
if err := json.Unmarshal([]byte(item.ParamJson), &item.ParamData); err != nil {
|
||||
err := json.Unmarshal([]byte(item.ParamJson), &item.ParamData)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
v[i] = item
|
||||
@@ -60,7 +61,8 @@ func (r *NeConfig) RefreshByNeTypeAndNeID(neType string) []model.NeConfig {
|
||||
})
|
||||
if len(neConfigList) > 0 {
|
||||
for i, v := range neConfigList {
|
||||
if err := json.Unmarshal([]byte(v.ParamJson), &v.ParamData); err != nil {
|
||||
err := json.Unmarshal([]byte(v.ParamJson), &v.ParamData)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
neConfigList[i] = v
|
||||
@@ -71,8 +73,8 @@ func (r *NeConfig) RefreshByNeTypeAndNeID(neType string) []model.NeConfig {
|
||||
return neConfigList
|
||||
}
|
||||
|
||||
// ClearNeCacheByNeType 清除网元类型参数配置缓存
|
||||
func (r *NeConfig) ClearNeCacheByNeType(neType string) bool {
|
||||
// ClearByNeType 清除网元类型参数配置缓存
|
||||
func (r *NeConfig) ClearByNeType(neType string) bool {
|
||||
key := fmt.Sprintf("%s:NeConfig:%s", constants.CACHE_NE_DATA, neType)
|
||||
if neType == "*" {
|
||||
key = fmt.Sprintf("%s:NeConfig:*", constants.CACHE_NE_DATA)
|
||||
@@ -95,7 +97,7 @@ func (r *NeConfig) FindByNeType(neType string) []model.NeConfig {
|
||||
neConfigList = []model.NeConfig{}
|
||||
}
|
||||
} else {
|
||||
neConfigList = r.RefreshByNeTypeAndNeID(neType)
|
||||
neConfigList = r.RefreshByNeType(neType)
|
||||
}
|
||||
return neConfigList
|
||||
}
|
||||
|
||||
@@ -56,20 +56,13 @@ func (s NeConfigBackup) Update(item model.NeConfigBackup) int64 {
|
||||
}
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
func (s NeConfigBackup) DeleteByIds(id int64, coreUid string, neUid string) (int64, error) {
|
||||
func (s NeConfigBackup) DeleteByIds(ids []int64) (int64, error) {
|
||||
// 检查是否存在
|
||||
data := s.neConfigBackupRepository.SelectByIds([]int64{id})
|
||||
data := s.neConfigBackupRepository.SelectByIds(ids)
|
||||
if len(data) != 1 {
|
||||
return 0, fmt.Errorf("neConfigBackup.noData")
|
||||
}
|
||||
|
||||
for _, v := range data {
|
||||
if v.CoreUID != coreUid || v.NeUID != neUid {
|
||||
return 0, fmt.Errorf("data not match, id: %d", v.ID)
|
||||
}
|
||||
}
|
||||
rows := s.neConfigBackupRepository.DeleteByIds([]int64{id})
|
||||
return rows, nil
|
||||
return s.neConfigBackupRepository.DeleteByIds(ids), nil
|
||||
}
|
||||
|
||||
// FileLocalToNe 网元配置文件复制到网元端覆盖
|
||||
@@ -80,13 +73,13 @@ func (s NeConfigBackup) FileLocalToNe(neInfo model.NeInfo, localFile string) err
|
||||
if runtime.GOOS == "windows" {
|
||||
omcPath = fmt.Sprintf("C:%s", omcPath)
|
||||
}
|
||||
localDirPath := fmt.Sprintf("%s/%s/%s/backup/tmp_import", omcPath, neTypeLower, neInfo.NeUID)
|
||||
localDirPath := fmt.Sprintf("%s/%s/%s/backup/tmp_import", omcPath, neTypeLower, neInfo.NeUid)
|
||||
if err := file.UnZip(localFile, localDirPath); err != nil {
|
||||
return fmt.Errorf("unzip err")
|
||||
}
|
||||
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := NewNeInfo.NeRunSSHClient(neInfo.CoreUID, neInfo.NeUID)
|
||||
sshClient, err := NewNeInfo.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("ne info ssh client err")
|
||||
}
|
||||
@@ -99,7 +92,7 @@ func (s NeConfigBackup) FileLocalToNe(neInfo model.NeInfo, localFile string) err
|
||||
defer sftpClient.Close()
|
||||
|
||||
// 网元配置端上的临时目录
|
||||
neDirTemp := fmt.Sprintf("/tmp/omc/ne_config/%s/%s", neTypeLower, neInfo.NeUID)
|
||||
neDirTemp := fmt.Sprintf("/tmp/omc/ne_config/%s/%s", neTypeLower, neInfo.NeUid)
|
||||
sshClient.RunCMD(fmt.Sprintf("sudo mkdir -p /tmp/omc/ne_config && sudo chmod 777 -R /tmp/omc && sudo rm -rf %s", neDirTemp))
|
||||
// 复制到网元端
|
||||
if err = sftpClient.CopyDirLocalToRemote(localDirPath, neDirTemp); err != nil {
|
||||
@@ -149,7 +142,7 @@ func (s NeConfigBackup) FileLocalToNe(neInfo model.NeInfo, localFile string) err
|
||||
// FileNeToLocal 网元备份文件网元端复制到本地
|
||||
func (s NeConfigBackup) FileNeToLocal(neInfo model.NeInfo) (string, error) {
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := NewNeInfo.NeRunSSHClient(neInfo.CoreUID, neInfo.NeUID)
|
||||
sshClient, err := NewNeInfo.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("ne info ssh client err")
|
||||
}
|
||||
@@ -167,11 +160,11 @@ func (s NeConfigBackup) FileNeToLocal(neInfo model.NeInfo) (string, error) {
|
||||
if runtime.GOOS == "windows" {
|
||||
omcPath = fmt.Sprintf("C:%s", omcPath)
|
||||
}
|
||||
localDirPath := fmt.Sprintf("%s/%s/%s/from_ne_tmp", omcPath, neTypeLower, neInfo.NeUID)
|
||||
localDirPath := fmt.Sprintf("%s/%s/%s/from_ne_tmp", omcPath, neTypeLower, neInfo.NeUid)
|
||||
|
||||
// 网元配置文件先复制到临时目录
|
||||
sshClient.RunCMD("sudo mkdir -p /tmp/omc/ne_config && sudo chmod 777 -R /tmp/omc")
|
||||
neDirTemp := fmt.Sprintf("/tmp/omc/ne_config/%s/%s", neTypeLower, neInfo.NeUID)
|
||||
neDirTemp := fmt.Sprintf("/tmp/omc/ne_config/%s/%s", neTypeLower, neInfo.NeUid)
|
||||
switch neTypeLower {
|
||||
case "ims":
|
||||
// ims目录
|
||||
@@ -212,8 +205,8 @@ func (s NeConfigBackup) FileNeToLocal(neInfo model.NeInfo) (string, error) {
|
||||
}
|
||||
|
||||
// 压缩zip文件名
|
||||
zipFileName := fmt.Sprintf("%s-%s-etc-%s.zip", neTypeLower, neInfo.NeUID, date.ParseDateToStr(time.Now(), date.YYYYMMDDHHMMSS))
|
||||
zipFilePath := fmt.Sprintf("%s/%s/%s/%s", omcPath, neTypeLower, neInfo.NeUID, zipFileName)
|
||||
zipFileName := fmt.Sprintf("%s-%s-etc-%s.zip", neTypeLower, neInfo.NeUid, date.ParseDateToStr(time.Now(), date.YYYYMMDDHHMMSS))
|
||||
zipFilePath := fmt.Sprintf("%s/%s/%s/%s", omcPath, neTypeLower, neInfo.NeUid, zipFileName)
|
||||
if err := file.CompressZipByDir(zipFilePath, localDirPath); err != nil {
|
||||
return "", fmt.Errorf("compress zip err")
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"be.ems/src/framework/logger"
|
||||
"be.ems/src/framework/ssh"
|
||||
"be.ems/src/framework/telnet"
|
||||
"be.ems/src/framework/utils/file"
|
||||
"be.ems/src/framework/utils/generate"
|
||||
"be.ems/src/framework/utils/parse"
|
||||
"be.ems/src/modules/ne/model"
|
||||
@@ -35,78 +36,93 @@ type NeInfo struct {
|
||||
Para5GData map[string]string
|
||||
}
|
||||
|
||||
// FindByCoreUidAndNeUid 通过core_uid和ne_uid查询网元信息
|
||||
// coreUid 为*时,根据neUid查询
|
||||
func (r NeInfo) FindByCoreUidAndNeUid(coreUid string, neUid string) model.NeInfo {
|
||||
var neInfo model.NeInfo
|
||||
key := fmt.Sprintf("%s:%s:*:%s", constants.CACHE_NE_INFO, coreUid, neUid)
|
||||
jsonStr, _ := redis.Get("", key)
|
||||
if len(jsonStr) > 7 {
|
||||
err := json.Unmarshal([]byte(jsonStr), &neInfo)
|
||||
if err != nil {
|
||||
neInfo = model.NeInfo{}
|
||||
// FindByNeId 通过id查询网元信息
|
||||
func (r NeInfo) FindByNeId(neId int64) model.NeInfo {
|
||||
neInfo := model.NeInfo{}
|
||||
key := fmt.Sprintf("%s:*:%d:*", constants.CACHE_NE_INFO, neId)
|
||||
jsonStr, err := redis.Get("", key)
|
||||
if err == nil && len(jsonStr) > 7 {
|
||||
if err := json.Unmarshal([]byte(jsonStr), &neInfo); err != nil {
|
||||
return neInfo
|
||||
}
|
||||
} else {
|
||||
neInfo = r.neInfoRepository.SelectNeInfoByCoreUidAndNeUid(coreUid, neUid)
|
||||
if neInfo.CoreUID == coreUid && neInfo.NeUID == neUid {
|
||||
neInfos := r.neInfoRepository.SelectByIds([]int64{neId})
|
||||
if len(neInfos) == 1 {
|
||||
neInfo = neInfos[0]
|
||||
redis.Del("", key)
|
||||
values, _ := json.Marshal(neInfo)
|
||||
redis.Set("", key, string(values), 0)
|
||||
dataByte, err := json.Marshal(neInfo)
|
||||
if err != nil {
|
||||
return neInfo
|
||||
}
|
||||
key = fmt.Sprintf("%s:%s:%d:%s", constants.CACHE_NE_INFO, neInfo.NeType, neInfo.ID, neInfo.NeUid)
|
||||
redis.Set("", key, string(dataByte), 0)
|
||||
}
|
||||
}
|
||||
return neInfo
|
||||
}
|
||||
|
||||
// RefreshByCoreUidAndNeUid 通过core_id和ne_uid刷新缓存
|
||||
func (r NeInfo) RefreshByCoreUidAndNeUid(coreuid string, neUid string) model.NeInfo {
|
||||
var neInfo model.NeInfo
|
||||
if coreuid == "*" || coreuid == "" {
|
||||
// FindByCoreUidAndNeUid 通过ne_uid查询网元信息
|
||||
func (r NeInfo) FindByNeUid(neUid string) model.NeInfo {
|
||||
neInfo := model.NeInfo{}
|
||||
key := fmt.Sprintf("%s:*:*:%s", constants.CACHE_NE_INFO, neUid)
|
||||
jsonStr, err := redis.Get("", key)
|
||||
if err == nil && len(jsonStr) > 7 {
|
||||
if err := json.Unmarshal([]byte(jsonStr), &neInfo); err != nil {
|
||||
return neInfo
|
||||
}
|
||||
key := fmt.Sprintf("%s:%s:*:%s", constants.CACHE_NE_INFO, coreuid, neUid)
|
||||
} else {
|
||||
neInfo = r.neInfoRepository.SelectNeInfoByNeUid(neUid)
|
||||
if neInfo.NeUid == neUid {
|
||||
redis.Del("", key)
|
||||
neInfo = r.neInfoRepository.SelectNeInfoByCoreUidAndNeUid(coreuid, neUid)
|
||||
if neInfo.CoreUID == coreuid && neInfo.NeUID == neUid {
|
||||
values, _ := json.Marshal(neInfo)
|
||||
redis.Set("", key, string(values), 0)
|
||||
dataByte, err := json.Marshal(neInfo)
|
||||
if err != nil {
|
||||
return neInfo
|
||||
}
|
||||
key = fmt.Sprintf("%s:%s:%d:%s", constants.CACHE_NE_INFO, neInfo.NeType, neInfo.ID, neInfo.NeUid)
|
||||
redis.Set("", key, string(dataByte), 0)
|
||||
}
|
||||
}
|
||||
return neInfo
|
||||
}
|
||||
|
||||
// FindByCoreUidAndNeType 通过core_uid和ne_type查询网元信息
|
||||
// coreUid 为*时,根据neType查询
|
||||
func (r NeInfo) FindByCoreUidAndNeType(coreUid string, neType string) []model.NeInfo {
|
||||
neInfo := make([]model.NeInfo, 0)
|
||||
key := fmt.Sprintf("%s:%s:%s:*", constants.CACHE_NE_INFO, coreUid, neType)
|
||||
// FindByNeType 通过ne_type查询网元信息
|
||||
func (r NeInfo) FindByNeType(neType string) []model.NeInfo {
|
||||
neInfos := make([]model.NeInfo, 0)
|
||||
key := fmt.Sprintf("%s:%s:*", constants.CACHE_NE_INFO, neType)
|
||||
cacheKeys, _ := redis.GetKeys("", key)
|
||||
if len(cacheKeys) > 0 {
|
||||
for _, key := range cacheKeys {
|
||||
jsonStr, err := redis.Get("", key)
|
||||
if err != nil || len(jsonStr) < 7 {
|
||||
continue
|
||||
}
|
||||
var v model.NeInfo
|
||||
jsonStr, _ := redis.Get("", key)
|
||||
if len(jsonStr) > 7 {
|
||||
json.Unmarshal([]byte(jsonStr), &v)
|
||||
if err = json.Unmarshal([]byte(jsonStr), &v); err != nil {
|
||||
continue
|
||||
}
|
||||
neInfo = append(neInfo, v)
|
||||
neInfos = append(neInfos, v)
|
||||
}
|
||||
return neInfo
|
||||
return neInfos
|
||||
} else {
|
||||
neInfo = r.neInfoRepository.SelectList(model.NeInfo{CoreUID: coreUid, NeType: neType})
|
||||
for _, v := range neInfo {
|
||||
key := fmt.Sprintf("%s:%s:%s:%s", constants.CACHE_NE_INFO, v.CoreUID, v.NeType, v.NeUID)
|
||||
neInfos = r.neInfoRepository.SelectList(model.NeInfo{NeType: neType})
|
||||
for _, v := range neInfos {
|
||||
key := fmt.Sprintf("%s:%s:%d:%s", constants.CACHE_NE_INFO, v.NeType, v.ID, v.NeUid)
|
||||
redis.Del("", key)
|
||||
values, _ := json.Marshal(v)
|
||||
redis.Set("", key, string(values), 0)
|
||||
dataByte, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
redis.Set("", key, string(dataByte), 0)
|
||||
}
|
||||
}
|
||||
return neInfo
|
||||
return neInfos
|
||||
}
|
||||
|
||||
// ClearNeCacheByCoreUidOrNeUid 清除核心网下网元信息缓存
|
||||
// coreUid 核心网唯一标识 *表示清除所有
|
||||
func (r NeInfo) ClearNeCacheByCoreUid(coreUid string) bool {
|
||||
key := fmt.Sprintf("%s:*", constants.CACHE_NE_INFO)
|
||||
if coreUid != "*" {
|
||||
key = fmt.Sprintf("%s:%s:*", constants.CACHE_NE_INFO, coreUid)
|
||||
// ClearNeCacheByNeId 清除网元信息缓存 0表示所有
|
||||
func (r NeInfo) ClearNeCacheByNeId(neId int64) bool {
|
||||
key := fmt.Sprintf("%s:*:%d:*", constants.CACHE_NE_INFO, neId)
|
||||
if neId == 0 {
|
||||
key = fmt.Sprintf("%s:*", constants.CACHE_NE_INFO)
|
||||
}
|
||||
keys, err := redis.GetKeys("", key)
|
||||
if err != nil {
|
||||
@@ -115,17 +131,19 @@ func (r NeInfo) ClearNeCacheByCoreUid(coreUid string) bool {
|
||||
return redis.DelKeys("", keys) == nil
|
||||
}
|
||||
|
||||
// RefreshNeCacheByCoreUid 刷新核心网下网元信息缓存
|
||||
// coreUid 核心网唯一标识 *表示所有
|
||||
func (r NeInfo) RefreshNeCacheByCoreUid(coreUid string) {
|
||||
if coreUid == "*" {
|
||||
coreUid = ""
|
||||
// RefreshNeCacheByNeId 刷新网元信息缓存 0表示所有
|
||||
func (r NeInfo) RefreshNeCacheByNeId(neId int64) {
|
||||
if neId == 0 {
|
||||
neId = 0
|
||||
}
|
||||
neInfos := r.Find(model.NeInfo{CoreUID: coreUid}, false, false)
|
||||
neInfos := r.Find(model.NeInfo{ID: neId}, false, false)
|
||||
for _, v := range neInfos {
|
||||
key := fmt.Sprintf("%s:%s:%s:%s", constants.CACHE_NE_INFO, v.CoreUID, v.NeType, v.NeUID)
|
||||
key := fmt.Sprintf("%s:%d:%s:%s", constants.CACHE_NE_INFO, v.ID, v.NeType, v.NeUid)
|
||||
redis.Del("", key)
|
||||
values, _ := json.Marshal(v)
|
||||
values, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
redis.Set("", key, string(values), 0)
|
||||
}
|
||||
}
|
||||
@@ -174,11 +192,10 @@ func (r NeInfo) bandNeStatus(arr *[]model.NeInfo) {
|
||||
"online": false,
|
||||
}
|
||||
// 网元状态设置为离线
|
||||
(*arr)[i].Status = 0
|
||||
if v.Status != 0 {
|
||||
v.Status = 0
|
||||
(*arr)[i].Status = v.Status
|
||||
(*arr)[i].UpdateTime = time.Now().UnixMilli()
|
||||
r.neInfoRepository.UpdateState(v.ID, v.Status)
|
||||
r.neInfoRepository.UpdateState(v)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@@ -193,10 +210,23 @@ func (r NeInfo) bandNeStatus(arr *[]model.NeInfo) {
|
||||
if _, err = neFetchlink.NeConfigOMC(v); err != nil {
|
||||
status = 2
|
||||
}
|
||||
|
||||
(*arr)[i].Status = status
|
||||
if v.Status != status {
|
||||
(*arr)[i].UpdateTime = time.Now().UnixMilli()
|
||||
r.neInfoRepository.UpdateState(v.ID, status)
|
||||
v.Status = status
|
||||
if n, ok := result["sn"]; ok && n != nil {
|
||||
v.SerialNum = fmt.Sprint(n)
|
||||
}
|
||||
if n, ok := result["expire"]; ok && n != nil {
|
||||
v.ExpiryDate = fmt.Sprint(n)
|
||||
}
|
||||
if n, ok := result["ueNumber"]; ok && n != nil {
|
||||
v.UeNumber = parse.Number(n)
|
||||
}
|
||||
if n, ok := result["nbNumber"]; ok && n != nil {
|
||||
v.NbNumber = parse.Number(n)
|
||||
}
|
||||
r.neInfoRepository.UpdateState(v)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,8 +235,8 @@ func (r NeInfo) bandNeStatus(arr *[]model.NeInfo) {
|
||||
func (r NeInfo) bandNeHosts(arr *[]model.NeInfo) {
|
||||
for i := range *arr {
|
||||
v := (*arr)[i]
|
||||
if v.HostIDs != "" {
|
||||
hostIds := strings.Split(v.HostIDs, ",")
|
||||
if v.HostIds != "" {
|
||||
hostIds := strings.Split(v.HostIds, ",")
|
||||
if len(hostIds) <= 1 {
|
||||
continue
|
||||
}
|
||||
@@ -232,7 +262,7 @@ func (r NeInfo) FindById(id int64, bandHost bool) model.NeInfo {
|
||||
neInfos := r.neInfoRepository.SelectByIds([]int64{id})
|
||||
if len(neInfos) > 0 {
|
||||
// 带主机信息
|
||||
if neInfos[0].HostIDs != "" && bandHost {
|
||||
if neInfos[0].HostIds != "" && bandHost {
|
||||
r.bandNeHosts(&neInfos)
|
||||
}
|
||||
return neInfos[0]
|
||||
@@ -242,10 +272,10 @@ func (r NeInfo) FindById(id int64, bandHost bool) model.NeInfo {
|
||||
|
||||
// Insert 新增信息
|
||||
func (r NeInfo) Insert(neInfo model.NeInfo) int64 {
|
||||
if neInfo.CoreUID == "" {
|
||||
return 0
|
||||
if len(neInfo.NeUid) < 8 {
|
||||
neInfo.NeUid = strings.ToUpper(generate.Code(8))
|
||||
}
|
||||
neInfo.NeUID = strings.ToUpper(generate.Code(8))
|
||||
neInfo.NeType = strings.ToUpper(neInfo.NeType)
|
||||
|
||||
// 获取网元状态是否正常
|
||||
serverState, err := neFetchlink.NeState(neInfo)
|
||||
@@ -265,59 +295,49 @@ func (r NeInfo) Insert(neInfo model.NeInfo) int64 {
|
||||
|
||||
// 主机信息新增
|
||||
if neInfo.Hosts != nil {
|
||||
uuid := generate.Code(4)
|
||||
var hostIDs []string
|
||||
var hostIds []string
|
||||
for _, host := range neInfo.Hosts {
|
||||
uuid := generate.Code(4)
|
||||
host.Title = fmt.Sprintf("%s_%d_%s", neInfo.NeName, host.Port, uuid)
|
||||
host.GroupID = "1"
|
||||
host.CreateBy = neInfo.CreateBy
|
||||
hostId := r.neHostService.Insert(host)
|
||||
if hostId > 0 {
|
||||
hostIDs = append(hostIDs, fmt.Sprint(hostId))
|
||||
hostIds = append(hostIds, fmt.Sprint(hostId))
|
||||
}
|
||||
}
|
||||
neInfo.HostIDs = strings.Join(hostIDs, ",")
|
||||
neInfo.HostIds = strings.Join(hostIds, ",")
|
||||
}
|
||||
|
||||
insertId := r.neInfoRepository.Insert(neInfo)
|
||||
if insertId > 0 {
|
||||
neInfo.ID = insertId
|
||||
// 新增Version信息
|
||||
neVersion := model.NeVersion{
|
||||
CoreUID: neInfo.CoreUID,
|
||||
NeUID: neInfo.NeUID,
|
||||
NeType: neInfo.NeType,
|
||||
NeID: neInfo.ID,
|
||||
CreateBy: neInfo.CreateBy,
|
||||
}
|
||||
if v, ok := serverState["version"]; ok && v != nil {
|
||||
// neVersion.Name = "-"
|
||||
// neVersion.Path = "-"
|
||||
neVersion.Version = fmt.Sprint(v)
|
||||
}
|
||||
NewNeVersion.Insert(neVersion)
|
||||
|
||||
// 新增License信息
|
||||
neLicense := model.NeLicense{
|
||||
CoreUID: neInfo.CoreUID,
|
||||
NeUID: neInfo.NeUID,
|
||||
NeType: neInfo.NeType,
|
||||
CreateBy: neInfo.CreateBy,
|
||||
}
|
||||
// 更新License信息
|
||||
if v, ok := serverState["sn"]; ok && v != nil {
|
||||
neLicense.SerialNum = fmt.Sprint(v)
|
||||
neInfo.SerialNum = fmt.Sprint(v)
|
||||
}
|
||||
if v, ok := serverState["expire"]; ok && v != nil {
|
||||
neLicense.ExpiryDate = fmt.Sprint(v)
|
||||
neLicense.Status = "1"
|
||||
neInfo.ExpiryDate = fmt.Sprint(v)
|
||||
}
|
||||
if v, ok := serverState["ueNumber"]; ok && v != nil {
|
||||
neLicense.UeNumber = parse.Number(v)
|
||||
neInfo.UeNumber = parse.Number(v)
|
||||
}
|
||||
if v, ok := serverState["nbNumber"]; ok && v != nil {
|
||||
neLicense.NbNumber = parse.Number(v)
|
||||
neInfo.NbNumber = parse.Number(v)
|
||||
}
|
||||
NewNeLicense.Insert(neLicense)
|
||||
|
||||
r.RefreshByCoreUidAndNeUid(neInfo.CoreUID, neInfo.NeUID) // 刷新缓存
|
||||
r.Update(neInfo)
|
||||
// 刷新缓存
|
||||
r.ClearNeCacheByNeId(neInfo.ID)
|
||||
}
|
||||
return insertId
|
||||
}
|
||||
@@ -341,14 +361,14 @@ func (r NeInfo) Update(neInfo model.NeInfo) int64 {
|
||||
}
|
||||
|
||||
// 主机信息更新
|
||||
if neInfo.HostIDs != "" && len(neInfo.Hosts) > 0 {
|
||||
hostIDs := strings.Split(neInfo.HostIDs, ",")
|
||||
for index, id := range hostIDs {
|
||||
if neInfo.HostIds != "" && len(neInfo.Hosts) > 0 {
|
||||
hostIds := strings.Split(neInfo.HostIds, ",")
|
||||
for index, id := range hostIds {
|
||||
neInfo.Hosts[index].ID = parse.Number(id)
|
||||
}
|
||||
uuid := generate.Code(4)
|
||||
for _, host := range neInfo.Hosts {
|
||||
if host.ID != 0 {
|
||||
uuid := generate.Code(4)
|
||||
host.Title = fmt.Sprintf("%s_%d_%s", neInfo.NeType, host.Port, uuid)
|
||||
host.GroupID = "1"
|
||||
host.UpdateBy = neInfo.UpdateBy
|
||||
@@ -357,112 +377,90 @@ func (r NeInfo) Update(neInfo model.NeInfo) int64 {
|
||||
}
|
||||
}
|
||||
|
||||
num := r.neInfoRepository.Update(neInfo)
|
||||
if num > 0 {
|
||||
// 信息更新
|
||||
if v, ok := serverState["version"]; ok && v != nil {
|
||||
// 版本信息更新
|
||||
neVersion := NewNeVersion.FindByCoreUidAndNeUid(neInfo.CoreUID, neInfo.NeUID)
|
||||
if neVersion.ID != 0 {
|
||||
if neVersion.NeType != neInfo.NeType {
|
||||
neVersion.NeType = neInfo.NeType
|
||||
}
|
||||
if v, ok := serverState["version"]; ok && v != neVersion.Version {
|
||||
neVersion := NewNeVersion.FindById(neInfo.ID)
|
||||
if neVersion.ID != 0 && neVersion.Version == fmt.Sprint(v) {
|
||||
// neVersion.Name = "-"
|
||||
// neVersion.Path = "-"
|
||||
neVersion.Version = fmt.Sprint(v)
|
||||
}
|
||||
neVersion.UpdateBy = neInfo.UpdateBy
|
||||
NewNeVersion.Update(neVersion)
|
||||
}
|
||||
|
||||
// License信息更新
|
||||
neLicense := NewNeLicense.FindByCoreUidAndNeUid(neInfo.CoreUID, neInfo.NeUID)
|
||||
if neLicense.ID != 0 {
|
||||
if neLicense.NeType != neInfo.NeType {
|
||||
neLicense.NeType = neInfo.NeType
|
||||
}
|
||||
if v, ok := serverState["sn"]; ok && v != nil {
|
||||
neLicense.SerialNum = fmt.Sprint(v)
|
||||
neInfo.SerialNum = fmt.Sprint(v)
|
||||
}
|
||||
if v, ok := serverState["expire"]; ok && v != nil {
|
||||
neLicense.ExpiryDate = fmt.Sprint(v)
|
||||
neLicense.Status = "1"
|
||||
neInfo.ExpiryDate = fmt.Sprint(v)
|
||||
}
|
||||
if v, ok := serverState["ueNumber"]; ok && v != nil {
|
||||
neLicense.UeNumber = parse.Number(v)
|
||||
neInfo.UeNumber = parse.Number(v)
|
||||
}
|
||||
if v, ok := serverState["nbNumber"]; ok && v != nil {
|
||||
neLicense.NbNumber = parse.Number(v)
|
||||
}
|
||||
neLicense.UpdateBy = neInfo.UpdateBy
|
||||
NewNeLicense.Update(neLicense)
|
||||
neInfo.NbNumber = parse.Number(v)
|
||||
}
|
||||
|
||||
r.RefreshByCoreUidAndNeUid(neInfo.CoreUID, neInfo.NeUID) // 刷新缓存
|
||||
num := r.neInfoRepository.Update(neInfo)
|
||||
if num > 0 {
|
||||
// 刷新缓存
|
||||
r.RefreshNeCacheByNeId(neInfo.ID)
|
||||
}
|
||||
return num
|
||||
}
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
func (r NeInfo) DeleteByIds(ids []int64, coreUid, neUid string) (int64, error) {
|
||||
func (r NeInfo) DeleteByIds(ids []int64) (int64, error) {
|
||||
// 检查是否存在
|
||||
arr := r.neInfoRepository.SelectByIds(ids)
|
||||
if len(arr) != len(ids) {
|
||||
return 0, fmt.Errorf("not match id")
|
||||
}
|
||||
|
||||
for _, v := range arr {
|
||||
if v.CoreUID != coreUid || v.NeUID != neUid {
|
||||
return 0, fmt.Errorf("data not match, id: %d", v.ID)
|
||||
}
|
||||
}
|
||||
for _, v := range arr {
|
||||
// 主机信息删除
|
||||
if v.HostIDs != "" {
|
||||
if v.HostIds != "" {
|
||||
hostIds := make([]int64, 0)
|
||||
arr := strings.Split(v.HostIDs, ",")
|
||||
arr := strings.Split(v.HostIds, ",")
|
||||
for _, hostId := range arr {
|
||||
hostIds = append(hostIds, parse.Number(hostId))
|
||||
}
|
||||
r.neHostService.DeleteByIds(hostIds, false)
|
||||
}
|
||||
// 删除License
|
||||
neLicense := NewNeLicense.FindByCoreUidAndNeUid(v.CoreUID, v.NeUID)
|
||||
if neLicense.CoreUID == v.CoreUID && neLicense.NeUID == v.NeUID {
|
||||
NewNeLicense.DeleteByIds([]int64{neLicense.ID})
|
||||
}
|
||||
// 删除Version
|
||||
neVersion := NewNeVersion.FindByCoreUidAndNeUid(v.CoreUID, v.NeUID)
|
||||
if neVersion.CoreUID == v.CoreUID && neVersion.NeUID == v.NeUID {
|
||||
neVersion := NewNeVersion.FindByNeId(v.ID)
|
||||
if neVersion.ID != 0 {
|
||||
NewNeVersion.DeleteByIds([]int64{neVersion.ID})
|
||||
}
|
||||
// 缓存信息删除
|
||||
redis.Del("", fmt.Sprintf("%s:%s:%s:%s", constants.CACHE_NE_INFO, v.CoreUID, v.NeType, v.NeUID))
|
||||
r.ClearNeCacheByNeId(v.ID)
|
||||
}
|
||||
rows := r.neInfoRepository.DeleteByIds(ids)
|
||||
return rows, nil
|
||||
}
|
||||
|
||||
// NeRunSSHClient 网元主机的SSH客户端-为创建相关连接,注意结束后 Close()
|
||||
func (r NeInfo) NeRunSSHClient(coreUid, neUid string) (*ssh.ConnSSH, error) {
|
||||
neInfo := r.FindByCoreUidAndNeUid(coreUid, neUid)
|
||||
if neInfo.CoreUID != coreUid || neInfo.NeUID != neUid {
|
||||
logger.Errorf("NeRunSSHClient CoreUID:%s or NeUID:%s not found", coreUid, neUid)
|
||||
func (r NeInfo) NeRunSSHClient(neId int64) (*ssh.ConnSSH, error) {
|
||||
neInfo := r.FindByNeId(neId)
|
||||
if neInfo.ID != neId {
|
||||
logger.Errorf("NeRunSSHClient NeId:%d not found", neId)
|
||||
return nil, fmt.Errorf("neinfo not found")
|
||||
}
|
||||
// 取主机信息
|
||||
if neInfo.HostIDs == "" {
|
||||
logger.Errorf("NeRunSSHClient CoreUID:%s or NeUID:%s hostId not found", coreUid, neUid)
|
||||
if neInfo.HostIds == "" {
|
||||
logger.Errorf("NeRunSSHClient NeId:%d hostId not found", neId)
|
||||
return nil, fmt.Errorf("neinfo hostId not found")
|
||||
}
|
||||
hostIds := strings.Split(neInfo.HostIDs, ",")
|
||||
hostIds := strings.Split(neInfo.HostIds, ",")
|
||||
if len(hostIds) <= 1 {
|
||||
logger.Errorf("NeRunTelnetClient hosts id %s not found", neInfo.HostIDs)
|
||||
logger.Errorf("NeRunTelnetClient hosts id %s not found", neInfo.HostIds)
|
||||
return nil, fmt.Errorf("neinfo host id not found")
|
||||
}
|
||||
hostId := parse.Number(hostIds[0]) // 网元主机ssh 0:22
|
||||
neHost := r.neHostService.FindById(hostId)
|
||||
if neHost.ID == 0 || neHost.ID != hostId {
|
||||
logger.Errorf("NeRunTelnetClient Hosts %s not found", neInfo.HostIDs)
|
||||
logger.Errorf("NeRunTelnetClient Hosts %s not found", neInfo.HostIds)
|
||||
return nil, fmt.Errorf("neinfo host not found")
|
||||
}
|
||||
if neHost.HostType != "ssh" {
|
||||
@@ -487,8 +485,8 @@ func (r NeInfo) NeRunSSHClient(coreUid, neUid string) (*ssh.ConnSSH, error) {
|
||||
}
|
||||
|
||||
// NeRunSSHCmd 网元主机的SSH客户端发送cmd命令
|
||||
func (r NeInfo) NeRunSSHCmd(coreUid, neUid string, cmdStr string) (string, error) {
|
||||
sshClient, err := r.NeRunSSHClient(coreUid, neUid)
|
||||
func (r NeInfo) NeRunSSHCmd(neId int64, cmdStr string) (string, error) {
|
||||
sshClient, err := r.NeRunSSHClient(neId)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -505,26 +503,26 @@ func (r NeInfo) NeRunSSHCmd(coreUid, neUid string, cmdStr string) (string, error
|
||||
|
||||
// NeRunTelnetClient 网元主机的Telnet客户端-为创建相关连接,注意结束后 Close()
|
||||
// num 是网元主机telnet 1:4100 2:5200(UPF标准版)
|
||||
func (r NeInfo) NeRunTelnetClient(coreUid, neUid string, num int) (*telnet.ConnTelnet, error) {
|
||||
neInfo := r.FindByCoreUidAndNeUid(coreUid, neUid)
|
||||
if neInfo.CoreUID != coreUid || neInfo.NeUID != neUid {
|
||||
logger.Errorf("NeRunSSHClient CoreUID:%s or NeUID:%s not found", coreUid, neUid)
|
||||
func (r NeInfo) NeRunTelnetClient(neId int64, num int) (*telnet.ConnTelnet, error) {
|
||||
neInfo := r.FindByNeId(neId)
|
||||
if neInfo.ID != neId {
|
||||
logger.Errorf("NeRunSSHClient NeId:%d not found", neId)
|
||||
return nil, fmt.Errorf("neinfo not found")
|
||||
}
|
||||
// 取主机信息
|
||||
if neInfo.HostIDs == "" {
|
||||
logger.Errorf("NeRunTelnetClient CoreUID:%s or NeUID:%s hostId not found", coreUid, neUid)
|
||||
if neInfo.HostIds == "" {
|
||||
logger.Errorf("NeRunSSHClient NeId:%d hostId not found", neId)
|
||||
return nil, fmt.Errorf("neinfo hostId not found")
|
||||
}
|
||||
hostIds := strings.Split(neInfo.HostIDs, ",")
|
||||
hostIds := strings.Split(neInfo.HostIds, ",")
|
||||
if len(hostIds) <= 1 {
|
||||
logger.Errorf("NeRunTelnetClient hosts id %s not found", neInfo.HostIDs)
|
||||
logger.Errorf("NeRunTelnetClient hosts id %s not found", neInfo.HostIds)
|
||||
return nil, fmt.Errorf("neinfo host id not found")
|
||||
}
|
||||
hostId := parse.Number(hostIds[num]) // 网元主机telnet 1:4100 2:5200
|
||||
neHost := r.neHostService.FindById(hostId)
|
||||
if neHost.ID == 0 || neHost.ID != hostId {
|
||||
logger.Errorf("NeRunTelnetClient Hosts %s not found", neInfo.HostIDs)
|
||||
logger.Errorf("NeRunTelnetClient Hosts %s not found", neInfo.HostIds)
|
||||
return nil, fmt.Errorf("neinfo host not found")
|
||||
}
|
||||
|
||||
@@ -541,26 +539,26 @@ func (r NeInfo) NeRunTelnetClient(coreUid, neUid string, num int) (*telnet.ConnT
|
||||
|
||||
// NeRunRedisClient 网元主机的Redis客户端-为创建相关连接,注意结束后 Close()
|
||||
// 暂时只有UDM有Redis配置项
|
||||
func (r NeInfo) NeRunRedisClient(coreUid, neUid string) (*redis.ConnRedis, error) {
|
||||
neInfo := r.FindByCoreUidAndNeUid(coreUid, neUid)
|
||||
if neInfo.CoreUID != coreUid || neInfo.NeUID != neUid {
|
||||
logger.Errorf("NeRunRedisClient CoreUid:%s NeUid:%s not found", coreUid, neUid)
|
||||
func (r NeInfo) NeRunRedisClient(neId int64) (*redis.ConnRedis, error) {
|
||||
neInfo := r.FindByNeId(neId)
|
||||
if neInfo.ID != neId {
|
||||
logger.Errorf("NeRunRedisClient NeId:%d not found", neId)
|
||||
return nil, fmt.Errorf("neinfo not found")
|
||||
}
|
||||
// 取主机信息
|
||||
if neInfo.HostIDs == "" {
|
||||
logger.Errorf("NeRunRedisClient CoreUid:%s NeUid:%s hostId not found", coreUid, neUid)
|
||||
if neInfo.HostIds == "" {
|
||||
logger.Errorf("NeRunSSHClient NeId:%d hostId not found", neId)
|
||||
return nil, fmt.Errorf("neinfo hostId not found")
|
||||
}
|
||||
hostIds := strings.Split(neInfo.HostIDs, ",")
|
||||
if len(hostIds) <= 2 {
|
||||
logger.Errorf("NeRunRedisClient hosts id %s not found", neInfo.HostIDs)
|
||||
hostIds := strings.Split(neInfo.HostIds, ",")
|
||||
if len(hostIds) <= 1 {
|
||||
logger.Errorf("NeRunTelnetClient hosts id %s not found", neInfo.HostIds)
|
||||
return nil, fmt.Errorf("neinfo host id not found")
|
||||
}
|
||||
hostId := parse.Number(hostIds[2])
|
||||
neHost := r.neHostService.FindById(hostId)
|
||||
if neHost.ID == 0 || neHost.ID != hostId {
|
||||
logger.Errorf("NeRunRedisClient Hosts %s not found", neInfo.HostIDs)
|
||||
logger.Errorf("NeRunRedisClient Hosts %s not found", neInfo.HostIds)
|
||||
return nil, fmt.Errorf("neinfo host not found")
|
||||
}
|
||||
|
||||
@@ -575,14 +573,109 @@ func (r NeInfo) NeRunRedisClient(coreUid, neUid string) (*redis.ConnRedis, error
|
||||
return redisClient, nil
|
||||
}
|
||||
|
||||
// NeConfOAMReadSync 网元OAM配置文件读取
|
||||
func (r NeInfo) NeConfOAMReadSync(coreUid, neUid string) (map[string]any, error) {
|
||||
neInfo := r.FindByCoreUidAndNeUid(coreUid, neUid)
|
||||
if neInfo.CoreUID != coreUid || neInfo.NeUID != neUid {
|
||||
logger.Errorf("NeRunRedisClient CoreUid:%s NeUid:%s not found", coreUid, neUid)
|
||||
return nil, fmt.Errorf("neinfo not found")
|
||||
// NeConfLicenseRead 读取授权文件信息
|
||||
// 返回激活申请码, 激活文件绝对地址
|
||||
func (r NeInfo) NeConfLicenseRead(neInfo model.NeInfo) (string, string) {
|
||||
neTypeLower := strings.ToLower(neInfo.NeType)
|
||||
// 网管本地路径
|
||||
omcPath := "/usr/local/omc/backup/ne_license"
|
||||
if runtime.GOOS == "windows" {
|
||||
omcPath = fmt.Sprintf("C:%s", omcPath)
|
||||
}
|
||||
omcPath = fmt.Sprintf("%s/%s/%s", omcPath, neTypeLower, neInfo.NeUid)
|
||||
// 网元端授权文件路径
|
||||
nePath := fmt.Sprintf("/usr/local/etc/%s/license", neTypeLower)
|
||||
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := r.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
return "", ""
|
||||
}
|
||||
defer sshClient.Close()
|
||||
// 网元主机的SSH客户端进行文件传输
|
||||
sftpClient, err := sshClient.NewClientSFTP()
|
||||
if err != nil {
|
||||
return "", ""
|
||||
}
|
||||
defer sftpClient.Close()
|
||||
|
||||
// 复制授权申请码到本地
|
||||
if err = sftpClient.CopyFileRemoteToLocal(nePath+"/Activation_request_code.txt", omcPath+"/Activation_request_code.txt"); err != nil {
|
||||
return "", ""
|
||||
}
|
||||
// 读取文件内容
|
||||
bytes, err := os.ReadFile(omcPath + "/Activation_request_code.txt")
|
||||
if err != nil {
|
||||
return "", ""
|
||||
}
|
||||
|
||||
// 复制激活文件到本地
|
||||
licensePath := ""
|
||||
if err = sftpClient.CopyFileRemoteToLocal(nePath+"/system.ini", omcPath+"/system.ini"); err == nil {
|
||||
licensePath = omcPath + "/system.ini"
|
||||
}
|
||||
|
||||
activationRequestCode := string(bytes)
|
||||
parts := strings.Split(activationRequestCode, "\n")
|
||||
if len(parts) > 1 && strings.HasPrefix(parts[0], "SN") {
|
||||
activationRequestCode = parts[1] // 获取第二行内容
|
||||
}
|
||||
return strings.TrimSpace(activationRequestCode), licensePath
|
||||
}
|
||||
|
||||
// NeConfLicenseUpload 授权文件上传到网元主机
|
||||
func (r NeInfo) NeConfLicenseUpload(neInfo model.NeInfo, reload bool) error {
|
||||
// 检查文件是否存在
|
||||
omcLicensePath := file.ParseUploadFileAbsPath(neInfo.LicensePath)
|
||||
if _, err := os.Stat(omcLicensePath); err != nil {
|
||||
return fmt.Errorf("file read failure")
|
||||
}
|
||||
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := NewNeInfo.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer sshClient.Close()
|
||||
// 网元主机的SSH客户端进行文件传输
|
||||
sftpClient, err := sshClient.NewClientSFTP()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer sftpClient.Close()
|
||||
|
||||
// 网元端授权文件路径
|
||||
neTypeLower := strings.ToLower(neInfo.NeType)
|
||||
neLicensePath := fmt.Sprintf("/usr/local/etc/%s/license/system.ini", neTypeLower)
|
||||
neLicenseDir := filepath.ToSlash(filepath.Dir(neLicensePath))
|
||||
// 修改网元文件权限
|
||||
sshClient.RunCMD(fmt.Sprintf("sudo mkdir -p %s && sudo chmod 775 %s && sudo touch %s && sudo chmod o+rw %s", neLicenseDir, neLicenseDir, neLicensePath, neLicensePath))
|
||||
|
||||
// 尝试备份授权文件
|
||||
neLicensePathBack := fmt.Sprintf("%s/system_%s.ini", neLicensePath, time.Now().Format("20060102_150405"))
|
||||
sshClient.RunCMD(fmt.Sprintf("sudo cp -rf %s/system.ini %s", neLicensePath, neLicensePathBack))
|
||||
|
||||
// 上传授权文件去覆盖
|
||||
if err := sftpClient.CopyFileLocalToRemote(omcLicensePath, neLicensePath); err != nil {
|
||||
return fmt.Errorf("please check if scp remote copy is allowed")
|
||||
}
|
||||
|
||||
// 重启服务
|
||||
if reload {
|
||||
cmdStr := fmt.Sprintf("sudo systemctl restart %s", neTypeLower)
|
||||
switch neTypeLower {
|
||||
case "ims":
|
||||
cmdStr = "ims-stop || true && ims-start"
|
||||
case "omc":
|
||||
cmdStr = "sudo systemctl restart omc"
|
||||
}
|
||||
sshClient.RunCMD(cmdStr)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NeConfOAMReadSync 网元OAM配置文件读取
|
||||
func (r NeInfo) NeConfOAMReadSync(neInfo model.NeInfo) (map[string]any, error) {
|
||||
oamData, err := r.neConfOAMRead(neInfo, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -693,7 +786,7 @@ func (r NeInfo) neConfOAMRead(neInfo model.NeInfo, sync bool) (map[string]any, e
|
||||
neTypeLower := strings.ToLower(neInfo.NeType)
|
||||
fileName := "oam_manager.yaml"
|
||||
// 网管本地路径
|
||||
localFilePath := fmt.Sprintf("/usr/local/omc/backup/ne_config/%s/%s/%s", neTypeLower, neInfo.NeUID, fileName)
|
||||
localFilePath := fmt.Sprintf("/usr/local/omc/backup/ne_config/%s/%d/%s", neTypeLower, neInfo.ID, fileName)
|
||||
if runtime.GOOS == "windows" {
|
||||
localFilePath = fmt.Sprintf("C:%s", localFilePath)
|
||||
}
|
||||
@@ -701,7 +794,7 @@ func (r NeInfo) neConfOAMRead(neInfo model.NeInfo, sync bool) (map[string]any, e
|
||||
// 从网元端同步到本地
|
||||
if sync {
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := r.NeRunSSHClient(neInfo.CoreUID, neInfo.NeUID)
|
||||
sshClient, err := r.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ne info ssh client err")
|
||||
}
|
||||
@@ -752,7 +845,7 @@ func (r NeInfo) neConfOAMWirte(neInfo model.NeInfo, content any, sync bool) erro
|
||||
if runtime.GOOS == "windows" {
|
||||
omcPath = fmt.Sprintf("C:%s", omcPath)
|
||||
}
|
||||
localFilePath := fmt.Sprintf("%s/%s/%s/%s", omcPath, neTypeLower, neInfo.NeUID, fileName)
|
||||
localFilePath := fmt.Sprintf("%s/%s/%d/%s", omcPath, neTypeLower, neInfo.ID, fileName)
|
||||
|
||||
// 写入文件
|
||||
if err := parse.ConvertConfigToFile("yaml", localFilePath, content); err != nil {
|
||||
@@ -762,7 +855,7 @@ func (r NeInfo) neConfOAMWirte(neInfo model.NeInfo, content any, sync bool) erro
|
||||
// 同步到网元端
|
||||
if sync {
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := r.NeRunSSHClient(neInfo.CoreUID, neInfo.NeUID)
|
||||
sshClient, err := r.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -801,13 +894,13 @@ func (r NeInfo) NeConfOAMWirteSync(neInfo model.NeInfo, content map[string]any,
|
||||
httpManageCfg = neConfOAMData["httpManageCfg"].(map[string]any)
|
||||
}
|
||||
httpManageCfg["port"] = neInfo.Port
|
||||
if strings.Contains(neInfo.IPAddr, ":") {
|
||||
if strings.Contains(neInfo.IpAddr, ":") {
|
||||
httpManageCfg["ipType"] = "ipv6"
|
||||
httpManageCfg["ipv6"] = neInfo.IPAddr
|
||||
httpManageCfg["ipv6"] = neInfo.IpAddr
|
||||
}
|
||||
if strings.Contains(neInfo.IPAddr, ".") {
|
||||
if strings.Contains(neInfo.IpAddr, ".") {
|
||||
httpManageCfg["ipType"] = "ipv4"
|
||||
httpManageCfg["ipv4"] = neInfo.IPAddr
|
||||
httpManageCfg["ipv4"] = neInfo.IpAddr
|
||||
}
|
||||
delete(httpManageCfg, "iptype")
|
||||
delete(oamData, "httpmanagecfg")
|
||||
@@ -821,8 +914,7 @@ func (r NeInfo) NeConfOAMWirteSync(neInfo model.NeInfo, content map[string]any,
|
||||
}
|
||||
delete(oamConfig, "neconfig")
|
||||
oamConfig["neConfig"] = map[string]string{
|
||||
"coreId": neInfo.CoreUID,
|
||||
"neUid": neInfo.NeUID,
|
||||
"rmUid": neInfo.NeUid,
|
||||
"neName": neInfo.NeName,
|
||||
"dn": neInfo.Dn,
|
||||
"vendorName": neInfo.VendorName,
|
||||
@@ -868,13 +960,13 @@ func (r NeInfo) NeConfOAMWirteSync(neInfo model.NeInfo, content map[string]any,
|
||||
neConfOAMData := r.neConfOAMData()
|
||||
snmpConfig = neConfOAMData["snmpConfig"].(map[string]any)
|
||||
}
|
||||
if strings.Contains(neInfo.IPAddr, ":") {
|
||||
if strings.Contains(neInfo.IpAddr, ":") {
|
||||
snmpConfig["ipType"] = "ipv6"
|
||||
snmpConfig["ipv6"] = neInfo.IPAddr
|
||||
snmpConfig["ipv6"] = neInfo.IpAddr
|
||||
}
|
||||
if strings.Contains(neInfo.IPAddr, ".") {
|
||||
if strings.Contains(neInfo.IpAddr, ".") {
|
||||
snmpConfig["ipType"] = "ipv4"
|
||||
snmpConfig["ipv4"] = neInfo.IPAddr
|
||||
snmpConfig["ipv4"] = neInfo.IpAddr
|
||||
}
|
||||
delete(snmpConfig, "iptype")
|
||||
if snmpEnable, ok := content["snmpEnable"]; ok && snmpEnable != nil {
|
||||
@@ -936,7 +1028,7 @@ func (r NeInfo) NeConfPara5GRead() (map[string]any, error) {
|
||||
return mapData, nil
|
||||
}
|
||||
|
||||
// NeConfPara5GWirte 网元公共配置文件写入 content内容 syncNE同步到网元端NeType@NeId
|
||||
// NeConfPara5GWirte 网元公共配置文件写入 content内容 syncNE同步到网元列表neUid
|
||||
func (r *NeInfo) NeConfPara5GWirte(content map[string]any, syncNE []string) error {
|
||||
// 网管本地路径
|
||||
omcFilePath := "/usr/local/etc/omc/para5G.yaml"
|
||||
@@ -951,19 +1043,23 @@ func (r *NeInfo) NeConfPara5GWirte(content map[string]any, syncNE []string) erro
|
||||
// 同步到网元端
|
||||
if len(syncNE) > 0 {
|
||||
errMsg := []string{}
|
||||
for _, neTI := range syncNE {
|
||||
ti := strings.SplitN(neTI, "@", 2)
|
||||
for _, neUid := range syncNE {
|
||||
neInfo := r.FindByNeUid(neUid)
|
||||
if neInfo.NeUid != neUid {
|
||||
errMsg = append(errMsg, fmt.Sprintf("neinfo %s : not found", neUid))
|
||||
continue
|
||||
}
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := r.NeRunSSHClient(ti[0], ti[1])
|
||||
sshClient, err := r.NeRunSSHClient(neInfo.ID)
|
||||
if err != nil {
|
||||
errMsg = append(errMsg, fmt.Sprintf("core_ne %s : %s", ti, err.Error()))
|
||||
errMsg = append(errMsg, fmt.Sprintf("neinfo %s : %s", neInfo.NeUid, err.Error()))
|
||||
continue
|
||||
}
|
||||
defer sshClient.Close()
|
||||
// 网元主机的SSH客户端进行文件传输
|
||||
sftpClient, err := sshClient.NewClientSFTP()
|
||||
if err != nil {
|
||||
errMsg = append(errMsg, fmt.Sprintf("%s : %s", ti, err.Error()))
|
||||
errMsg = append(errMsg, fmt.Sprintf("neinfo %s : %s", neInfo.NeUid, err.Error()))
|
||||
continue
|
||||
}
|
||||
defer sftpClient.Close()
|
||||
@@ -975,7 +1071,7 @@ func (r *NeInfo) NeConfPara5GWirte(content map[string]any, syncNE []string) erro
|
||||
sshClient.RunCMD(fmt.Sprintf("sudo mkdir -p %s && sudo chmod 775 %s && sudo touch %s && sudo chmod o+rw %s", neFileDir, neFileDir, neFilePath, neFilePath))
|
||||
// 复制到网元进行覆盖
|
||||
if err = sftpClient.CopyFileLocalToRemote(omcFilePath, neFilePath); err != nil {
|
||||
errMsg = append(errMsg, fmt.Sprintf("%s : please check if scp remote copy is allowed", ti))
|
||||
errMsg = append(errMsg, fmt.Sprintf("neinfo %s : please check if scp remote copy is allowed", neInfo.NeUid))
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"be.ems/src/framework/utils/file"
|
||||
"be.ems/src/modules/ne/model"
|
||||
"be.ems/src/modules/ne/repository"
|
||||
)
|
||||
|
||||
// 实例化服务层 NeLicense 结构体
|
||||
var NewNeLicense = &NeLicense{
|
||||
neLicenseRepository: repository.NewNeLicense,
|
||||
}
|
||||
|
||||
// NeLicense 网元授权激活信息 服务层处理
|
||||
type NeLicense struct {
|
||||
neLicenseRepository *repository.NeLicense // 网元授权激活信息表
|
||||
}
|
||||
|
||||
// FindByPage 分页查询列表数据
|
||||
func (r *NeLicense) FindByPage(query map[string]string) ([]model.NeLicense, int64) {
|
||||
return r.neLicenseRepository.SelectByPage(query)
|
||||
}
|
||||
|
||||
// Find 查询列表
|
||||
func (r *NeLicense) Find(neLicense model.NeLicense) []model.NeLicense {
|
||||
return r.neLicenseRepository.Select(neLicense)
|
||||
}
|
||||
|
||||
// FindById 通过ID查询
|
||||
func (r *NeLicense) FindById(id int64) model.NeLicense {
|
||||
if id <= 0 {
|
||||
return model.NeLicense{}
|
||||
}
|
||||
neLicenses := r.neLicenseRepository.SelectByIds([]int64{id})
|
||||
if len(neLicenses) > 0 {
|
||||
return neLicenses[0]
|
||||
}
|
||||
return model.NeLicense{}
|
||||
}
|
||||
|
||||
// Insert 新增信息
|
||||
func (r *NeLicense) Insert(neLicense model.NeLicense) int64 {
|
||||
return r.neLicenseRepository.Insert(neLicense)
|
||||
}
|
||||
|
||||
// Update 修改信息
|
||||
func (r *NeLicense) Update(neLicense model.NeLicense) int64 {
|
||||
return r.neLicenseRepository.Update(neLicense)
|
||||
}
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
func (r *NeLicense) DeleteByIds(ids []int64) (int64, error) {
|
||||
// 检查是否存在
|
||||
rowIds := r.neLicenseRepository.SelectByIds(ids)
|
||||
if len(rowIds) <= 0 {
|
||||
return 0, fmt.Errorf("neLicense.noData")
|
||||
}
|
||||
|
||||
if len(rowIds) == len(ids) {
|
||||
rows := r.neLicenseRepository.DeleteByIds(ids)
|
||||
return rows, nil
|
||||
}
|
||||
// 删除信息失败!
|
||||
return 0, fmt.Errorf("delete fail")
|
||||
}
|
||||
|
||||
// FindByCoreUidAndNeUid 通过核心网和网元唯一标识查询
|
||||
func (r *NeLicense) FindByCoreUidAndNeUid(coreUid, neUid string) model.NeLicense {
|
||||
neLicenses := r.neLicenseRepository.Select(model.NeLicense{
|
||||
CoreUID: coreUid,
|
||||
NeUID: neUid,
|
||||
})
|
||||
if len(neLicenses) > 0 {
|
||||
return neLicenses[0]
|
||||
}
|
||||
return model.NeLicense{}
|
||||
}
|
||||
|
||||
// ReadLicenseInfo 读取授权文件信息
|
||||
// 返回激活申请码, 激活文件
|
||||
func (r *NeLicense) ReadLicenseInfo(neLicense model.NeLicense) (string, string) {
|
||||
neTypeLower := strings.ToLower(neLicense.NeType)
|
||||
// 网管本地路径
|
||||
omcPath := "/usr/local/omc/backup/ne_license"
|
||||
if runtime.GOOS == "windows" {
|
||||
omcPath = fmt.Sprintf("C:%s", omcPath)
|
||||
}
|
||||
omcPath = fmt.Sprintf("%s/%s/%s", omcPath, neTypeLower, neLicense.NeUID)
|
||||
// 网元端授权文件路径
|
||||
nePath := fmt.Sprintf("/usr/local/etc/%s/license", neTypeLower)
|
||||
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := NewNeInfo.NeRunSSHClient(neLicense.CoreUID, neLicense.NeUID)
|
||||
if err != nil {
|
||||
return "", ""
|
||||
}
|
||||
defer sshClient.Close()
|
||||
// 网元主机的SSH客户端进行文件传输
|
||||
sftpClient, err := sshClient.NewClientSFTP()
|
||||
if err != nil {
|
||||
return "", ""
|
||||
}
|
||||
defer sftpClient.Close()
|
||||
|
||||
// 复制授权申请码到本地
|
||||
if err = sftpClient.CopyFileRemoteToLocal(nePath+"/Activation_request_code.txt", omcPath+"/Activation_request_code.txt"); err != nil {
|
||||
return "", ""
|
||||
}
|
||||
// 读取文件内容
|
||||
bytes, err := os.ReadFile(omcPath + "/Activation_request_code.txt")
|
||||
if err != nil {
|
||||
return "", ""
|
||||
}
|
||||
|
||||
// 复制激活文件到本地
|
||||
licensePath := ""
|
||||
if err = sftpClient.CopyFileRemoteToLocal(nePath+"/system.ini", omcPath+"/system.ini"); err == nil {
|
||||
licensePath = omcPath + "/system.ini"
|
||||
}
|
||||
|
||||
activationRequestCode := string(bytes)
|
||||
parts := strings.Split(activationRequestCode, "\n")
|
||||
if len(parts) > 1 && strings.HasPrefix(parts[0], "SN") {
|
||||
activationRequestCode = parts[1] // 获取第二行内容
|
||||
}
|
||||
return strings.TrimSpace(activationRequestCode), licensePath
|
||||
}
|
||||
|
||||
// UploadLicense 授权文件上传到网元主机
|
||||
func (r *NeLicense) UploadLicense(neLicense model.NeLicense) error {
|
||||
// 检查文件是否存在
|
||||
omcLicensePath := file.ParseUploadFileAbsPath(neLicense.LicensePath)
|
||||
if _, err := os.Stat(omcLicensePath); err != nil {
|
||||
return fmt.Errorf("file read failure")
|
||||
}
|
||||
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := NewNeInfo.NeRunSSHClient(neLicense.CoreUID, neLicense.NeUID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer sshClient.Close()
|
||||
// 网元主机的SSH客户端进行文件传输
|
||||
sftpClient, err := sshClient.NewClientSFTP()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer sftpClient.Close()
|
||||
|
||||
// 网元端授权文件路径
|
||||
neTypeLower := strings.ToLower(neLicense.NeType)
|
||||
neLicensePath := fmt.Sprintf("/usr/local/etc/%s/license/system.ini", neTypeLower)
|
||||
neLicenseDir := filepath.ToSlash(filepath.Dir(neLicensePath))
|
||||
// 修改网元文件权限
|
||||
sshClient.RunCMD(fmt.Sprintf("sudo mkdir -p %s && sudo chmod 775 %s && sudo touch %s && sudo chmod o+rw %s", neLicenseDir, neLicenseDir, neLicensePath, neLicensePath))
|
||||
|
||||
// 尝试备份授权文件
|
||||
neLicensePathBack := fmt.Sprintf("%s/system_%s.ini", neLicensePath, time.Now().Format("20060102_150405"))
|
||||
sshClient.RunCMD(fmt.Sprintf("sudo cp -rf %s/system.ini %s", neLicensePath, neLicensePathBack))
|
||||
|
||||
// 上传授权文件去覆盖
|
||||
if err := sftpClient.CopyFileLocalToRemote(omcLicensePath, neLicensePath); err != nil {
|
||||
return fmt.Errorf("please check if scp remote copy is allowed")
|
||||
}
|
||||
|
||||
// 重启服务
|
||||
if neLicense.Reload {
|
||||
cmdStr := fmt.Sprintf("sudo systemctl restart %s", neTypeLower)
|
||||
switch neTypeLower {
|
||||
case "ims":
|
||||
cmdStr = "ims-stop || true && ims-start"
|
||||
case "omc":
|
||||
cmdStr = "sudo systemctl restart omc"
|
||||
}
|
||||
sshClient.RunCMD(cmdStr)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func (r NeSoftware) Insert(neSoftware model.NeSoftware) int64 {
|
||||
inserId := r.neSoftwareRepository.Insert(neSoftware)
|
||||
if inserId > 0 {
|
||||
// 更新同类型的新包版本
|
||||
neVersions := r.neVersionService.Find(model.NeVersion{NeType: neSoftware.NeType}, false)
|
||||
neVersions := r.neVersionService.FindByNeType(neSoftware.NeType)
|
||||
if len(neVersions) > 0 {
|
||||
for _, neVersion := range neVersions {
|
||||
neVersion.NewName = neSoftware.Name
|
||||
@@ -68,12 +68,12 @@ func (r NeSoftware) Update(neSoftware model.NeSoftware) int64 {
|
||||
rows := r.neSoftwareRepository.Update(neSoftware)
|
||||
if rows > 0 {
|
||||
// 更新同类型的新包版本
|
||||
neVersions := r.neVersionService.Find(model.NeVersion{
|
||||
NeType: neSoftware.NeType,
|
||||
Status: "3",
|
||||
}, false)
|
||||
neVersions := r.neVersionService.FindByNeType(neSoftware.NeType)
|
||||
if len(neVersions) > 0 {
|
||||
for _, neVersion := range neVersions {
|
||||
if neVersion.Status != "3" {
|
||||
continue
|
||||
}
|
||||
neVersion.NewName = neSoftware.Name
|
||||
neVersion.NewVersion = neSoftware.Version
|
||||
neVersion.NewPath = neSoftware.Path
|
||||
@@ -127,18 +127,18 @@ func (r NeSoftware) CheckUniqueTypeAndNameAndVersion(neType, name, version strin
|
||||
return uniqueId == 0
|
||||
}
|
||||
|
||||
// UpdateVersions 更新软件包对应网元的新版本
|
||||
func (r NeSoftware) UpdateVersions(neSoftware model.NeSoftware, neVersion model.NeVersion) int64 {
|
||||
// UpdateVersion 更新软件包对应网元的新版本
|
||||
func (r NeSoftware) UpdateVersion(neSoftware model.NeSoftware) int64 {
|
||||
var rows int64 = 0
|
||||
// 更新同类型的新包版本
|
||||
neVersions := r.neVersionService.Find(neVersion, false)
|
||||
neVersions := r.neVersionService.FindByNeType(neSoftware.NeType)
|
||||
if len(neVersions) > 0 {
|
||||
for _, v := range neVersions {
|
||||
v.NewName = neSoftware.Name
|
||||
v.NewVersion = neSoftware.Version
|
||||
v.NewPath = neSoftware.Path
|
||||
v.Status = "3"
|
||||
v.UpdateBy = neVersion.UpdateBy
|
||||
v.UpdateBy = neSoftware.UpdateBy
|
||||
rows += r.neVersionService.Update(v)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@ func (r NeVersion) checkNeVersion(arr *[]model.NeVersion) {
|
||||
for i := range *arr {
|
||||
item := (*arr)[i]
|
||||
// 查询网元获取IP
|
||||
neInfo := r.neInfoService.FindByCoreUidAndNeUid(item.CoreUID, item.NeUID)
|
||||
if neInfo.CoreUID != item.CoreUID || neInfo.NeUID != item.NeUID {
|
||||
neInfo := r.neInfoService.FindById(item.NeID, false)
|
||||
if neInfo.ID != item.NeID {
|
||||
continue
|
||||
}
|
||||
result, err := neFetchlink.NeState(neInfo)
|
||||
@@ -72,9 +72,6 @@ func (r NeVersion) checkNeVersion(arr *[]model.NeVersion) {
|
||||
// item.Path = "-"
|
||||
item.Version = ver
|
||||
}
|
||||
if item.NeType != neInfo.NeType {
|
||||
item.NeType = neInfo.NeType
|
||||
}
|
||||
r.Update(item)
|
||||
(*arr)[i] = item
|
||||
}
|
||||
@@ -118,11 +115,10 @@ func (r NeVersion) DeleteByIds(ids []int64) (int64, error) {
|
||||
return 0, fmt.Errorf("delete fail")
|
||||
}
|
||||
|
||||
// FindByCoreUidAndNeUid 通过核心网和网元唯一标识查询
|
||||
func (r NeVersion) FindByCoreUidAndNeUid(coreUid, neUid string) model.NeVersion {
|
||||
// FindByNeId 通过网元ID查询
|
||||
func (r NeVersion) FindByNeId(neId int64) model.NeVersion {
|
||||
neVersions := r.neVersionRepository.Select(model.NeVersion{
|
||||
CoreUID: coreUid,
|
||||
NeUID: neUid,
|
||||
NeID: neId,
|
||||
})
|
||||
if len(neVersions) > 0 {
|
||||
return neVersions[0]
|
||||
@@ -130,12 +126,45 @@ func (r NeVersion) FindByCoreUidAndNeUid(coreUid, neUid string) model.NeVersion
|
||||
return model.NeVersion{}
|
||||
}
|
||||
|
||||
// FindByNeUid 通过网元类型查询
|
||||
func (r NeVersion) FindByNeUid(neUid string) model.NeVersion {
|
||||
neInfo := r.neInfoService.FindByNeUid(neUid)
|
||||
if neInfo.ID <= 0 {
|
||||
return model.NeVersion{}
|
||||
}
|
||||
neVersion := r.FindByNeId(neInfo.ID)
|
||||
if neVersion.ID > 0 {
|
||||
return neVersion
|
||||
}
|
||||
return model.NeVersion{}
|
||||
}
|
||||
|
||||
// FindByNeType 通过网元类型查询
|
||||
func (r NeVersion) FindByNeType(neType string) []model.NeVersion {
|
||||
neVersions := make([]model.NeVersion, 0)
|
||||
neInfos := r.neInfoService.FindByNeType(neType)
|
||||
if len(neInfos) <= 0 {
|
||||
return neVersions
|
||||
}
|
||||
for _, neInfo := range neInfos {
|
||||
neVersion := r.FindByNeId(neInfo.ID)
|
||||
if neVersion.ID > 0 {
|
||||
neVersions = append(neVersions, neVersion)
|
||||
}
|
||||
}
|
||||
return neVersions
|
||||
}
|
||||
|
||||
// Operate 操作版本上传到网元主机执行命令
|
||||
//
|
||||
// action 安装行为:install upgrade rollback
|
||||
func (r NeVersion) Operate(action string, neVersion model.NeVersion, preinput map[string]string) (string, error) {
|
||||
neInfo := r.neInfoService.FindByNeId(neVersion.NeID)
|
||||
if neInfo.ID != neVersion.NeID {
|
||||
return "", fmt.Errorf("neinfo not found")
|
||||
}
|
||||
// 网元主机的SSH客户端
|
||||
sshClient, err := r.neInfoService.NeRunSSHClient(neVersion.CoreUID, neVersion.NeUID)
|
||||
sshClient, err := r.neInfoService.NeRunSSHClient(neVersion.NeID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -161,19 +190,19 @@ func (r NeVersion) Operate(action string, neVersion model.NeVersion, preinput ma
|
||||
if para5GMap == nil || err != nil {
|
||||
return "", fmt.Errorf("error read para5G file info")
|
||||
}
|
||||
if err := r.neInfoService.NeConfPara5GWirte(para5GMap, []string{fmt.Sprintf("%s@%s", neVersion.CoreUID, neVersion.NeUID)}); err != nil {
|
||||
if err := r.neInfoService.NeConfPara5GWirte(para5GMap, []string{neInfo.NeUid}); err != nil {
|
||||
return "", fmt.Errorf("error wirte para5G file info")
|
||||
}
|
||||
}
|
||||
|
||||
// ========= 命令生成阶段 =========
|
||||
okFlagStr, cmdStrArr, err := r.operateCommand(action, neVersion.NeType, neFilePaths)
|
||||
okFlagStr, cmdStrArr, err := r.operateCommand(action, neInfo.NeType, neFilePaths)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// ========= 执行阶段 =========
|
||||
commandLine, err := r.operateRun(sshClient, preinput, cmdStrArr, neVersion.NeType, okFlagStr)
|
||||
commandLine, err := r.operateRun(sshClient, preinput, cmdStrArr, neInfo.NeType, okFlagStr)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -693,8 +722,8 @@ func (r NeVersion) operateRun(sshClient *ssh.ConnSSH, preinput map[string]string
|
||||
func (r NeVersion) operateDome(action string, neVersion model.NeVersion) error {
|
||||
if action == "install" {
|
||||
// 网元信息
|
||||
neInfo := r.neInfoService.FindByCoreUidAndNeUid(neVersion.CoreUID, neVersion.NeUID)
|
||||
if neInfo.CoreUID != neVersion.CoreUID || neInfo.NeUID != neVersion.NeUID {
|
||||
neInfo := r.neInfoService.FindByNeId(neVersion.NeID)
|
||||
if neInfo.ID != neVersion.NeID {
|
||||
return fmt.Errorf("error found neinfo")
|
||||
}
|
||||
|
||||
@@ -714,31 +743,31 @@ func (r NeVersion) operateDome(action string, neVersion model.NeVersion) error {
|
||||
smsHost := fmt.Sprintf("sudo sed -i '/^%s smsc.*smsc$/c\\' /etc/hosts", para5GData["SIP_IP"])
|
||||
|
||||
// IMS 配置
|
||||
imsNEs := r.neInfoService.Find(model.NeInfo{NeType: "IMS"}, false, false)
|
||||
imsNEs := r.neInfoService.FindByNeType("IMS")
|
||||
for _, v := range imsNEs {
|
||||
r.neInfoService.NeRunSSHCmd(v.CoreUID, v.NeUID, smscIPCMD)
|
||||
r.neInfoService.NeRunSSHCmd(v.CoreUID, v.NeUID, smscHostCMD)
|
||||
r.neInfoService.NeRunSSHCmd(v.CoreUID, v.NeUID, smsHost)
|
||||
r.neInfoService.NeRunSSHCmd(v.CoreUID, v.NeUID, "sudo sed -i '/^#!define WITH_SMS/ s/^/#/' /usr/local/etc/ims/vars.cfg")
|
||||
r.neInfoService.NeRunSSHCmd(v.CoreUID, v.NeUID, "ims-stop || true && ims-start")
|
||||
r.neInfoService.NeRunSSHCmd(v.ID, smscIPCMD)
|
||||
r.neInfoService.NeRunSSHCmd(v.ID, smscHostCMD)
|
||||
r.neInfoService.NeRunSSHCmd(v.ID, smsHost)
|
||||
r.neInfoService.NeRunSSHCmd(v.ID, "sudo sed -i '/^#!define WITH_SMS/ s/^/#/' /usr/local/etc/ims/vars.cfg")
|
||||
r.neInfoService.NeRunSSHCmd(v.ID, "ims-stop || true && ims-start")
|
||||
}
|
||||
// UDM 配置
|
||||
smscASName := fmt.Sprintf("sudo sed -i \"/- name: 'sms_as'/{n;s|serverName: .*|serverName: 'sip:%s:5060'|}\" /usr/local/etc/udm/as.yaml", para5GData["SMSC_IP"])
|
||||
smscASAddress := fmt.Sprintf("sudo sed -i \"/- name: 'sms_as'/{n;n;n;s|diameterAddress: .*|diameterAddress: 'smsc.ims.%s.3gppnetwork.org'|}\" /usr/local/etc/udm/as.yaml", mnc_mcc)
|
||||
udmNEs := r.neInfoService.Find(model.NeInfo{NeType: "UDM"}, false, false)
|
||||
udmNEs := r.neInfoService.FindByNeType("UDM")
|
||||
for _, v := range udmNEs {
|
||||
r.neInfoService.NeRunSSHCmd(v.CoreUID, v.NeUID, smscIPCMD)
|
||||
r.neInfoService.NeRunSSHCmd(v.CoreUID, v.NeUID, smscHostCMD)
|
||||
r.neInfoService.NeRunSSHCmd(v.CoreUID, v.NeUID, smscASName)
|
||||
r.neInfoService.NeRunSSHCmd(v.CoreUID, v.NeUID, smscASAddress)
|
||||
r.neInfoService.NeRunSSHCmd(v.CoreUID, v.NeUID, "sudo service udm restart")
|
||||
r.neInfoService.NeRunSSHCmd(v.ID, smscIPCMD)
|
||||
r.neInfoService.NeRunSSHCmd(v.ID, smscHostCMD)
|
||||
r.neInfoService.NeRunSSHCmd(v.ID, smscASName)
|
||||
r.neInfoService.NeRunSSHCmd(v.ID, smscASAddress)
|
||||
r.neInfoService.NeRunSSHCmd(v.ID, "sudo service udm restart")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新Version
|
||||
verInfo := r.FindByCoreUidAndNeUid(neVersion.CoreUID, neVersion.NeUID)
|
||||
if verInfo.CoreUID == neVersion.CoreUID && verInfo.NeUID == neVersion.NeUID {
|
||||
verInfo := r.FindById(neVersion.NeID)
|
||||
if verInfo.NeID == neVersion.NeID {
|
||||
curName := verInfo.Name
|
||||
curVersion := verInfo.Version
|
||||
curPath := verInfo.Path
|
||||
|
||||
@@ -61,6 +61,17 @@ func (s AlarmController) List(c *gin.Context) {
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
if query.NeUID != "" {
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg("neInfo not found"))
|
||||
return
|
||||
}
|
||||
query.NeID = neInfo.ID
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
rows, total := s.alarmService.FindByPage(query)
|
||||
c.JSON(200, resp.OkData(map[string]any{"rows": rows, "total": total}))
|
||||
@@ -99,8 +110,7 @@ func (s AlarmController) Remove(c *gin.Context) {
|
||||
// PUT /clear
|
||||
func (s AlarmController) Clear(c *gin.Context) {
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
Id int64 `json:"id" binding:"required"`
|
||||
ID string `form:"id" json:"id" binding:"required"` // 记录ID 批量多个逗号分隔
|
||||
}
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
@@ -108,10 +118,17 @@ func (s AlarmController) Clear(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// 处理字符转id数组后去重
|
||||
uniqueIDs := parse.RemoveDuplicatesToArray(body.ID, ",")
|
||||
// 转换成int64数组类型
|
||||
ids := make([]int64, 0)
|
||||
for _, v := range uniqueIDs {
|
||||
ids = append(ids, parse.Number(v))
|
||||
}
|
||||
|
||||
clearUser := reqctx.LoginUserToUserName(c)
|
||||
rows, err := s.alarmService.ClearById(
|
||||
body.Id,
|
||||
body.CoreUID,
|
||||
rows, err := s.alarmService.ClearByIds(
|
||||
ids,
|
||||
clearUser,
|
||||
constants.ALARM_CLEAR_TYPE_MANUAL_CLEAR,
|
||||
)
|
||||
@@ -127,9 +144,7 @@ func (s AlarmController) Clear(c *gin.Context) {
|
||||
// PUT /ack
|
||||
func (s AlarmController) Ack(c *gin.Context) {
|
||||
var body struct {
|
||||
CoreUID string `json:"coreUid" form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
Id int64 `json:"id" binding:"required"`
|
||||
AckState bool `json:"ackState" binding:"omitempty"`
|
||||
ID string `form:"id" json:"id" binding:"required"` // 记录ID 批量多个逗号分隔
|
||||
}
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
@@ -137,10 +152,17 @@ func (s AlarmController) Ack(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// 处理字符转id数组后去重
|
||||
uniqueIDs := parse.RemoveDuplicatesToArray(body.ID, ",")
|
||||
// 转换成int64数组类型
|
||||
ids := make([]int64, 0)
|
||||
for _, v := range uniqueIDs {
|
||||
ids = append(ids, parse.Number(v))
|
||||
}
|
||||
|
||||
ackUser := reqctx.LoginUserToUserName(c)
|
||||
rows, err := s.alarmService.AckById(
|
||||
body.Id,
|
||||
body.CoreUID,
|
||||
rows, err := s.alarmService.AckByIds(
|
||||
ids,
|
||||
ackUser,
|
||||
constants.ALARM_ACK_STATE_ACK,
|
||||
)
|
||||
@@ -156,7 +178,6 @@ func (s AlarmController) Ack(c *gin.Context) {
|
||||
// GET /count/severity
|
||||
func (s AlarmController) CountSeverity(c *gin.Context) {
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
AlarmStatus string `json:"alarmStatus" form:"alarmStatus" binding:"required,oneof=Clear Active"` // 告警状态
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
@@ -165,7 +186,7 @@ func (s AlarmController) CountSeverity(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
data := s.alarmService.CountSeverity(query.CoreUID, query.AlarmStatus)
|
||||
data := s.alarmService.CountSeverity(query.AlarmStatus)
|
||||
c.JSON(200, resp.OkData(data))
|
||||
}
|
||||
|
||||
@@ -174,7 +195,6 @@ func (s AlarmController) CountSeverity(c *gin.Context) {
|
||||
// GET /count/type
|
||||
func (s AlarmController) CountType(c *gin.Context) {
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
AlarmStatus string `json:"alarmStatus" form:"alarmStatus" binding:"required,oneof=Clear Active"` // 告警状态
|
||||
}
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
@@ -183,7 +203,7 @@ func (s AlarmController) CountType(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
data := s.alarmService.CountType(query.CoreUID, query.AlarmStatus)
|
||||
data := s.alarmService.CountType(query.AlarmStatus)
|
||||
c.JSON(200, resp.OkData(data))
|
||||
}
|
||||
|
||||
@@ -192,7 +212,6 @@ func (s AlarmController) CountType(c *gin.Context) {
|
||||
// GET /count/top
|
||||
func (s AlarmController) CountTop(c *gin.Context) {
|
||||
var query struct {
|
||||
CoreUID string `form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
AlarmStatus string `json:"alarmStatus" form:"alarmStatus" binding:"required,oneof=Clear Active"` // 告警状态
|
||||
Top int `json:"top" form:"top" binding:"required"` // 前几
|
||||
}
|
||||
@@ -202,7 +221,7 @@ func (s AlarmController) CountTop(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
data := s.alarmService.CountNe(query.CoreUID, query.AlarmStatus, query.Top)
|
||||
data := s.alarmService.CountNe(query.AlarmStatus, query.Top)
|
||||
c.JSON(200, resp.OkData(data))
|
||||
}
|
||||
|
||||
@@ -239,10 +258,17 @@ func (s AlarmController) Export(c *gin.Context) {
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
// 限制导出数据集
|
||||
if query.PageSize > 10000 {
|
||||
query.PageSize = 10000
|
||||
|
||||
if query.NeUID != "" {
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg("neInfo not found"))
|
||||
return
|
||||
}
|
||||
query.NeID = neInfo.ID
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
rows, total := s.alarmService.FindByPage(query)
|
||||
if total == 0 {
|
||||
|
||||
@@ -66,9 +66,9 @@ func (s BackupController) FTPInfo(c *gin.Context) {
|
||||
// POST /ftp
|
||||
func (s BackupController) FTPPush(c *gin.Context) {
|
||||
var body struct {
|
||||
Path string `form:"path" binding:"required"` // 路径必须是 BACKUP_DIR 开头的路径
|
||||
Filename string `form:"fileName" binding:"required"`
|
||||
Tag string `form:"tag" binding:"required"` // 标签,用于区分不同的备份文件
|
||||
Path string `json:"path" binding:"required"` // 路径必须是 BACKUP_DIR 开头的路径
|
||||
Filename string `json:"fileName" binding:"required"`
|
||||
Tag string `json:"tag" binding:"required"` // 标签,用于区分不同的备份文件
|
||||
}
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
|
||||
@@ -47,22 +47,22 @@ type KPIController struct {
|
||||
// @Router /ne/data/kpi/data [get]
|
||||
func (s KPIController) KPIData(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var querys model.KPIQuery
|
||||
if err := c.ShouldBindQuery(&querys); err != nil {
|
||||
var query model.KPIQuery
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(querys.CoreUID, querys.NeUID)
|
||||
if neInfo.CoreUID != querys.CoreUID || neInfo.NeUID != querys.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
kpiData := s.kpiReportService.FindData(querys)
|
||||
kpiData := s.kpiReportService.FindData(neInfo.NeType, neInfo.ID, query)
|
||||
c.JSON(200, resp.OkData(kpiData))
|
||||
}
|
||||
|
||||
|
||||
@@ -49,22 +49,22 @@ type KPICController struct {
|
||||
// @Router /ne/data/kpic/data [get]
|
||||
func (s KPICController) KPIData(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var querys model.KPICQuery
|
||||
if err := c.ShouldBindQuery(&querys); err != nil {
|
||||
var query model.KPICQuery
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(querys.CoreUID, querys.NeUID)
|
||||
if neInfo.CoreUID != querys.CoreUID || neInfo.NeUID != querys.NeUID {
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
kpiData := s.kpicReportService.FindData(querys)
|
||||
kpiData := s.kpicReportService.FindData(neInfo.NeType, neInfo.ID, query)
|
||||
c.JSON(200, resp.OkData(kpiData))
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ type NBStateController struct {
|
||||
// @Description Base Station Status List
|
||||
// @Router /nb-state/list [get]
|
||||
func (s NBStateController) List(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
var query model.NBStateQuery
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
@@ -57,12 +56,13 @@ func (s NBStateController) List(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元信息 rmUID
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(query.CoreUID, query.NeUID)
|
||||
if neInfo.CoreUID != query.CoreUID || neInfo.NeUID != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg("neInfo not found"))
|
||||
return
|
||||
}
|
||||
query.NeID = neInfo.ID
|
||||
|
||||
// 查询数据
|
||||
rows, total := s.nbStateService.FindByPage(query)
|
||||
@@ -85,24 +85,23 @@ func (s NBStateController) List(c *gin.Context) {
|
||||
func (s NBStateController) Export(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
var querys model.NBStateQuery
|
||||
if err := c.ShouldBindBodyWithJSON(&querys); err != nil {
|
||||
var query model.NBStateQuery
|
||||
if err := c.ShouldBindBodyWithJSON(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
// 限制导出数据集
|
||||
if querys.PageSize > 10000 {
|
||||
querys.PageSize = 10000
|
||||
}
|
||||
// 查询网元信息 rmUID
|
||||
neInfo := s.neInfoService.FindByCoreUidAndNeUid(querys.CoreUID, querys.NeUID)
|
||||
if neInfo.CoreUID != querys.CoreUID || neInfo.NeUID != querys.NeUID {
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg("neInfo not found"))
|
||||
return
|
||||
}
|
||||
query.NeID = neInfo.ID
|
||||
|
||||
rows, total := s.nbStateService.FindByPage(querys)
|
||||
// 查询数据
|
||||
rows, total := s.nbStateService.FindByPage(query)
|
||||
if total == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
|
||||
@@ -46,13 +46,21 @@ type NEStateController struct {
|
||||
// @Description NE Status Record - Memory/CPU/Disk List
|
||||
// @Router /ne-state/list [get]
|
||||
func (s NEStateController) List(c *gin.Context) {
|
||||
var query model.NEStateQuery
|
||||
var query model.NeStateQuery
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元获取IP
|
||||
neInfo := s.neInfoService.FindByNeUid(query.NeUID)
|
||||
if neInfo.ID == 0 || neInfo.NeUid != query.NeUID {
|
||||
c.JSON(200, resp.ErrMsg("neInfo not found"))
|
||||
return
|
||||
}
|
||||
query.NeID = neInfo.ID
|
||||
|
||||
// 查询数据
|
||||
rows, total := s.neStateService.FindByPage(query)
|
||||
c.JSON(200, resp.OkData(map[string]any{"rows": rows, "total": total}))
|
||||
|
||||
@@ -3,14 +3,13 @@ package model
|
||||
// Alarm 告警记录
|
||||
type Alarm struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||
CoreUID string `json:"coreUid" gorm:"column:core_uid"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" gorm:"column:ne_uid"` // 网元唯一标识
|
||||
NeType string `json:"neType" gorm:"column:ne_type"` // 网元类型
|
||||
AlarmSeq int64 `json:"alarmSeq" gorm:"column:alarm_seq"` // 告警序号 连续递增
|
||||
NeID int64 `json:"neId" gorm:"column:ne_id" binding:"required"` // 网元ID
|
||||
CreatedTime int64 `json:"createdTime" gorm:"column:created_time"` // 创建时间
|
||||
AlarmSeq int64 `json:"alarmSeq" gorm:"column:alarm_seq"` // 告警序号 同网元类型连续递增
|
||||
AlarmId string `json:"alarmId" gorm:"column:alarm_id"` // 告警ID
|
||||
AlarmTitle string `json:"alarmTitle" gorm:"column:alarm_title"` // 告警标题
|
||||
AlarmCode int64 `json:"alarmCode" gorm:"column:alarm_code"` // 告警状态码
|
||||
EventTime int64 `json:"eventTime" gorm:"column:event_time"` // 事件产生时间
|
||||
EventTime int64 `json:"eventTime" gorm:"column:event_time"` // 产生时间
|
||||
AlarmType string `json:"alarmType" gorm:"column:alarm_type"` // 告警类型
|
||||
OrigSeverity string `json:"origSeverity" gorm:"column:orig_severity"` // 严重程度
|
||||
PerceivedSeverity string `json:"perceivedSeverity" gorm:"column:perceived_severity"` // 告警级别
|
||||
@@ -28,7 +27,12 @@ type Alarm struct {
|
||||
ClearType string `json:"clearType" gorm:"column:clear_type"` // 清除状态
|
||||
ClearTime int64 `json:"clearTime" gorm:"column:clear_time"` // 清除时间
|
||||
ClearUser string `json:"clearUser" gorm:"column:clear_user"` // 清除用户
|
||||
CreatedAt int64 `json:"createdAt" gorm:"column:created_at"` // 记录创建存储毫秒
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
NeUid string `json:"neUid,omitempty" gorm:"->"` // 网元唯一标识
|
||||
NeName string `json:"neName,omitempty" gorm:"->"` // 网元名称
|
||||
NeType string `json:"neType,omitempty" gorm:"->"` // 网元类型
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
@@ -38,16 +42,15 @@ func (*Alarm) TableName() string {
|
||||
|
||||
// AlarmQuery 告警数据查询参数结构体
|
||||
type AlarmQuery struct {
|
||||
CoreUID string `json:"coreUid" form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" form:"neUid"` // 网元唯一标识
|
||||
NeType string `json:"neType" form:"neType"` // 网元类型
|
||||
NeID int64 `json:"neId" form:"neId"` // 网元ID
|
||||
AlarmCode string `json:"alarmCode" form:"alarmCode"`
|
||||
AlarmType string `json:"alarmType" form:"alarmType"`
|
||||
AlarmStatus string `json:"alarmStatus" form:"alarmStatus" binding:"omitempty,oneof=Clear Active"` // 告警状态
|
||||
OrigSeverity string `json:"origSeverity" form:"origSeverity"` // 告警类型
|
||||
BeginTime int64 `json:"beginTime" form:"beginTime"` // 开始时间 查event_time
|
||||
BeginTime int64 `json:"beginTime" form:"beginTime"` // 开始时间 查created_time
|
||||
EndTime int64 `json:"endTime" form:"endTime"`
|
||||
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=event_time id"` // 排序字段,填写结果字段
|
||||
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=createdTime id"` // 排序字段,填写结果字段
|
||||
SortOrder string `json:"sortOrder" form:"sortOrder" binding:"omitempty,oneof=asc desc"` // 排序升降序,asc desc
|
||||
PageNum int64 `json:"pageNum" form:"pageNum" binding:"required"`
|
||||
PageSize int64 `json:"pageSize" form:"pageSize" binding:"required"`
|
||||
|
||||
@@ -3,14 +3,13 @@ package model
|
||||
// AlarmEvent 告警_事件记录表
|
||||
type AlarmEvent struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||
CoreUID string `json:"coreUid" gorm:"column:core_uid"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" gorm:"column:ne_uid"` // 网元唯一标识
|
||||
NeType string `json:"neType" gorm:"column:ne_type"` // 网元类型
|
||||
NeID int64 `json:"neId" gorm:"column:ne_id" binding:"required"` // 网元ID
|
||||
CreatedTime int64 `json:"createdTime" gorm:"column:created_time"` // 创建时间
|
||||
AlarmSeq int64 `json:"alarmSeq" gorm:"column:alarm_seq"` // 告警序号 连续递增
|
||||
AlarmId string `json:"alarmId" gorm:"column:alarm_id"` // 告警ID
|
||||
AlarmTitle string `json:"alarmTitle" gorm:"column:alarm_title"` // 告警标题
|
||||
AlarmCode int64 `json:"alarmCode" gorm:"column:alarm_code"` // 告警状态码
|
||||
EventTime int64 `json:"eventTime" gorm:"column:event_time"` // 事件产生时间
|
||||
EventTime int64 `json:"eventTime" gorm:"column:event_time"` // 产生时间
|
||||
ObjectUid string `json:"objectUid" gorm:"column:object_uid"` // 对象ID
|
||||
ObjectName string `json:"objectName" gorm:"column:object_name"` // 对象名称
|
||||
ObjectType string `json:"objectType" gorm:"column:object_type"` // 对象类型
|
||||
@@ -22,7 +21,12 @@ type AlarmEvent struct {
|
||||
ClearType string `json:"clearType" gorm:"column:clear_type"` // 清除状态
|
||||
ClearTime int64 `json:"clearTime" gorm:"column:clear_time"` // 清除时间
|
||||
ClearUser string `json:"clearUser" gorm:"column:clear_user"` // 清除用户
|
||||
CreatedAt int64 `json:"createdAt" gorm:"column:created_at"` // 记录创建存储毫秒
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
NeUid string `json:"neUid,omitempty" gorm:"->"` // 网元唯一标识
|
||||
NeName string `json:"neName,omitempty" gorm:"->"` // 网元名称
|
||||
NeType string `json:"neType,omitempty" gorm:"->"` // 网元类型
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
@@ -32,14 +36,13 @@ func (*AlarmEvent) TableName() string {
|
||||
|
||||
// AlarmEventQuery 告警事件数据查询参数结构体
|
||||
type AlarmEventQuery struct {
|
||||
CoreUID string `json:"coreUid" form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" form:"neUid"` // 网元唯一标识
|
||||
NeType string `json:"neType" form:"neType"` // 网元类型
|
||||
NeID int64 `json:"neId" form:"neId"` // 网元ID
|
||||
AlarmCode string `json:"alarmCode" form:"alarmCode"`
|
||||
AlarmStatus string `json:"alarmStatus" form:"alarmStatus" binding:"omitempty,oneof=Clear Active"` // 告警状态
|
||||
BeginTime int64 `json:"beginTime" form:"beginTime"` // 开始时间 查event_time
|
||||
BeginTime int64 `json:"beginTime" form:"beginTime"` // 开始时间 查created_time
|
||||
EndTime int64 `json:"endTime" form:"endTime"`
|
||||
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=event_time id"` // 排序字段,填写结果字段
|
||||
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=createdTime eventTime id"` // 排序字段,填写结果字段
|
||||
SortOrder string `json:"sortOrder" form:"sortOrder" binding:"omitempty,oneof=asc desc"` // 排序升降序,asc desc
|
||||
PageNum int64 `json:"pageNum" form:"pageNum" binding:"required"`
|
||||
PageSize int64 `json:"pageSize" form:"pageSize" binding:"required"`
|
||||
|
||||
@@ -3,9 +3,8 @@ package model
|
||||
// AlarmForwardLog 告警_转发日志记录
|
||||
type AlarmForwardLog struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||
CoreUID string `json:"coreUid" gorm:"column:core_uid"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" gorm:"column:ne_uid"` // 网元唯一标识
|
||||
NeType string `json:"neType" gorm:"column:ne_type"` // 网元类型
|
||||
NeID int64 `json:"neId" gorm:"column:ne_id" binding:"required"` // 网元ID
|
||||
CreatedTime int64 `json:"createdTime" gorm:"column:created_time"` // 创建时间
|
||||
AlarmSeq int64 `json:"alarmSeq" gorm:"column:alarm_seq"` // 告警序号 连续递增
|
||||
AlarmId string `json:"alarmId" gorm:"column:alarm_id"` // 告警ID
|
||||
AlarmCode int64 `json:"alarmCode" gorm:"column:alarm_code"` // 告警状态码
|
||||
@@ -13,11 +12,16 @@ type AlarmForwardLog struct {
|
||||
AlarmStatus string `json:"alarmStatus" gorm:"column:alarm_status"` // 告警状态
|
||||
AlarmType string `json:"alarmType" gorm:"column:alarm_type"` // 告警类型
|
||||
OrigSeverity string `json:"origSeverity" gorm:"column:orig_severity"` // 严重程度
|
||||
EventTime int64 `json:"eventTime" gorm:"column:event_time"` // 事件产生时间
|
||||
CreatedAt int64 `json:"createdAt" gorm:"column:created_at"` // 创建时间
|
||||
EventTime int64 `json:"eventTime" gorm:"column:event_time"` // 产生时间
|
||||
Type string `json:"type" gorm:"column:type"` // 转发方式 SMS/EMAIL/SMSC
|
||||
Target string `json:"target" gorm:"column:target"` // 发送目标用户
|
||||
Result string `json:"result" gorm:"column:result"` // 发送结果
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
NeUid string `json:"neUid,omitempty" gorm:"->"` // 网元唯一标识
|
||||
NeName string `json:"neName,omitempty" gorm:"->"` // 网元名称
|
||||
NeType string `json:"neType,omitempty" gorm:"->"` // 网元类型
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
@@ -27,12 +31,11 @@ func (*AlarmForwardLog) TableName() string {
|
||||
|
||||
// AlarmForwardLogQuery 告警转发日志数据查询参数结构体
|
||||
type AlarmForwardLogQuery struct {
|
||||
CoreUID string `json:"coreUid" form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" form:"neUid"` // 网元唯一标识
|
||||
NeType string `json:"neType" form:"neType"` // 网元类型
|
||||
BeginTime int64 `json:"beginTime" form:"beginTime"` // 开始时间
|
||||
NeID int64 `json:"neId" form:"neId"` // 网元ID
|
||||
BeginTime int64 `json:"beginTime" form:"beginTime"` // 开始时间 查created_time
|
||||
EndTime int64 `json:"endTime" form:"endTime"`
|
||||
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=event_time id"` // 排序字段,填写结果字段
|
||||
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=createdTime eventTime id"` // 排序字段,填写结果字段
|
||||
SortOrder string `json:"sortOrder" form:"sortOrder" binding:"omitempty,oneof=asc desc"` // 排序升降序,asc desc
|
||||
PageNum int64 `json:"pageNum" form:"pageNum" binding:"required"`
|
||||
PageSize int64 `json:"pageSize" form:"pageSize" binding:"required"`
|
||||
|
||||
@@ -3,9 +3,8 @@ package model
|
||||
// AlarmLog 告警_日志记录
|
||||
type AlarmLog struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||
CoreUID string `json:"coreUid" gorm:"column:core_uid"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" gorm:"column:ne_uid"` // 网元唯一标识
|
||||
NeType string `json:"neType" gorm:"column:ne_type"` // 网元类型
|
||||
NeID int64 `json:"neId" gorm:"column:ne_id" binding:"required"` // 网元ID
|
||||
CreatedTime int64 `json:"createdTime" gorm:"column:created_time"` // 创建时间
|
||||
AlarmSeq int64 `json:"alarmSeq" gorm:"column:alarm_seq"` // 告警序号 连续递增
|
||||
AlarmId string `json:"alarmId" gorm:"column:alarm_id"` // 告警ID
|
||||
AlarmCode int64 `json:"alarmCode" gorm:"column:alarm_code"` // 告警状态码
|
||||
@@ -13,8 +12,13 @@ type AlarmLog struct {
|
||||
AlarmStatus string `json:"alarmStatus" gorm:"column:alarm_status"` // 告警状态
|
||||
AlarmType string `json:"alarmType" gorm:"column:alarm_type"` // 告警类型
|
||||
OrigSeverity string `json:"origSeverity" gorm:"column:orig_severity"` // 严重程度
|
||||
EventTime int64 `json:"eventTime" gorm:"column:event_time"` // 事件产生时间
|
||||
CreatedAt int64 `json:"createdAt" gorm:"column:created_at"` // 创建时间
|
||||
EventTime int64 `json:"eventTime" gorm:"column:event_time"` // 产生时间
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
NeUid string `json:"neUid,omitempty" gorm:"->"` // 网元唯一标识
|
||||
NeName string `json:"neName,omitempty" gorm:"->"` // 网元名称
|
||||
NeType string `json:"neType,omitempty" gorm:"->"` // 网元类型
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
@@ -24,14 +28,13 @@ func (*AlarmLog) TableName() string {
|
||||
|
||||
// AlarmLogQuery 告警日志数据查询参数结构体
|
||||
type AlarmLogQuery struct {
|
||||
CoreUID string `json:"coreUid" form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" form:"neUid"` // 网元唯一标识
|
||||
NeType string `json:"neType" form:"neType"` // 网元类型
|
||||
NeID int64 `json:"neId" form:"neId"` // 网元ID
|
||||
AlarmStatus string `json:"alarmStatus" form:"alarmStatus" binding:"omitempty,oneof=Clear Active"` // 告警状态
|
||||
OrigSeverity string `json:"origSeverity" form:"origSeverity"` // 告警类型
|
||||
BeginTime int64 `json:"beginTime" form:"beginTime"` // 开始时间 查event_time
|
||||
BeginTime int64 `json:"beginTime" form:"beginTime"` // 开始时间 查created_time
|
||||
EndTime int64 `json:"endTime" form:"endTime"`
|
||||
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=event_time id"` // 排序字段,填写结果字段
|
||||
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=createdTime eventTime id"` // 排序字段,填写结果字段
|
||||
SortOrder string `json:"sortOrder" form:"sortOrder" binding:"omitempty,oneof=asc desc"` // 排序升降序,asc desc
|
||||
PageNum int64 `json:"pageNum" form:"pageNum" binding:"required"`
|
||||
PageSize int64 `json:"pageSize" form:"pageSize" binding:"required"`
|
||||
|
||||
@@ -22,16 +22,12 @@ func (*KpiCTitle) TableName() string {
|
||||
// KpiCReport 自定义指标报表信息对象
|
||||
type KpiCReport struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||
CoreUID string `json:"coreUid" gorm:"column:core_uid"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" gorm:"column:ne_uid"` // 网元唯一标识
|
||||
NeType string `json:"neType" gorm:"column:ne_type"` // 网元类型
|
||||
Date string `json:"date" gorm:"column:date"` // Date of the report yyyy-mm-dd hh:mi:ss
|
||||
StartTime string `json:"startTime" gorm:"column:start_time"` // Start time of the report hh:mi:ss
|
||||
EndTime string `json:"endTime" gorm:"column:end_time"` // End time of the report hh:mi:ss
|
||||
NeID int64 `json:"neId" gorm:"column:ne_id" binding:"required"` // 网元ID
|
||||
CreatedTime int64 `json:"createdTime" gorm:"column:created_time"` // 创建时间
|
||||
RecordTime int64 `json:"recordTime" gorm:"column:record_time"` // 记录时间
|
||||
Index int64 `json:"index" gorm:"column:index"` // Index of the report
|
||||
Granularity int64 `json:"granularity" gorm:"column:granularity"` // Time granualarity: 5/10/.../60/300 (second)
|
||||
KpiValues string `json:"kpiValues" gorm:"column:kpi_values"` // KPI values JSON String
|
||||
CreatedAt int64 `json:"createdAt" gorm:"column:created_at"` // Creation time
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
@@ -41,9 +37,7 @@ func (*KpiCReport) TableName() string {
|
||||
|
||||
// KPICQuery 指标查询参数结构体
|
||||
type KPICQuery struct {
|
||||
CoreUID string `json:"coreUid" form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" form:"neUid" binding:"required"` // 网元唯一标识
|
||||
NeType string `json:"neType" form:"neType" binding:"required"` // 网元类型
|
||||
NeUID string `json:"neUid" form:"neUid"` // 网元唯一标识
|
||||
BeginTime int64 `form:"beginTime" binding:"required"` // 开始时间戳(毫秒)1739361200999
|
||||
EndTime int64 `form:"endTime" binding:"required"` // 结束时间戳(毫秒)1739361210088
|
||||
Interval int64 `form:"interval" binding:"required,oneof=5 60 300 900 1800 3600"`
|
||||
|
||||
@@ -19,16 +19,12 @@ func (*KpiTitle) TableName() string {
|
||||
// KpiReport 指标报表信息对象
|
||||
type KpiReport struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||
CoreUID string `json:"coreUid" gorm:"column:core_uid"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" gorm:"column:ne_uid"` // 网元唯一标识
|
||||
NeType string `json:"neType" gorm:"column:ne_type"` // 网元类型
|
||||
Date string `json:"date" gorm:"column:date"` // Date of the report yyyy-mm-dd hh:mi:ss
|
||||
StartTime string `json:"startTime" gorm:"column:start_time"` // Start time of the report hh:mi:ss
|
||||
EndTime string `json:"endTime" gorm:"column:end_time"` // End time of the report hh:mi:ss
|
||||
NeID int64 `json:"neId" gorm:"column:ne_id" binding:"required"` // 网元ID
|
||||
CreatedTime int64 `json:"createdTime" gorm:"column:created_time"` // 创建时间
|
||||
RecordTime int64 `json:"recordTime" gorm:"column:record_time"` // 记录时间
|
||||
Index int64 `json:"index" gorm:"column:index"` // Index of the report
|
||||
Granularity int64 `json:"granularity" gorm:"column:granularity"` // Time granualarity: 5/10/.../60/300 (second)
|
||||
KpiValues string `json:"kpiValues" gorm:"column:kpi_values"` // KPI values JSON String
|
||||
CreatedAt int64 `json:"createdAt" gorm:"column:created_at"` // Creation time 接收到的timestamp秒级存储毫秒时间戳
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
@@ -38,9 +34,7 @@ func (*KpiReport) TableName() string {
|
||||
|
||||
// KPIQuery 指标查询参数结构体
|
||||
type KPIQuery struct {
|
||||
CoreUID string `json:"coreUid" form:"coreUid" binding:"required"` // 核心网唯一标识
|
||||
NeUID string `json:"neUid" form:"neUid" binding:"required"` // 网元唯一标识
|
||||
NeType string `json:"neType" form:"neType" binding:"required"` // 网元类型
|
||||
NeUID string `json:"neUid" form:"neUid"` // 网元唯一标识
|
||||
BeginTime int64 `form:"beginTime" binding:"required"` // 开始时间戳(毫秒)1739361200999
|
||||
EndTime int64 `form:"endTime" binding:"required"` // 结束时间戳(毫秒)1739361210088
|
||||
Interval int64 `form:"interval" binding:"required,oneof=5 60 300 900 1800 3600"`
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user