Merge remote-tracking branch 'origin/main' into multi-tenant
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
# 版本发布日志
|
||||
|
||||
## 2.2502.1-20250208
|
||||
|
||||
- 新增 基站状态记录上报和导出功能
|
||||
- 修复 IMS-CDR导出表头字段信息调整
|
||||
- 优化 监控接口/load和/system-info和/cache去除权限标识限制
|
||||
- 修复 本地免密认证端口去除限制22
|
||||
- 更新 swagger注释信息
|
||||
|
||||
## 2.2501.4-20250124
|
||||
|
||||
- 新增 日志备份文件同步FTP功能
|
||||
|
||||
22
database/install/nb_state.sql
Normal file
22
database/install/nb_state.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
--
|
||||
-- Table structure for table `nb_state`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `nb_state`;
|
||||
CREATE TABLE `nb_state` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '网元类型 AMF MME',
|
||||
`ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '网元ID',
|
||||
`rm_uid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '资源唯一标识',
|
||||
`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 '基站名称',
|
||||
`position` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '基站位置',
|
||||
`nb_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '基站设备名称',
|
||||
`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,
|
||||
UNIQUE KEY `uk_type_id_uid_cat` (`ne_type`,`ne_id`,`rm_uid`,`create_time`) USING BTREE COMMENT '唯一网元类型和ID'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='基站状态记录表';
|
||||
|
||||
-- Dump completed on 2025-02-08 12:50:13
|
||||
@@ -42,7 +42,7 @@ INSERT INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.open', 't
|
||||
INSERT INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
|
||||
INSERT INTO `sys_config` VALUES (110, 'config.sys.lockTime', 'sys.lockTime', '0', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.lockTimeRemark');
|
||||
INSERT INTO `sys_config` VALUES (111, 'config.sys.homePage', 'sys.homePage', 'dashboard/overview/index', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.homePageRemark');
|
||||
INSERT INTO `sys_config` VALUES (112, 'config.sys.exportTable', 'sys.exportTable', '43t6VAMQmdnt9ynWGJIR1ufeQOvr1doHDsjWUFT8JVzxTVEYgZ1Xvrk47JaPeCHMPKk9zLhJCU9MmA7JAWslQyWBLHzVOMUmA1ppIL1sVIkWGrdDiw0XuMdvXpUu/adrXHhqo42NP3hxcvwXvkWvgedezzCnUsvqfMt+Yw1Wick=', 'Y', 'supervisor', 1737355823940, 'supervisor', 1737363302083, 'config.sys.exportTableRemark');
|
||||
INSERT INTO `sys_config` VALUES (112, 'config.sys.exportTable', 'sys.exportTable', 'B1n9hW6Z2S2wZw4MVPAX6Q4wCuyWKdMk+qH1ZKqpLJxwvq2FBRgAT6WWw+j6O+ExHIJhpJ3XCpMBoiNN/RkW6EPurmqM82gnXWUIf/s6gk7OWrhdvQDD2jjNVBkLCmPLEH3ZLdgnQOZOePA7WyUdXA==', 'Y', 'supervisor', 1737355823940, 'supervisor', 1737363302083, 'config.sys.exportTableRemark');
|
||||
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
@@ -151,8 +151,8 @@ INSERT INTO `sys_dict_data` VALUES (1143, 1143, 'log.operate.title.sgwcCDR', '
|
||||
INSERT INTO `sys_dict_data` VALUES (1144, 1144, 'menu.securityRemark', '安全管理目录', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1145, 1145, 'menu.system.systemSetRemark', '系统设置菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1146, 1146, 'menu.system.systemResourceRemark', '系统资源 cpu io network菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1147, 1147, 'menu.config.configNEFormRemark', '参数配置Form菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1148, 1148, 'menu.config.configNETreeRemark', '参数配置Tree菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1147, 1147, 'dictData.offline', '离线', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1148, 1148, 'dictData.online', '在线', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1149, 1149, 'menu.neData.baseStation', '基站状态', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1150, 1150, 'menu.noData', '没有可访问菜单数据!', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1151, 1151, 'menu.errNameExists', '操作菜单【{name}】失败,菜单名称已存在', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
@@ -188,14 +188,14 @@ INSERT INTO `sys_dict_data` VALUES (1423, 1423, 'dictData.operType.clear', '清
|
||||
INSERT INTO `sys_dict_data` VALUES (1424, 1424, 'dictData.trace.interface', '接口跟踪', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1425, 1425, 'dictData.trace.device', '设备跟踪', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1426, 1426, 'dictData.trace.user', '用户跟踪', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1427, 1427, 'dictData.logType.download', '下载', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1428, 1428, 'dictData.logType.activation', '激活', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1429, 1429, 'dictData.logType.add', '新增', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1430, 1430, 'dictData.logType.other', '其他', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1431, 1431, 'dictData.logType.back', '回退', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1432, 1432, 'dictData.logType.delete', '删除', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1433, 1433, 'dictData.logType.distribute', '分配', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1434, 1434, 'dictData.logType.export', '导出', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1427, 1427, 'nbState.export.id', '编号', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1428, 1428, 'nbState.export.name', '基站名称', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1429, 1429, 'nbState.export.position', '基站位置', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1430, 1430, 'nbState.export.address', 'IP地址', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1431, 1431, 'nbState.export.nbName', '设备名称', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1432, 1432, 'nbState.export.ueNum', '在线用户数', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1433, 1433, 'nbState.export.state', '基站状态', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1434, 1434, 'nbState.export.time', '变更时间', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1435, 1435, 'dictData.logType.query', '查询', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1436, 1436, 'dictData.logType.setup', '设置', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1437, 1437, 'dictData.logType.update', '更新', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
@@ -205,7 +205,7 @@ INSERT INTO `sys_dict_data` VALUES (1426, 1426, 'dictData.trace.user', '用户
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1441, 1441, 'dictData.logType.logout', '登出', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1442, 1442, 'dictData.securityLogType.add', '新增', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1443, 1443, 'dictData.securityLogType.update', '更新', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (1444, 1444, 'dictData.securityLogType.delete', '删除', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1444, 1444, 'neHost.okBySSHLink', '设置免密直连成功', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (1445, 1445, 'neHost.banNE', '禁止操作网元', 'i18n_zh', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (1446, 1446, 'dictData.ne_host_type.redis', 'Redis', 'i18n_zh', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (1447, 1447, 'menu.tools.ping', '网络探测测试', 'i18n_zh', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
|
||||
@@ -151,8 +151,8 @@ INSERT INTO `sys_dict_data` VALUES (3143, 3143, 'log.operate.title.sgwcCDR', 'Ro
|
||||
INSERT INTO `sys_dict_data` VALUES (3144, 3144, 'menu.securityRemark', 'Security Management Catalog', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3145, 3145, 'menu.system.systemSetRemark', 'System Settings Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3146, 3146, 'menu.system.systemResourceRemark', 'System Resources cpu io network menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3147, 3147, 'menu.config.configNEFormRemark', 'Parameter Configuration Form Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3148, 3148, 'menu.config.configNETreeRemark', 'Parameter Configuration Tree Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3147, 3147, 'dictData.offline', 'Offline', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3148, 3148, 'dictData.online', 'Online', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3149, 3149, 'menu.neData.baseStation', 'Radio State', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3150, 3150, 'menu.noData', 'There is no accessible menu data!', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3151, 3151, 'menu.errNameExists', 'Failed to operate menu [{name}], menu name already exists!', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
@@ -188,14 +188,14 @@ INSERT INTO `sys_dict_data` VALUES (3423, 3423, 'dictData.operType.clear', 'Clea
|
||||
INSERT INTO `sys_dict_data` VALUES (3424, 3424, 'dictData.trace.interface', 'Interface Tracing', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3425, 3425, 'dictData.trace.device', 'Module Tracing', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3426, 3426, 'dictData.trace.user', 'User Tracing', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3427, 3427, 'dictData.logType.download', 'Download', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3428, 3428, 'dictData.logType.activation', 'Activation', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3429, 3429, 'dictData.logType.add', 'New', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3430, 3430, 'dictData.logType.other', 'Other', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3431, 3431, 'dictData.logType.back', 'Rollback', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3432, 3432, 'dictData.logType.delete', 'Delete', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3433, 3433, 'dictData.logType.distribute', 'Assign', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3434, 3434, 'dictData.logType.export', 'Export', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3427, 3427, 'nbState.export.id', 'ID', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3428, 3428, 'nbState.export.name', 'Name', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3429, 3429, 'nbState.export.position', 'Position', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3430, 3430, 'nbState.export.address', 'IP Address', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3431, 3431, 'nbState.export.nbName', 'RanNodeName', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3432, 3432, 'nbState.export.ueNum', 'UE Number', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3433, 3433, 'nbState.export.state', 'State', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3434, 3434, 'nbState.export.time', 'Change Time', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3435, 3435, 'dictData.logType.query', 'Query', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3436, 3436, 'dictData.logType.setup', 'Setup', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3437, 3437, 'dictData.logType.update', 'Update', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
@@ -205,7 +205,7 @@ INSERT INTO `sys_dict_data` VALUES (3426, 3426, 'dictData.trace.user', 'User Tra
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3441, 3441, 'dictData.logType.logout', 'Logout', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3442, 3442, 'dictData.securityLogType.add', 'New', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3443, 3443, 'dictData.securityLogType.update', 'Update', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- INSERT INTO `sys_dict_data` VALUES (3444, 3444, 'dictData.securityLogType.delete', 'Delete', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3444, 3444, 'neHost.okBySSHLink', 'Setting up a password-free direct connection is successful', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
INSERT INTO `sys_dict_data` VALUES (3445, 3445, 'neHost.banNE', 'Do not operate the NE', 'i18n_en', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (3446, 3446, 'dictData.ne_host_type.redis', 'Redis', 'i18n_en', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (3447, 3447, 'menu.tools.ping', 'Net Probing Test', 'i18n_en', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
|
||||
@@ -41,7 +41,7 @@ INSERT INTO `sys_job` VALUES (10, 'job.genNeStateAlarm', 'SYSTEM', 'genNeStateAl
|
||||
INSERT INTO `sys_job` VALUES (11, 'job.exportOperateLog', 'SYSTEM', 'exportTable', '{\"duration\":1,\"tableName\":\"sys_log_operate\",\"timeCol\":\"oper_time\",\"timeUnit\":\"milli\",\"columns\":\"oper_id,omc_get_dict_value(title, \\\"i18n_en\\\") as title,business_type,method,request_method,operator_type,oper_name,dept_name,oper_url,oper_ip,oper_location,oper_param,oper_msg,status,oper_time,cost_time,tenant_id\",\"extras\":\"\",\"filePath\":\"/usr/local/omc/backup/operate_log\"}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1724833786290, 'job.exportOperateLog');
|
||||
INSERT INTO `sys_job` VALUES (12, 'job.exportIMSCDR', 'SYSTEM', 'exportTable', '{\"duration\":1,\"tableName\":\"cdr_event_ims\",\"columns\":\"id,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.recordType\')) as record_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.callType\')) as call_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.callerParty\')) as caller_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.calledParty\')) as called_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.callDuration\')) as call_duration,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.serviceResult\')) as service_result,DATE_FORMAT(FROM_UNIXTIME(timestamp), \'%Y-%m-%d %H:%i:%s\') AS timestamp\",\"timeCol\":\"timestamp\",\"timeUnit\":\"second\",\"extras\":\"\",\"filePath\":\"/usr/local/omc/backup/ims_cdr\"}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1722224659251, '');
|
||||
INSERT INTO `sys_job` VALUES (13, 'job.exportSMFCDR', 'SYSTEM', 'exportTable', '{\"duration\":1,\"tableName\":\"cdr_event_smf\",\"columns\":\"id,ne_type,ne_name,rm_uid,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.recordType\')) AS record_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.chargingID\')) AS charging_id,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.subscriberIdentifier.subscriptionIDType\')) AS subscriber_id_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.subscriberIdentifier.subscriptionIDData\')) AS subscriber_id_data,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.duration\')) AS duration,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.invocationTimestamp\')) as invocationTimestamp,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.listOfMultipleUnitUsage[*].usedUnitContainer[*].dataVolumeUplink\')) AS data_volume_uplink,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.listOfMultipleUnitUsage[*].usedUnitContainer[*].dataVolumeDownlink\')) AS data_volume_downlink,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.listOfMultipleUnitUsage[*].usedUnitContainer[*].dataTotalVolume\')) AS data_total_volume,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.pDUSessionChargingInformation.pDUAddress.pDUIPv4Address\')) AS pdu_ipv4_address,timestamp\",\"timeCol\":\"timestamp\",\"timeUnit\":\"second\",\"extras\":\"\",\"filePath\":\"/usr/local/omc/backup/smf_cdr\"}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1724309047797, '');
|
||||
INSERT INTO `sys_job` VALUES (14, 'job.exportSMSCCDR', 'SYSTEM', 'exportTable', '{\"duration\":1,\"tableName\":\"cdr_event_smsc\",\"columns\":\"id,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.recordType\')) as record_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.serviceType\')) as service_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.callerParty\')) as caller_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.calledParty\')) as called_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.result\')) as result,DATE_FORMAT(FROM_UNIXTIME(JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.updateTime\'))), \'%Y-%m-%d %H:%i:%s\') as update_time\",\"timeCol\":\"timestamp\",\"timeUnit\":\"second\",\"extras\":\"\",\"filePath\":\"/usr/local/omc/backup/smsc_cdr\"}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1724309047797, '');
|
||||
INSERT INTO `sys_job` VALUES (14, 'job.exportSMSCCDR', 'SYSTEM', 'exportTable', '{\"duration\":1,\"tableName\":\"cdr_event_smsc\",\"columns\":\"id,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.recordType\')) as record_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.serviceType\')) as service_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.callerParty\')) as caller_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.calledParty\')) as called_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.result\')) as result,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.updateTime\')) as update_time\",\"timeCol\":\"timestamp\",\"timeUnit\":\"second\",\"extras\":\"\",\"filePath\":\"/usr/local/omc/backup/smsc_cdr\"}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1724309047797, '');
|
||||
INSERT INTO `sys_job` VALUES (15, 'job.removeExportedFiles', 'SYSTEM', 'removeFile', '[{\"filePath\":\"/usr/local/omc/backup/operate_log\",\"maxDays\":30},{\"filePath\":\"/usr/local/omc/backup/ims_cdr\",\"maxDays\":30},{\"filePath\":\"/usr/local/omc/backup/smf_cdr\",\"maxDays\":30},{\"filePath\":\"/usr/local/omc/backup/smsc_cdr\",\"maxDays\":30}]', '0 10 0 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1728634085631, '');
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
21
database/upgrade/upg_nb_state.sql
Normal file
21
database/upgrade/upg_nb_state.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
--
|
||||
-- Table structure for table `nb_state`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `nb_state` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '网元类型 AMF MME',
|
||||
`ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '网元ID',
|
||||
`rm_uid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '资源唯一标识',
|
||||
`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 '基站名称',
|
||||
`position` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '基站位置',
|
||||
`nb_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '基站设备名称',
|
||||
`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,
|
||||
UNIQUE KEY `uk_type_id_uid_cat` (`ne_type`,`ne_id`,`rm_uid`,`create_time`) USING BTREE COMMENT '唯一网元类型和ID'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='基站状态记录表';
|
||||
|
||||
-- Dump completed on 2025-02-08 12:50:13
|
||||
@@ -37,6 +37,6 @@ INSERT IGNORE INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.op
|
||||
INSERT IGNORE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
|
||||
INSERT IGNORE INTO `sys_config` VALUES (110, 'config.sys.lockTime', 'sys.lockTime', '0', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.lockTimeRemark');
|
||||
INSERT IGNORE INTO `sys_config` VALUES (111, 'config.sys.homePage', 'sys.homePage', 'dashboard/overview/index', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.homePageRemark');
|
||||
INSERT IGNORE INTO `sys_config` VALUES (112, 'config.sys.exportTable', 'sys.exportTable', '43t6VAMQmdnt9ynWGJIR1ufeQOvr1doHDsjWUFT8JVzxTVEYgZ1Xvrk47JaPeCHMPKk9zLhJCU9MmA7JAWslQyWBLHzVOMUmA1ppIL1sVIkWGrdDiw0XuMdvXpUu/adrXHhqo42NP3hxcvwXvkWvgedezzCnUsvqfMt+Yw1Wick=', 'Y', 'supervisor', 1737355823940, 'supervisor', 1737363302083, 'config.sys.exportTableRemark');
|
||||
INSERT IGNORE INTO `sys_config` VALUES (112, 'config.sys.exportTable', 'sys.exportTable', 'B1n9hW6Z2S2wZw4MVPAX6Q4wCuyWKdMk+qH1ZKqpLJxwvq2FBRgAT6WWw+j6O+ExHIJhpJ3XCpMBoiNN/RkW6EPurmqM82gnXWUIf/s6gk7OWrhdvQDD2jjNVBkLCmPLEH3ZLdgnQOZOePA7WyUdXA==', 'Y', 'supervisor', 1737355823940, 'supervisor', 1737363302083, 'config.sys.exportTableRemark');
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
@@ -158,8 +158,8 @@ REPLACE INTO `sys_dict_data` VALUES (1143, 1143, 'log.operate.title.sgwcCDR', '
|
||||
REPLACE INTO `sys_dict_data` VALUES (1144, 1144, 'menu.securityRemark', '安全管理目录', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1145, 1145, 'menu.system.systemSetRemark', '系统设置菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1146, 1146, 'menu.system.systemResourceRemark', '系统资源 cpu io network菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1147, 1147, 'menu.config.configNEFormRemark', '参数配置Form菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1148, 1148, 'menu.config.configNETreeRemark', '参数配置Tree菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1147, 1147, 'dictData.offline', '离线', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1148, 1148, 'dictData.online', '在线', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1149, 1149, 'menu.neData.baseStation', '基站状态', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1150, 1150, 'menu.noData', '没有可访问菜单数据!', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1151, 1151, 'menu.errNameExists', '操作菜单【{name}】失败,菜单名称已存在', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
@@ -195,14 +195,14 @@ REPLACE INTO `sys_dict_data` VALUES (1423, 1423, 'dictData.operType.clear', '清
|
||||
REPLACE INTO `sys_dict_data` VALUES (1424, 1424, 'dictData.trace.interface', '接口跟踪', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1425, 1425, 'dictData.trace.device', '设备跟踪', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1426, 1426, 'dictData.trace.user', '用户跟踪', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1427, 1427, 'dictData.logType.download', '下载', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1428, 1428, 'dictData.logType.activation', '激活', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1429, 1429, 'dictData.logType.add', '新增', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1430, 1430, 'dictData.logType.other', '其他', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1431, 1431, 'dictData.logType.back', '回退', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1432, 1432, 'dictData.logType.delete', '删除', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1433, 1433, 'dictData.logType.distribute', '分配', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1434, 1434, 'dictData.logType.export', '导出', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1427, 1427, 'nbState.export.id', '编号', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1428, 1428, 'nbState.export.name', '基站名称', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1429, 1429, 'nbState.export.position', '基站位置', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1430, 1430, 'nbState.export.address', 'IP地址', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1431, 1431, 'nbState.export.nbName', '设备名称', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1432, 1432, 'nbState.export.ueNum', '在线用户数', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1433, 1433, 'nbState.export.state', '基站状态', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1434, 1434, 'nbState.export.time', '变更时间', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1435, 1435, 'dictData.logType.query', '查询', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1436, 1436, 'dictData.logType.setup', '设置', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1437, 1437, 'dictData.logType.update', '更新', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
@@ -212,7 +212,7 @@ REPLACE INTO `sys_dict_data` VALUES (1426, 1426, 'dictData.trace.user', '用户
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1441, 1441, 'dictData.logType.logout', '登出', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1442, 1442, 'dictData.securityLogType.add', '新增', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1443, 1443, 'dictData.securityLogType.update', '更新', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (1444, 1444, 'dictData.securityLogType.delete', '删除', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1444, 1444, 'neHost.okBySSHLink', '设置免密直连成功', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (1445, 1445, 'neHost.banNE', '禁止操作网元', 'i18n_zh', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
REPLACE INTO `sys_dict_data` VALUES (1446, 1446, 'dictData.ne_host_type.redis', 'Redis', 'i18n_zh', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
REPLACE INTO `sys_dict_data` VALUES (1447, 1447, 'menu.tools.ping', '网络探测测试', 'i18n_zh', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
|
||||
@@ -156,6 +156,8 @@ REPLACE INTO `sys_dict_data` VALUES (3143, 3143, 'log.operate.title.sgwcCDR', 'R
|
||||
REPLACE INTO `sys_dict_data` VALUES (3144, 3144, 'menu.securityRemark', 'Security Management Catalog', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3145, 3145, 'menu.system.systemSetRemark', 'System Settings Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3146, 3146, 'menu.system.systemResourceRemark', 'System Resources cpu io network menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3147, 3147, 'dictData.offline', 'Offline', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3148, 3148, 'dictData.online', 'Online', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3149, 3149, 'menu.neData.baseStation', 'Radio State', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3150, 3150, 'menu.noData', 'There is no accessible menu data!', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3151, 3151, 'menu.errNameExists', 'Failed to operate menu [{name}], menu name already exists!', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
@@ -191,14 +193,14 @@ REPLACE INTO `sys_dict_data` VALUES (3423, 3423, 'dictData.operType.clear', 'Cle
|
||||
REPLACE INTO `sys_dict_data` VALUES (3424, 3424, 'dictData.trace.interface', 'Interface Tracing', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3425, 3425, 'dictData.trace.device', 'Module Tracing', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3426, 3426, 'dictData.trace.user', 'User Tracing', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3427, 3427, 'dictData.logType.download', 'Download', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3428, 3428, 'dictData.logType.activation', 'Activation', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3429, 3429, 'dictData.logType.add', 'New', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3430, 3430, 'dictData.logType.other', 'Other', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3431, 3431, 'dictData.logType.back', 'Rollback', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3432, 3432, 'dictData.logType.delete', 'Delete', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3433, 3433, 'dictData.logType.distribute', 'Assign', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3434, 3434, 'dictData.logType.export', 'Export', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3427, 3427, 'nbState.export.id', 'ID', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3428, 3428, 'nbState.export.name', 'Name', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3429, 3429, 'nbState.export.position', 'Position', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3430, 3430, 'nbState.export.address', 'IP Address', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3431, 3431, 'nbState.export.nbName', 'RanNodeName', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3432, 3432, 'nbState.export.ueNum', 'UE Number', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3433, 3433, 'nbState.export.state', 'State', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3434, 3434, 'nbState.export.time', 'Change Time', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3435, 3435, 'dictData.logType.query', 'Query', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3436, 3436, 'dictData.logType.setup', 'Setup', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3437, 3437, 'dictData.logType.update', 'Update', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
@@ -208,7 +210,7 @@ REPLACE INTO `sys_dict_data` VALUES (3426, 3426, 'dictData.trace.user', 'User Tr
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3441, 3441, 'dictData.logType.logout', 'Logout', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3442, 3442, 'dictData.securityLogType.add', 'New', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3443, 3443, 'dictData.securityLogType.update', 'Update', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
-- REPLACE INTO `sys_dict_data` VALUES (3444, 3444, 'dictData.securityLogType.delete', 'Delete', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3444, 3444, 'neHost.okBySSHLink', 'Setting up a password-free direct connection is successful', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||
REPLACE INTO `sys_dict_data` VALUES (3445, 3445, 'neHost.banNE', 'Do not operate the NE', 'i18n_en', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
REPLACE INTO `sys_dict_data` VALUES (3446, 3446, 'dictData.ne_host_type.redis', 'Redis', 'i18n_en', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
REPLACE INTO `sys_dict_data` VALUES (3447, 3447, 'menu.tools.ping', 'Net Probing Test', 'i18n_en', '', '', '1', 'supervisor', 1728640045875, '', 0, '');
|
||||
|
||||
@@ -45,7 +45,7 @@ REPLACE INTO `sys_job` VALUES (10, 'job.genNeStateAlarm', 'SYSTEM', 'genNeStateA
|
||||
REPLACE INTO `sys_job` VALUES (11, 'job.exportOperateLog', 'SYSTEM', 'exportTable', '{\"duration\":1,\"tableName\":\"sys_log_operate\",\"timeCol\":\"oper_time\",\"timeUnit\":\"milli\",\"columns\":\"oper_id,omc_get_dict_value(title, \\\"i18n_en\\\") as title,business_type,method,request_method,operator_type,oper_name,dept_name,oper_url,oper_ip,oper_location,oper_param,oper_msg,status,oper_time,cost_time,tenant_id\",\"extras\":\"\",\"filePath\":\"/usr/local/omc/backup/operate_log\"}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1724833786290, 'job.exportOperateLog');
|
||||
REPLACE INTO `sys_job` VALUES (12, 'job.exportIMSCDR', 'SYSTEM', 'exportTable', '{\"duration\":1,\"tableName\":\"cdr_event_ims\",\"columns\":\"id,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.recordType\')) as record_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.callType\')) as call_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.callerParty\')) as caller_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.calledParty\')) as called_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.callDuration\')) as call_duration,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.serviceResult\')) as service_result,DATE_FORMAT(FROM_UNIXTIME(timestamp), \'%Y-%m-%d %H:%i:%s\') AS timestamp\",\"timeCol\":\"timestamp\",\"timeUnit\":\"second\",\"extras\":\"\",\"filePath\":\"/usr/local/omc/backup/ims_cdr\"}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1722224659251, '');
|
||||
REPLACE INTO `sys_job` VALUES (13, 'job.exportSMFCDR', 'SYSTEM', 'exportTable', '{\"duration\":1,\"tableName\":\"cdr_event_smf\",\"columns\":\"id,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.recordType\')) AS record_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.chargingID\')) AS charging_id,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.subscriberIdentifier.subscriptionIDType\')) AS subscriber_id_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.subscriberIdentifier.subscriptionIDData\')) AS subscriber_id_data,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.duration\')) AS duration,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.invocationTimestamp\')) as invocationTimestamp,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.listOfMultipleUnitUsage[*].usedUnitContainer[*].dataVolumeUplink\')) AS data_volume_uplink,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.listOfMultipleUnitUsage[*].usedUnitContainer[*].dataVolumeDownlink\')) AS data_volume_downlink,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.listOfMultipleUnitUsage[*].usedUnitContainer[*].dataTotalVolume\')) AS data_total_volume,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.pDUSessionChargingInformation.pDUAddress.pDUIPv4Address\')) AS pdu_ipv4_address,timestamp\",\"timeCol\":\"timestamp\",\"timeUnit\":\"second\",\"extras\":\"\",\"filePath\":\"/usr/local/omc/backup/smf_cdr\"}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1724309047797, '');
|
||||
REPLACE INTO `sys_job` VALUES (14, 'job.exportSMSCCDR', 'SYSTEM', 'exportTable', '{\"duration\":1,\"tableName\":\"cdr_event_smsc\",\"columns\":\"id,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.recordType\')) as record_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.serviceType\')) as service_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.callerParty\')) as caller_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.calledParty\')) as called_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.result\')) as result,DATE_FORMAT(FROM_UNIXTIME(JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.updateTime\'))), \'%Y-%m-%d %H:%i:%s\') as update_time\",\"timeCol\":\"timestamp\",\"timeUnit\":\"second\",\"extras\":\"\",\"filePath\":\"/usr/local/omc/backup/smsc_cdr\"}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1724309047797, '');
|
||||
REPLACE INTO `sys_job` VALUES (14, 'job.exportSMSCCDR', 'SYSTEM', 'exportTable', '{\"duration\":1,\"tableName\":\"cdr_event_smsc\",\"columns\":\"id,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.recordType\')) as record_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.serviceType\')) as service_type,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.callerParty\')) as caller_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.calledParty\')) as called_party,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.result\')) as result,JSON_UNQUOTE(JSON_EXTRACT(cdr_json,\'$.updateTime\')) as update_time\",\"timeCol\":\"timestamp\",\"timeUnit\":\"second\",\"extras\":\"\",\"filePath\":\"/usr/local/omc/backup/smsc_cdr\"}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1724309047797, '');
|
||||
REPLACE INTO `sys_job` VALUES (15, 'job.removeExportedFiles', 'SYSTEM', 'removeFile', '[{\"filePath\":\"/usr/local/omc/backup/operate_log\",\"maxDays\":30},{\"filePath\":\"/usr/local/omc/backup/ims_cdr\",\"maxDays\":30},{\"filePath\":\"/usr/local/omc/backup/smf_cdr\",\"maxDays\":30},{\"filePath\":\"/usr/local/omc/backup/smsc_cdr\",\"maxDays\":30}]', '0 10 0 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134842, 'admin', 1728634085631, '');
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -2,14 +2,10 @@ package file_export
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/jlaffaye/ftp"
|
||||
|
||||
"be.ems/lib/file"
|
||||
"be.ems/lib/log"
|
||||
@@ -160,7 +156,7 @@ func (m *SysJob) SetFTPConfig(c *gin.Context) {
|
||||
Username string `json:"username" binding:"required"`
|
||||
ToIp string `json:"toIp" binding:"required"`
|
||||
ToPort int64 `json:"toPort" binding:"required"`
|
||||
Protocol string `json:"protocol" binding:"required,oneof=ssh ftp"`
|
||||
Enable bool `json:"enable"`
|
||||
Dir string `json:"dir" binding:"required"`
|
||||
}
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
@@ -191,7 +187,7 @@ func (m *SysJob) SetFTPConfig(c *gin.Context) {
|
||||
c.JSON(200, result.Ok(nil))
|
||||
}
|
||||
|
||||
// 设置FTP配置
|
||||
// 获取FTP配置
|
||||
// GET /table/ftp
|
||||
func (m *SysJob) GetFTPConfig(c *gin.Context) {
|
||||
// 获取配置
|
||||
@@ -209,7 +205,7 @@ func (m *SysJob) GetFTPConfig(c *gin.Context) {
|
||||
Username string `json:"username" binding:"required"`
|
||||
ToIp string `json:"toIp" binding:"required"`
|
||||
ToPort int64 `json:"toPort" binding:"required"`
|
||||
Protocol string `json:"protocol" binding:"required,oneof=ssh ftp"`
|
||||
Enable bool `json:"enable"`
|
||||
Dir string `json:"dir" binding:"required"`
|
||||
}
|
||||
err = json.Unmarshal([]byte(bodyDe), &body)
|
||||
@@ -251,7 +247,7 @@ func (m *SysJob) PutFTP(c *gin.Context) {
|
||||
Username string `json:"username" binding:"required"`
|
||||
ToIp string `json:"toIp" binding:"required"`
|
||||
ToPort int64 `json:"toPort" binding:"required"`
|
||||
Protocol string `json:"protocol" binding:"required,oneof=ssh ftp"`
|
||||
Enable bool `json:"enable"`
|
||||
Dir string `json:"dir" binding:"required"`
|
||||
}
|
||||
cfg := systemService.NewSysConfigImpl.SelectConfigByKey("sys.exportTable")
|
||||
@@ -269,70 +265,37 @@ func (m *SysJob) PutFTP(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if cfgData.Protocol == "ssh" {
|
||||
connSSH := ssh.ConnSSH{
|
||||
User: cfgData.Username,
|
||||
Password: cfgData.Password,
|
||||
Addr: cfgData.ToIp,
|
||||
Port: cfgData.ToPort,
|
||||
AuthMode: "0",
|
||||
}
|
||||
sshClient, err := connSSH.NewClient()
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
defer sshClient.Close()
|
||||
// 网元主机的SSH客户端进行文件传输
|
||||
sftpClient, err := sshClient.NewClientSFTP()
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
defer sftpClient.Close()
|
||||
// 远程文件
|
||||
remotePath := filepath.Join(cfgData.Dir, path.Base(body.FilePath), body.FileName)
|
||||
// 复制到远程
|
||||
if err = sftpClient.CopyFileLocalToRemote(localFilePath, remotePath); err != nil {
|
||||
c.JSON(200, result.ErrMsg("error uploading file"))
|
||||
return
|
||||
}
|
||||
c.JSON(200, result.Ok(nil))
|
||||
if !cfgData.Enable {
|
||||
c.JSON(200, result.ErrMsg("Setting Remote Backup is disabled"))
|
||||
return
|
||||
}
|
||||
|
||||
if cfgData.Protocol == "ftp" {
|
||||
// 连接到 FTP 服务器
|
||||
addr := fmt.Sprintf("%s:%d", cfgData.ToIp, cfgData.ToPort)
|
||||
ftpComm, err := ftp.Dial(addr, ftp.DialWithTimeout(15*time.Second))
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
// 登录到 FTP 服务器
|
||||
err = ftpComm.Login(cfgData.Username, cfgData.Password)
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
defer ftpComm.Quit()
|
||||
// 打开本地文件
|
||||
file, err := os.Open(localFilePath)
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
defer file.Close()
|
||||
// 远程文件
|
||||
remotePath := filepath.Join(cfgData.Dir, path.Base(body.FilePath), body.FileName)
|
||||
// 上传文件到 FTP 服务器
|
||||
err = ftpComm.Stor(remotePath, file)
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
connSSH := ssh.ConnSSH{
|
||||
User: cfgData.Username,
|
||||
Password: cfgData.Password,
|
||||
Addr: cfgData.ToIp,
|
||||
Port: cfgData.ToPort,
|
||||
AuthMode: "0",
|
||||
}
|
||||
|
||||
c.JSON(200, result.Err(nil))
|
||||
sshClient, err := connSSH.NewClient()
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
defer sshClient.Close()
|
||||
// 网元主机的SSH客户端进行文件传输
|
||||
sftpClient, err := sshClient.NewClientSFTP()
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
defer sftpClient.Close()
|
||||
// 远程文件
|
||||
remotePath := filepath.Join(cfgData.Dir, path.Base(body.FilePath), body.FileName)
|
||||
// 复制到远程
|
||||
if err = sftpClient.CopyFileLocalToRemote(localFilePath, remotePath); err != nil {
|
||||
c.JSON(200, result.ErrMsg("error uploading file"))
|
||||
return
|
||||
}
|
||||
c.JSON(200, result.Ok(nil))
|
||||
}
|
||||
|
||||
@@ -17,10 +17,12 @@ func Register(r *gin.RouterGroup) {
|
||||
)
|
||||
lmTable.POST("/ftp",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.CryptoApi(true, false),
|
||||
m.SetFTPConfig,
|
||||
)
|
||||
lmTable.GET("/ftp",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.CryptoApi(false, true),
|
||||
m.GetFTPConfig,
|
||||
)
|
||||
lmTable.PUT("/ftp",
|
||||
|
||||
@@ -15,6 +15,8 @@ import (
|
||||
"be.ems/lib/log"
|
||||
"be.ems/lib/services"
|
||||
tokenConst "be.ems/src/framework/constants/token"
|
||||
neDataModel "be.ems/src/modules/network_data/model"
|
||||
neDataService "be.ems/src/modules/network_data/service"
|
||||
"be.ems/src/modules/network_element/model"
|
||||
neService "be.ems/src/modules/network_element/service"
|
||||
"github.com/go-resty/resty/v2"
|
||||
@@ -35,6 +37,7 @@ type N3iwfUEData struct {
|
||||
}
|
||||
|
||||
var (
|
||||
UriNBState = config.DefaultUriPrefix + "/ueManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/nbState"
|
||||
UriNBInfo = config.DefaultUriPrefix + "/ueManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/nbInfo"
|
||||
UriSMFUEInfo = config.DefaultUriPrefix + "/ueManagement/{apiVersion}/elementType/smf/objectType/ueInfo"
|
||||
UriIMSUEInfo = config.DefaultUriPrefix + "/ueManagement/{apiVersion}/elementType/ims/objectType/ueInfo"
|
||||
@@ -46,6 +49,7 @@ var (
|
||||
UriNSSFAvailableAMFs = config.DefaultUriPrefix + "/ueManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/availableAMFs"
|
||||
UriNSSFSubscriptions = config.DefaultUriPrefix + "/ueManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/subscriptions"
|
||||
|
||||
CustomUriNBState = config.UriPrefix + "/ueManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/nbState"
|
||||
CustomUriNBInfo = config.UriPrefix + "/ueManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/nbInfo"
|
||||
CustomUriSMFUEInfo = config.UriPrefix + "/ueManagement/{apiVersion}/elementType/smf/objectType/ueInfo"
|
||||
CustomUriIMSUEInfo = config.UriPrefix + "/ueManagement/{apiVersion}/elementType/ims/objectType/ueInfo"
|
||||
@@ -1041,6 +1045,71 @@ func GetNBInfoFromNF(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
// PostNBInfoFromNF 接收Radio数据请求
|
||||
func PostNBInfoFromNF(w http.ResponseWriter, r *http.Request) {
|
||||
log.Info("PostNBInfoFromNF processing... ")
|
||||
neType := ctx.GetParam(r, "elementTypeValue")
|
||||
var body struct {
|
||||
NeType string `json:"neType" `
|
||||
NeName string `json:"neName" `
|
||||
RmUID string `json:"rmUID"`
|
||||
StateList []struct {
|
||||
Address string `json:"address" `
|
||||
Name string `json:"name" `
|
||||
Position string `json:"position" `
|
||||
NbName string `json:"nbName" `
|
||||
State string `json:"state" ` // "OFF" or "ON"
|
||||
OffTime string `json:"offTime" ` //if State=OFF, will set it
|
||||
OnTime string `json:"onTime" ` //if State=ON , will set it
|
||||
}
|
||||
}
|
||||
if err := ctx.ShouldBindJSON(r, &body); err != nil {
|
||||
services.ResponseInternalServerError500ProcessError(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
neTypeLower := strings.ToLower(body.NeType)
|
||||
if neType == "" || neType != neTypeLower {
|
||||
services.ResponseInternalServerError500ProcessError(w, fmt.Errorf("inconsistent network element types"))
|
||||
return
|
||||
}
|
||||
|
||||
neInfo := neService.NewNeInfo.SelectNeInfoByRmuid(body.RmUID)
|
||||
if neInfo.RmUID != body.RmUID {
|
||||
services.ResponseInternalServerError500ProcessError(w, fmt.Errorf("inconsistent network element rmUID"))
|
||||
return
|
||||
}
|
||||
|
||||
if len(body.StateList) == 0 {
|
||||
services.ResponseInternalServerError500ProcessError(w, fmt.Errorf("no stateList"))
|
||||
return
|
||||
}
|
||||
|
||||
nbStateService := neDataService.NewNBState
|
||||
for _, v := range body.StateList {
|
||||
if v.Address == "" || v.State == "" {
|
||||
continue
|
||||
}
|
||||
timeStr := v.OffTime
|
||||
if v.State == "ON" {
|
||||
timeStr = v.OnTime
|
||||
}
|
||||
nbStateService.Insert(neDataModel.NBState{
|
||||
NeType: neInfo.NeType,
|
||||
NeId: neInfo.NeId,
|
||||
RmUid: neInfo.RmUID,
|
||||
Address: v.Address,
|
||||
Name: v.Name,
|
||||
Position: v.Position,
|
||||
NbName: v.NbName,
|
||||
State: v.State,
|
||||
Time: timeStr,
|
||||
})
|
||||
}
|
||||
|
||||
services.ResponseStatusOK204NoContent(w)
|
||||
}
|
||||
|
||||
// Get Radio Info from NF/NFs
|
||||
func GetNBInfoAllFromNF(w http.ResponseWriter, r *http.Request) {
|
||||
log.Info("GetNBInfoAllFromNF processing... ")
|
||||
|
||||
4
go.mod
4
go.mod
@@ -4,7 +4,6 @@ go 1.22.0
|
||||
|
||||
require (
|
||||
github.com/dlclark/regexp2 v1.11.4
|
||||
github.com/dustin/go-humanize v1.0.0
|
||||
github.com/gin-gonic/gin v1.10.0
|
||||
github.com/go-resty/resty/v2 v2.14.0
|
||||
github.com/go-sql-driver/mysql v1.8.1
|
||||
@@ -13,7 +12,6 @@ require (
|
||||
github.com/gorilla/mux v1.8.1
|
||||
github.com/gorilla/websocket v1.5.3
|
||||
github.com/gosnmp/gosnmp v1.38.0
|
||||
github.com/jlaffaye/ftp v0.2.0
|
||||
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f
|
||||
github.com/linxGnu/gosmpp v0.3.0
|
||||
github.com/matoous/go-nanoid/v2 v2.1.0
|
||||
@@ -46,8 +44,6 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/KyleBanks/depth v1.2.1 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect; indirect // indirect
|
||||
|
||||
7
go.sum
7
go.sum
@@ -117,11 +117,6 @@ github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
|
||||
github.com/gosnmp/gosnmp v1.36.2-0.20231009064202-d306ed5aa998/go.mod h1:O938QjIS4vpSag1UTcnnBq9MfNmimuOGtvQsT1NbErc=
|
||||
github.com/gosnmp/gosnmp v1.38.0 h1:I5ZOMR8kb0DXAFg/88ACurnuwGwYkXWq3eLpJPHMEYc=
|
||||
github.com/gosnmp/gosnmp v1.38.0/go.mod h1:FE+PEZvKrFz9afP9ii1W3cprXuVZ17ypCcyyfYuu5LY=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
@@ -131,8 +126,6 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/jlaffaye/ftp v0.2.0 h1:lXNvW7cBu7R/68bknOX3MrRIIqZ61zELs1P2RAiA3lg=
|
||||
github.com/jlaffaye/ftp v0.2.0/go.mod h1:is2Ds5qkhceAPy2xD6RLI6hmp/qysSoymZ+Z2uTnspI=
|
||||
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
|
||||
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
|
||||
@@ -8,21 +8,19 @@ import (
|
||||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
)
|
||||
|
||||
type FileInfo struct {
|
||||
FileType string `json:"fileType"` // 文件类型
|
||||
FileMode string `json:"fileMode"` // 文件的权限
|
||||
LinkCount int64 `json:"linkCount"` // 硬链接数目
|
||||
Owner string `json:"owner"` // 所属用户
|
||||
Group string `json:"group"` // 所属组
|
||||
Size string `json:"size"` // 文件的大小
|
||||
ModifiedTime int64 `json:"modifiedTime"` // 最后修改时间,单位为秒
|
||||
FileName string `json:"fileName"` // 文件的名称
|
||||
FileType string `json:"fileType"` // file type: file/directory
|
||||
FileMode string `json:"fileMode"` // file mode
|
||||
LinkCount int64 `json:"linkCount"` // link count
|
||||
Owner string `json:"owner"` // owner
|
||||
Group string `json:"group"` // group
|
||||
Size int64 `json:"size"` // size: xx byte
|
||||
ModifiedTime int64 `json:"modifiedTime"` // last modified time:seconds
|
||||
FilePath string `json:"filePath"` // file path
|
||||
FileName string `json:"fileName"` // file name
|
||||
}
|
||||
|
||||
func GetFileInfo(dir, suffix string) ([]FileInfo, error) {
|
||||
@@ -58,15 +56,15 @@ func GetFileInfo(dir, suffix string) ([]FileInfo, error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
humanReadableSize := humanize.Bytes(uint64(info.Size()))
|
||||
fileInfo := FileInfo{
|
||||
FileType: fileType,
|
||||
FileMode: info.Mode().String(),
|
||||
LinkCount: int64(info.Sys().(*syscall.Stat_t).Nlink),
|
||||
Owner: userInfo.Username,
|
||||
Group: groupInfo.Name,
|
||||
Size: strings.ToUpper(humanReadableSize),
|
||||
Size: info.Size(),
|
||||
ModifiedTime: info.ModTime().Unix(),
|
||||
FilePath: dir,
|
||||
FileName: info.Name(),
|
||||
}
|
||||
files = append(files, fileInfo)
|
||||
|
||||
@@ -267,6 +267,8 @@ func init() {
|
||||
// AMF NBInfo
|
||||
Register("GET", ue.UriNBInfo, ue.GetNBInfoFromNF, nil)
|
||||
Register("GET", ue.CustomUriNBInfo, ue.GetNBInfoFromNF, nil)
|
||||
Register("POST", ue.UriNBState, ue.PostNBInfoFromNF, nil)
|
||||
Register("POST", ue.CustomUriNBState, ue.PostNBInfoFromNF, nil)
|
||||
|
||||
// NSSF AvailableAMFs
|
||||
Register("GET", ue.UriNSSFAvailableAMFs, ue.GetAvailableAMFsFromNSSF, nil)
|
||||
|
||||
2
makefile
2
makefile
@@ -3,7 +3,7 @@
|
||||
ProjectL = omc
|
||||
ProjectU = OMC
|
||||
PROJECT = $(ProjectL)
|
||||
VERSION = 2.2501.4
|
||||
VERSION = 2.2502.1
|
||||
RelDate = `date +%Y%m%d`
|
||||
Release = $(RelDate)
|
||||
RelVer = $(VERSION)-$(RelDate)
|
||||
|
||||
2
mkpkg.sh
2
mkpkg.sh
@@ -2,7 +2,7 @@
|
||||
|
||||
ProcList="restagent sshsvc"
|
||||
ProjectL=omc
|
||||
VERSION=2.2501.4
|
||||
VERSION=2.2502.1
|
||||
RelDate=`date +%Y%m%d`
|
||||
Release=${RelDate}
|
||||
RelVer=${VERSION}-${RelDate}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Makefile for rest agent project
|
||||
|
||||
PROJECT = OMC
|
||||
VERSION = 2.2501.4
|
||||
VERSION = 2.2502.1
|
||||
PLATFORM = amd64
|
||||
ARMPLATFORM = aarch64
|
||||
BUILDDIR = ../../build
|
||||
|
||||
@@ -22,6 +22,7 @@ var URL_WHITE_LIST = []string{
|
||||
"/omcNeConfig",
|
||||
"/cdrEvent",
|
||||
"/ueEvent",
|
||||
"/objectType/nbState",
|
||||
"/upload-ue",
|
||||
"/oauth/token",
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import (
|
||||
"be.ems/src/framework/utils/crypto"
|
||||
"be.ems/src/framework/utils/ssh"
|
||||
systemService "be.ems/src/modules/system/service"
|
||||
"github.com/jlaffaye/ftp"
|
||||
)
|
||||
|
||||
var NewProcessor = &BarProcessor{
|
||||
@@ -177,7 +176,7 @@ func (s BarProcessor) putFTP(filePath, fileName string) {
|
||||
Username string `json:"username" binding:"required"`
|
||||
ToIp string `json:"toIp" binding:"required"`
|
||||
ToPort int64 `json:"toPort" binding:"required"`
|
||||
Protocol string `json:"protocol" binding:"required,oneof=ssh ftp"`
|
||||
Enable bool `json:"enable"`
|
||||
Dir string `json:"dir" binding:"required"`
|
||||
}
|
||||
cfg := systemService.NewSysConfigImpl.SelectConfigByKey("sys.exportTable")
|
||||
@@ -195,68 +194,37 @@ func (s BarProcessor) putFTP(filePath, fileName string) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if !cfgData.Enable {
|
||||
return
|
||||
}
|
||||
|
||||
localFilePath := filepath.Join(filePath, fileName)
|
||||
|
||||
if cfgData.Protocol == "ssh" {
|
||||
connSSH := ssh.ConnSSH{
|
||||
User: cfgData.Username,
|
||||
Password: cfgData.Password,
|
||||
Addr: cfgData.ToIp,
|
||||
Port: cfgData.ToPort,
|
||||
AuthMode: "0",
|
||||
}
|
||||
sshClient, err := connSSH.NewClient()
|
||||
if err != nil {
|
||||
logger.Errorf("putFTP ssh error: %v", err)
|
||||
return
|
||||
}
|
||||
defer sshClient.Close()
|
||||
// 网元主机的SSH客户端进行文件传输
|
||||
sftpClient, err := sshClient.NewClientSFTP()
|
||||
if err != nil {
|
||||
logger.Errorf("putFTP sftp error: %v", err)
|
||||
return
|
||||
}
|
||||
defer sftpClient.Close()
|
||||
// 远程文件
|
||||
remotePath := filepath.Join(cfgData.Dir, path.Base(filePath), fileName)
|
||||
// 复制到远程
|
||||
if err = sftpClient.CopyFileLocalToRemote(localFilePath, remotePath); err != nil {
|
||||
logger.Errorf("putFTP uploading error: %v", err)
|
||||
return
|
||||
}
|
||||
connSSH := ssh.ConnSSH{
|
||||
User: cfgData.Username,
|
||||
Password: cfgData.Password,
|
||||
Addr: cfgData.ToIp,
|
||||
Port: cfgData.ToPort,
|
||||
AuthMode: "0",
|
||||
}
|
||||
|
||||
if cfgData.Protocol == "ftp" {
|
||||
// 连接到 FTP 服务器
|
||||
addr := fmt.Sprintf("%s:%d", cfgData.ToIp, cfgData.ToPort)
|
||||
ftpComm, err := ftp.Dial(addr, ftp.DialWithTimeout(15*time.Second))
|
||||
if err != nil {
|
||||
logger.Errorf("putFTP ftp error: %v", err)
|
||||
return
|
||||
}
|
||||
// 登录到 FTP 服务器
|
||||
err = ftpComm.Login(cfgData.Username, cfgData.Password)
|
||||
if err != nil {
|
||||
logger.Errorf("putFTP login error: %v", err)
|
||||
return
|
||||
}
|
||||
defer ftpComm.Quit()
|
||||
// 打开本地文件
|
||||
file, err := os.Open(localFilePath)
|
||||
if err != nil {
|
||||
logger.Errorf("putFTP open error: %v", err)
|
||||
return
|
||||
}
|
||||
defer file.Close()
|
||||
// 远程文件
|
||||
remotePath := filepath.Join(cfgData.Dir, path.Base(filePath), fileName)
|
||||
// 上传文件到 FTP 服务器
|
||||
err = ftpComm.Stor(remotePath, file)
|
||||
if err != nil {
|
||||
logger.Errorf("putFTP uploading error: %v", err)
|
||||
return
|
||||
}
|
||||
sshClient, err := connSSH.NewClient()
|
||||
if err != nil {
|
||||
logger.Errorf("putFTP ssh error: %v", err)
|
||||
return
|
||||
}
|
||||
defer sshClient.Close()
|
||||
// 网元主机的SSH客户端进行文件传输
|
||||
sftpClient, err := sshClient.NewClientSFTP()
|
||||
if err != nil {
|
||||
logger.Errorf("putFTP sftp error: %v", err)
|
||||
return
|
||||
}
|
||||
defer sftpClient.Close()
|
||||
// 远程文件
|
||||
remotePath := filepath.Join(cfgData.Dir, path.Base(filePath), fileName)
|
||||
// 复制到远程
|
||||
if err = sftpClient.CopyFileLocalToRemote(localFilePath, remotePath); err != nil {
|
||||
logger.Errorf("putFTP uploading error: %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
121
src/modules/network_data/controller/all_nb_state.go
Normal file
121
src/modules/network_data/controller/all_nb_state.go
Normal file
@@ -0,0 +1,121 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"be.ems/src/framework/i18n"
|
||||
"be.ems/src/framework/utils/ctx"
|
||||
"be.ems/src/framework/vo/result"
|
||||
"be.ems/src/modules/network_data/model"
|
||||
neDataService "be.ems/src/modules/network_data/service"
|
||||
neService "be.ems/src/modules/network_element/service"
|
||||
)
|
||||
|
||||
// 实例化控制层 NBStateController 结构体
|
||||
var NewNBState = &NBStateController{
|
||||
neInfoService: neService.NewNeInfo,
|
||||
nbStateService: neDataService.NewNBState,
|
||||
}
|
||||
|
||||
// 基站状态历史记录 AMF/MME
|
||||
//
|
||||
// PATH /nb-state
|
||||
type NBStateController struct {
|
||||
neInfoService *neService.NeInfo // 网元信息服务
|
||||
nbStateService *neDataService.NBState // 基站状态服务
|
||||
}
|
||||
|
||||
// 历史记录列表
|
||||
//
|
||||
// GET /list
|
||||
//
|
||||
// @Tags network_data/amf,network_data/mme
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param neType query string true "NE Type only AMF/MME" Enums(AMF,MME) default(AMF)
|
||||
// @Param neId query string true "NE ID" default(001)
|
||||
// @Param pageNum query number true "pageNum" default(1)
|
||||
// @Param pageSize query number true "pageSize" default(10)
|
||||
// @Param startTime query number false "Start time (timestamped milliseconds)" default(1729162507596)
|
||||
// @Param endTime query number false "End time (timestamped milliseconds)" default(1729164187611)
|
||||
// @Param sortField query string false "Sort fields, fill in result fields" Enums(id,create_time) default(id)
|
||||
// @Param sortOrder query string false "Sort by ascending or descending order" Enums(asc,desc) default(asc)
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Base Station Status List
|
||||
// @Description Base Station Status List
|
||||
// @Router /nb-state/list [get]
|
||||
func (s NBStateController) List(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
var query model.NBStateQuery
|
||||
if err := c.ShouldBindQuery(&query); err != nil {
|
||||
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
|
||||
return
|
||||
}
|
||||
|
||||
// 查询网元信息 rmUID
|
||||
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID(query.NeType, query.NeID)
|
||||
if neInfo.NeId != query.NeID || neInfo.IP == "" {
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
query.RmUID = neInfo.RmUID
|
||||
|
||||
// 查询数据
|
||||
rows, total := s.nbStateService.SelectPage(query)
|
||||
c.JSON(200, result.Ok(map[string]any{"rows": rows, "total": total}))
|
||||
}
|
||||
|
||||
// 历史记录列表导出
|
||||
//
|
||||
// POST /export
|
||||
//
|
||||
// @Tags network_data/amf,network_data/mme
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param data body object true "Request Param"
|
||||
// @Success 200 {object} object "Response Results"
|
||||
// @Security TokenAuth
|
||||
// @Summary Base Station Status List Export
|
||||
// @Description Base Station Status List Export
|
||||
// @Router /nb-state/export [post]
|
||||
func (s NBStateController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
var querys model.NBStateQuery
|
||||
if err := c.ShouldBindBodyWithJSON(&querys); err != nil {
|
||||
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
|
||||
return
|
||||
}
|
||||
// 限制导出数据集
|
||||
if querys.PageSize > 10000 {
|
||||
querys.PageSize = 10000
|
||||
}
|
||||
// 查询网元信息 rmUID
|
||||
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID(querys.NeType, querys.NeID)
|
||||
if neInfo.NeId != querys.NeID || neInfo.IP == "" {
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
|
||||
return
|
||||
}
|
||||
querys.RmUID = neInfo.RmUID
|
||||
rows, total := s.nbStateService.SelectPage(querys)
|
||||
if total == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
}
|
||||
|
||||
// 导出文件名称
|
||||
fileName := fmt.Sprintf("nb_state_records_export_%d_%d.xlsx", len(rows), time.Now().UnixMilli())
|
||||
// 导出数据表格
|
||||
saveFilePath, err := s.nbStateService.ExportXlsx(rows, fileName, language)
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
c.FileAttachment(saveFilePath, fileName)
|
||||
}
|
||||
35
src/modules/network_data/model/nb_state.go
Normal file
35
src/modules/network_data/model/nb_state.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package model
|
||||
|
||||
// NBState 基站状态记录表 nb_state
|
||||
type NBState struct {
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||
NeType string `json:"neType" gorm:"column:ne_type"` // 网元类型 AMF MME
|
||||
NeId string `json:"neId" gorm:"column:ne_id"` // 网元ID
|
||||
RmUid string `json:"rmUid" gorm:"column:rm_uid"` // 资源唯一标识
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
Address string `json:"address" gorm:"column:address"` // 基站IP地址
|
||||
NbName string `json:"nbName" gorm:"column:nb_name"` // 基站设备名称
|
||||
Name string `json:"name" gorm:"column:name"` // 基站名称
|
||||
Position string `json:"position" gorm:"column:position"` // 基站位置
|
||||
State string `json:"state" gorm:"column:state"` // 基站状态 OFF ON
|
||||
Time string `json:"time" gorm:"column:time"` // 状态时间
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*NBState) TableName() string {
|
||||
return "nb_state"
|
||||
}
|
||||
|
||||
// NBStateQuery 查询参数结构体
|
||||
type NBStateQuery struct {
|
||||
NeType string `json:"neType" form:"neType" binding:"required"`
|
||||
NeID string `json:"neId" form:"neId" binding:"required"`
|
||||
PageNum int64 `json:"pageNum" form:"pageNum" binding:"required"`
|
||||
PageSize int64 `json:"pageSize" form:"pageSize" binding:"required"`
|
||||
Status string `json:"status" form:"status"`
|
||||
StartTime string `json:"startTime" form:"startTime"`
|
||||
EndTime string `json:"endTime" form:"endTime"`
|
||||
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=id create_time"` // 排序字段,填写结果字段
|
||||
SortOrder string `json:"sortOrder" form:"sortOrder" binding:"omitempty,oneof=asc desc"` // 排序升降序,asc desc
|
||||
RmUID string `json:"rmUID" form:"rmUID"`
|
||||
}
|
||||
@@ -6,7 +6,6 @@ type UDMAuthUser struct {
|
||||
IMSI string `json:"imsi" gorm:"column:imsi"` // SIM卡/USIM卡ID
|
||||
NeId string `json:"neId" gorm:"column:ne_id"` // UDM网元标识
|
||||
Amf string `json:"amf" gorm:"column:amf"` // AMF
|
||||
Status string `json:"status" gorm:"column:status"` // 状态
|
||||
Ki string `json:"ki" gorm:"column:ki"` // ki
|
||||
AlgoIndex string `json:"algoIndex" gorm:"column:algo_index"` // algoIndex
|
||||
Opc string `json:"opc" gorm:"column:opc"` // OPC
|
||||
|
||||
@@ -42,6 +42,19 @@ func Setup(router *gin.Engine) {
|
||||
)
|
||||
}
|
||||
|
||||
// 基站状态历史记录信息 含AMF/MME
|
||||
nbStateGroup := neDataGroup.Group("/nb-state")
|
||||
{
|
||||
nbStateGroup.GET("/list",
|
||||
middleware.PreAuthorize(nil),
|
||||
controller.NewNBState.List,
|
||||
)
|
||||
nbStateGroup.POST("/export",
|
||||
middleware.PreAuthorize(nil),
|
||||
controller.NewNBState.Export,
|
||||
)
|
||||
}
|
||||
|
||||
// 网元IMS
|
||||
imsGroup := neDataGroup.Group("/ims")
|
||||
{
|
||||
|
||||
116
src/modules/network_data/repository/all_nb_state.go
Normal file
116
src/modules/network_data/repository/all_nb_state.go
Normal file
@@ -0,0 +1,116 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"be.ems/src/framework/datasource"
|
||||
"be.ems/src/framework/logger"
|
||||
"be.ems/src/modules/network_data/model"
|
||||
)
|
||||
|
||||
// 实例化数据层 NBState 结构体
|
||||
var NewNBState = &NBState{}
|
||||
|
||||
// NBState 基站状态记录表 数据层处理
|
||||
type NBState struct{}
|
||||
|
||||
// SelectByPage 分页查询集合
|
||||
func (r NBState) SelectByPage(query model.NBStateQuery) ([]model.NBState, int64) {
|
||||
tx := datasource.DB("").Model(&model.NBState{})
|
||||
// 查询条件拼接
|
||||
if query.NeType != "" {
|
||||
tx = tx.Where("ne_type = ?", query.NeType)
|
||||
}
|
||||
if query.NeID != "" {
|
||||
tx = tx.Where("ne_id = ?", query.NeID)
|
||||
}
|
||||
if query.RmUID != "" {
|
||||
tx = tx.Where("rm_uid = ?", query.RmUID)
|
||||
}
|
||||
if query.Status != "" {
|
||||
tx = tx.Where("state = ?", query.Status)
|
||||
}
|
||||
if query.StartTime != "" {
|
||||
startTime := query.StartTime
|
||||
if len(startTime) == 10 {
|
||||
startTime = startTime + "000"
|
||||
}
|
||||
tx = tx.Where("create_time >= ?", startTime)
|
||||
}
|
||||
if query.EndTime != "" {
|
||||
endTime := query.EndTime
|
||||
if len(endTime) == 10 {
|
||||
endTime = endTime + "999"
|
||||
}
|
||||
tx = tx.Where("create_time <= ?", endTime)
|
||||
}
|
||||
|
||||
// 查询结果
|
||||
var total int64 = 0
|
||||
rows := []model.NBState{}
|
||||
|
||||
// 查询数量为0直接返回
|
||||
if err := tx.Count(&total).Error; err != nil || total <= 0 {
|
||||
return rows, total
|
||||
}
|
||||
|
||||
// 排序
|
||||
if query.SortField != "" {
|
||||
sortField := query.SortField
|
||||
if query.SortOrder == "desc" {
|
||||
sortField = sortField + " desc"
|
||||
}
|
||||
tx = tx.Order(sortField)
|
||||
}
|
||||
|
||||
// 查询数据分页
|
||||
pageNum, pageSize := datasource.PageNumSize(query.PageNum, query.PageSize)
|
||||
tx = tx.Limit(pageSize).Offset(pageSize * pageNum)
|
||||
err := tx.Find(&rows).Error
|
||||
if err != nil {
|
||||
logger.Errorf("query find err => %v", err.Error())
|
||||
return rows, total
|
||||
}
|
||||
return rows, total
|
||||
}
|
||||
|
||||
// SelectByIds 通过ID查询
|
||||
func (r NBState) SelectByIds(ids []string) []model.NBState {
|
||||
rows := []model.NBState{}
|
||||
if len(ids) <= 0 {
|
||||
return rows
|
||||
}
|
||||
tx := datasource.DB("").Model(&model.NBState{})
|
||||
// 构建查询条件
|
||||
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
|
||||
}
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
func (r NBState) DeleteByIds(ids []string) int64 {
|
||||
if len(ids) <= 0 {
|
||||
return 0
|
||||
}
|
||||
tx := datasource.DB("").Where("id in ?", ids)
|
||||
if err := tx.Delete(&model.NBState{}).Error; err != nil {
|
||||
logger.Errorf("delete err => %v", err.Error())
|
||||
return 0
|
||||
}
|
||||
return tx.RowsAffected
|
||||
}
|
||||
|
||||
// Insert 新增信息
|
||||
func (r NBState) Insert(param model.NBState) int64 {
|
||||
param.CreateTime = time.Now().UnixMilli()
|
||||
// 执行插入
|
||||
if err := datasource.DB("").Create(¶m).Error; err != nil {
|
||||
logger.Errorf("insert err => %v", err.Error())
|
||||
return 0
|
||||
}
|
||||
return param.ID
|
||||
}
|
||||
84
src/modules/network_data/service/all_nb_state.go
Normal file
84
src/modules/network_data/service/all_nb_state.go
Normal file
@@ -0,0 +1,84 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"be.ems/src/framework/i18n"
|
||||
"be.ems/src/framework/utils/file"
|
||||
"be.ems/src/modules/network_data/model"
|
||||
"be.ems/src/modules/network_data/repository"
|
||||
)
|
||||
|
||||
// 实例化数据层 NBState 结构体
|
||||
var NewNBState = &NBState{
|
||||
nbStateRepository: repository.NewNBState,
|
||||
}
|
||||
|
||||
// NBState 基站状态记录表 服务层处理
|
||||
type NBState struct {
|
||||
nbStateRepository *repository.NBState // 基站状态记录信息
|
||||
}
|
||||
|
||||
// SelectPage 根据条件分页查询
|
||||
func (r NBState) SelectPage(query model.NBStateQuery) ([]model.NBState, int64) {
|
||||
return r.nbStateRepository.SelectByPage(query)
|
||||
}
|
||||
|
||||
// Insert 插入数据
|
||||
func (r NBState) Insert(item model.NBState) int64 {
|
||||
return r.nbStateRepository.Insert(item)
|
||||
}
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
func (r NBState) DeleteByIds(ids []string) (int64, error) {
|
||||
// 检查是否存在
|
||||
arr := r.nbStateRepository.SelectByIds(ids)
|
||||
if len(arr) <= 0 {
|
||||
return 0, fmt.Errorf("not data")
|
||||
}
|
||||
|
||||
if len(arr) == len(ids) {
|
||||
rows := r.nbStateRepository.DeleteByIds(ids)
|
||||
return rows, nil
|
||||
}
|
||||
// 删除信息失败!
|
||||
return 0, fmt.Errorf("delete fail")
|
||||
}
|
||||
|
||||
// ExportXlsx 导出数据到 xlsx 文件
|
||||
func (r NBState) ExportXlsx(rows []model.NBState, fileName, language string) (string, error) {
|
||||
// 第一行表头标题
|
||||
headerCells := map[string]string{
|
||||
"A1": i18n.TKey(language, "nbState.export.id"),
|
||||
"B1": i18n.TKey(language, "nbState.export.name"),
|
||||
"C1": i18n.TKey(language, "nbState.export.position"),
|
||||
"D1": i18n.TKey(language, "nbState.export.address"),
|
||||
"E1": i18n.TKey(language, "nbState.export.nbName"),
|
||||
"F1": i18n.TKey(language, "nbState.export.state"),
|
||||
"G1": i18n.TKey(language, "nbState.export.time"),
|
||||
}
|
||||
|
||||
// 从第二行开始的数据
|
||||
dataCells := make([]map[string]any, 0)
|
||||
for i, row := range rows {
|
||||
idx := strconv.Itoa(i + 2)
|
||||
// 角色状态
|
||||
statusValue := i18n.TKey(language, "dictData.offline")
|
||||
if row.State == "ON" {
|
||||
statusValue = i18n.TKey(language, "dictData.online")
|
||||
}
|
||||
dataCells = append(dataCells, map[string]any{
|
||||
"A" + idx: row.ID,
|
||||
"B" + idx: row.Name,
|
||||
"C" + idx: row.Position,
|
||||
"D" + idx: row.Address,
|
||||
"E" + idx: row.NbName,
|
||||
"F" + idx: statusValue,
|
||||
"G" + idx: row.Time,
|
||||
})
|
||||
}
|
||||
|
||||
// 导出数据表格
|
||||
return file.WriteSheet(headerCells, dataCells, fileName, "Sheet1")
|
||||
}
|
||||
@@ -58,9 +58,9 @@ func (r CDREventIMS) ExportXlsx(rows []model.CDREventIMS, fileName, language str
|
||||
"A1": "ID",
|
||||
"B1": "Record Behavior",
|
||||
"C1": "Type",
|
||||
"D1": "Called",
|
||||
"E1": "Result",
|
||||
"F1": "Caller",
|
||||
"D1": "Caller",
|
||||
"E1": "Called",
|
||||
"F1": "Result",
|
||||
"G1": "Duration",
|
||||
"H1": "Call Start Time",
|
||||
"I1": "Hangup Time",
|
||||
@@ -110,7 +110,7 @@ func (r CDREventIMS) ExportXlsx(rows []model.CDREventIMS, fileName, language str
|
||||
// 时长
|
||||
duration := "-"
|
||||
if v, ok := cdrJSON["callDuration"]; ok && v != nil && callType != "sms" {
|
||||
duration = fmt.Sprint(parse.Number(v))
|
||||
duration = fmt.Sprintf("%ds", parse.Number(v))
|
||||
}
|
||||
// 呼叫结果 非短信都有code作为结果 sms短信都ok
|
||||
callResult := "Success"
|
||||
@@ -146,9 +146,9 @@ func (r CDREventIMS) ExportXlsx(rows []model.CDREventIMS, fileName, language str
|
||||
"A" + idx: row.ID,
|
||||
"B" + idx: recordType,
|
||||
"C" + idx: callTypeLable,
|
||||
"D" + idx: called,
|
||||
"E" + idx: callResult,
|
||||
"F" + idx: caller,
|
||||
"D" + idx: caller,
|
||||
"E" + idx: called,
|
||||
"F" + idx: callResult,
|
||||
"G" + idx: duration,
|
||||
"H" + idx: seizureTimeStr,
|
||||
"I" + idx: releaseTimeStr,
|
||||
|
||||
@@ -62,7 +62,6 @@ func (r *UDMAuthUser) dataByRedis(imsi, neId string) []model.UDMAuthUser {
|
||||
a := model.UDMAuthUser{
|
||||
IMSI: imsi,
|
||||
Amf: amf,
|
||||
Status: "1", // 默认给1
|
||||
Ki: m["ki"],
|
||||
AlgoIndex: m["algo"],
|
||||
Opc: m["opc"],
|
||||
@@ -92,7 +91,6 @@ func (r *UDMAuthUser) ParseInfo(imsi, neId string, data map[string]string) model
|
||||
u.Ki = data["ki"]
|
||||
u.AlgoIndex = data["algo"]
|
||||
u.Opc = data["opc"]
|
||||
u.Status = "1"
|
||||
return u
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Makefile for OMC-OMC-crontask project
|
||||
|
||||
PROJECT = OMC
|
||||
VERSION = 2.2501.4
|
||||
VERSION = 2.2502.1
|
||||
LIBDIR = be.ems/lib
|
||||
BINNAME = sshsvc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user