Commit 2157bb0270663df35b7267c3d10c8b594400102e
1 parent
0a44eb89
规范数据库,给各个标设置主键ID
Showing
22 changed files
with
392 additions
and
320 deletions
sql/mysql.sql
| 1 | --- MySQL dump 10.13 Distrib 8.0.27, for Linux (x86_64) | 1 | +-- MySQL dump 10.13 Distrib 8.0.28, for Linux (x86_64) |
| 2 | -- | 2 | -- |
| 3 | --- Host: 192.168.1.242 Database: wvp | 3 | +-- Host: 127.0.0.1 Database: wvp |
| 4 | -- ------------------------------------------------------ | 4 | -- ------------------------------------------------------ |
| 5 | --- Server version 5.7.22 | 5 | +-- Server version 8.0.28-0ubuntu0.20.04.3 |
| 6 | 6 | ||
| 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
| 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
| @@ -23,26 +23,28 @@ DROP TABLE IF EXISTS `device`; | @@ -23,26 +23,28 @@ DROP TABLE IF EXISTS `device`; | ||
| 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 24 | /*!50503 SET character_set_client = utf8mb4 */; | 24 | /*!50503 SET character_set_client = utf8mb4 */; |
| 25 | CREATE TABLE `device` ( | 25 | CREATE TABLE `device` ( |
| 26 | - `deviceId` varchar(50) NOT NULL, | ||
| 27 | - `name` varchar(255) DEFAULT NULL, | ||
| 28 | - `manufacturer` varchar(255) DEFAULT NULL, | ||
| 29 | - `model` varchar(255) DEFAULT NULL, | ||
| 30 | - `firmware` varchar(255) DEFAULT NULL, | ||
| 31 | - `transport` varchar(50) DEFAULT NULL, | ||
| 32 | - `streamMode` varchar(50) DEFAULT NULL, | ||
| 33 | - `online` varchar(50) DEFAULT NULL, | ||
| 34 | - `registerTime` varchar(50) DEFAULT NULL, | ||
| 35 | - `keepaliveTime` varchar(50) DEFAULT NULL, | ||
| 36 | - `ip` varchar(50) NOT NULL, | ||
| 37 | - `createTime` varchar(50) NOT NULL, | ||
| 38 | - `updateTime` varchar(50) NOT NULL, | ||
| 39 | - `port` int(11) NOT NULL, | ||
| 40 | - `expires` int(11) NOT NULL, | ||
| 41 | - `subscribeCycleForCatalog` int(11) NOT NULL, | ||
| 42 | - `hostAddress` varchar(50) NOT NULL, | ||
| 43 | - `charset` varchar(50) NOT NULL, | ||
| 44 | - PRIMARY KEY (`deviceId`) | ||
| 45 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 26 | + `id` int NOT NULL AUTO_INCREMENT, |
| 27 | + `deviceId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 28 | + `name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 29 | + `manufacturer` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 30 | + `model` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 31 | + `firmware` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 32 | + `transport` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 33 | + `streamMode` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 34 | + `online` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 35 | + `registerTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 36 | + `keepaliveTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 37 | + `ip` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 38 | + `createTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 39 | + `updateTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 40 | + `port` int NOT NULL, | ||
| 41 | + `expires` int NOT NULL, | ||
| 42 | + `subscribeCycleForCatalog` int NOT NULL, | ||
| 43 | + `hostAddress` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 44 | + `charset` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 45 | + PRIMARY KEY (`id`), | ||
| 46 | + UNIQUE KEY `device_deviceId_uindex` (`deviceId`) | ||
| 47 | +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 46 | /*!40101 SET character_set_client = @saved_cs_client */; | 48 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 47 | 49 | ||
| 48 | -- | 50 | -- |
| @@ -51,6 +53,7 @@ CREATE TABLE `device` ( | @@ -51,6 +53,7 @@ CREATE TABLE `device` ( | ||
| 51 | 53 | ||
| 52 | LOCK TABLES `device` WRITE; | 54 | LOCK TABLES `device` WRITE; |
| 53 | /*!40000 ALTER TABLE `device` DISABLE KEYS */; | 55 | /*!40000 ALTER TABLE `device` DISABLE KEYS */; |
| 56 | +INSERT INTO `device` VALUES (1,'34020000002000000005','DH-NVR5864-I','Dahua','DH-NVR5864-I','4.001.0000000.3,2020-10-22','UDP','UDP','1','2022-02-22 11:05:10','2022-02-22 11:42:10','192.168.1.19','2022-02-22 10:17:24','2022-02-22 11:42:10',5060,3600,0,'192.168.1.19:5060','gb2312'); | ||
| 54 | /*!40000 ALTER TABLE `device` ENABLE KEYS */; | 57 | /*!40000 ALTER TABLE `device` ENABLE KEYS */; |
| 55 | UNLOCK TABLES; | 58 | UNLOCK TABLES; |
| 56 | 59 | ||
| @@ -62,18 +65,18 @@ DROP TABLE IF EXISTS `device_alarm`; | @@ -62,18 +65,18 @@ DROP TABLE IF EXISTS `device_alarm`; | ||
| 62 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 65 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 63 | /*!50503 SET character_set_client = utf8mb4 */; | 66 | /*!50503 SET character_set_client = utf8mb4 */; |
| 64 | CREATE TABLE `device_alarm` ( | 67 | CREATE TABLE `device_alarm` ( |
| 65 | - `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 66 | - `deviceId` varchar(50) NOT NULL, | ||
| 67 | - `channelId` varchar(50) NOT NULL, | ||
| 68 | - `alarmPriority` varchar(50) NOT NULL, | ||
| 69 | - `alarmMethod` varchar(50) DEFAULT NULL, | ||
| 70 | - `alarmTime` varchar(50) NOT NULL, | ||
| 71 | - `alarmDescription` varchar(255) DEFAULT NULL, | ||
| 72 | - `longitude` double DEFAULT NULL, | ||
| 73 | - `latitude` double DEFAULT NULL, | ||
| 74 | - `alarmType` varchar(50) DEFAULT NULL, | ||
| 75 | - PRIMARY KEY (`id`) | ||
| 76 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 68 | + `id` int NOT NULL AUTO_INCREMENT, |
| 69 | + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 70 | + `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 71 | + `alarmPriority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 72 | + `alarmMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 73 | + `alarmTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 74 | + `alarmDescription` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 75 | + `longitude` double DEFAULT NULL, | ||
| 76 | + `latitude` double DEFAULT NULL, | ||
| 77 | + `alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 78 | + PRIMARY KEY (`id`) USING BTREE | ||
| 79 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 77 | /*!40101 SET character_set_client = @saved_cs_client */; | 80 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 78 | 81 | ||
| 79 | -- | 82 | -- |
| @@ -93,38 +96,38 @@ DROP TABLE IF EXISTS `device_channel`; | @@ -93,38 +96,38 @@ DROP TABLE IF EXISTS `device_channel`; | ||
| 93 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 96 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 94 | /*!50503 SET character_set_client = utf8mb4 */; | 97 | /*!50503 SET character_set_client = utf8mb4 */; |
| 95 | CREATE TABLE `device_channel` ( | 98 | CREATE TABLE `device_channel` ( |
| 96 | - `channelId` varchar(50) NOT NULL, | ||
| 97 | - `name` varchar(255) DEFAULT NULL, | ||
| 98 | - `manufacture` varchar(50) DEFAULT NULL, | ||
| 99 | - `model` varchar(50) DEFAULT NULL, | ||
| 100 | - `owner` varchar(50) DEFAULT NULL, | ||
| 101 | - `civilCode` varchar(50) DEFAULT NULL, | ||
| 102 | - `block` varchar(50) DEFAULT NULL, | ||
| 103 | - `address` varchar(50) DEFAULT NULL, | ||
| 104 | - `parentId` varchar(50) DEFAULT NULL, | ||
| 105 | - `safetyWay` int(11) DEFAULT NULL, | ||
| 106 | - `registerWay` int(11) DEFAULT NULL, | ||
| 107 | - `certNum` varchar(50) DEFAULT NULL, | ||
| 108 | - `certifiable` int(11) DEFAULT NULL, | ||
| 109 | - `errCode` int(11) DEFAULT NULL, | ||
| 110 | - `subCount` int(11) DEFAULT 0, | ||
| 111 | - `endTime` varchar(50) DEFAULT NULL, | ||
| 112 | - `secrecy` varchar(50) DEFAULT NULL, | ||
| 113 | - `ipAddress` varchar(50) DEFAULT NULL, | ||
| 114 | - `port` int(11) DEFAULT NULL, | ||
| 115 | - `password` varchar(255) DEFAULT NULL, | ||
| 116 | - `PTZType` int(11) DEFAULT NULL, | ||
| 117 | - `status` int(11) DEFAULT NULL, | ||
| 118 | - `longitude` double DEFAULT NULL, | ||
| 119 | - `latitude` double DEFAULT NULL, | ||
| 120 | - `streamId` varchar(50) DEFAULT NULL, | ||
| 121 | - `deviceId` varchar(50) NOT NULL, | ||
| 122 | - `parental` varchar(50) DEFAULT NULL, | ||
| 123 | - `hasAudio` bit(1) DEFAULT NULL, | ||
| 124 | - `createTime` varchar(50) NOT NULL, | ||
| 125 | - `updateTime` varchar(50) NOT NULL, | ||
| 126 | - PRIMARY KEY (`channelId`,`deviceId`) | ||
| 127 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 99 | + `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| 100 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 101 | + `manufacture` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 102 | + `model` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 103 | + `owner` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 104 | + `civilCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 105 | + `block` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 106 | + `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 107 | + `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 108 | + `safetyWay` int DEFAULT NULL, | ||
| 109 | + `registerWay` int DEFAULT NULL, | ||
| 110 | + `certNum` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 111 | + `certifiable` int DEFAULT NULL, | ||
| 112 | + `errCode` int DEFAULT NULL, | ||
| 113 | + `endTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 114 | + `secrecy` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 115 | + `ipAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 116 | + `port` int DEFAULT NULL, | ||
| 117 | + `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 118 | + `PTZType` int DEFAULT NULL, | ||
| 119 | + `status` int DEFAULT NULL, | ||
| 120 | + `longitude` double DEFAULT NULL, | ||
| 121 | + `latitude` double DEFAULT NULL, | ||
| 122 | + `streamId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 123 | + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 124 | + `parental` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 125 | + `hasAudio` bit(1) DEFAULT NULL, | ||
| 126 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 127 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 128 | + `subCount` int DEFAULT '0', | ||
| 129 | + PRIMARY KEY (`channelId`,`deviceId`) USING BTREE | ||
| 130 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 128 | /*!40101 SET character_set_client = @saved_cs_client */; | 131 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 129 | 132 | ||
| 130 | -- | 133 | -- |
| @@ -133,6 +136,7 @@ CREATE TABLE `device_channel` ( | @@ -133,6 +136,7 @@ CREATE TABLE `device_channel` ( | ||
| 133 | 136 | ||
| 134 | LOCK TABLES `device_channel` WRITE; | 137 | LOCK TABLES `device_channel` WRITE; |
| 135 | /*!40000 ALTER TABLE `device_channel` DISABLE KEYS */; | 138 | /*!40000 ALTER TABLE `device_channel` DISABLE KEYS */; |
| 139 | +INSERT INTO `device_channel` VALUES ('34020000001310000001','通道1','Dahua','DH-NVR5864-I','0','340200','','axy','34020000002000000005',0,1,'',0,0,NULL,'0','192.168.1.17',37777,'',0,1,0,0,NULL,'34020000002000000005','0',NULL,'','',0),('34020000001310000065','GB_Chn_065','Dahua','DH-NVR5864-I','0','340200','','axy','34020000002000000005',0,1,'',0,0,NULL,'0','',0,'',0,1,0,0,NULL,'34020000002000000005','0',NULL,'','',0); | ||
| 136 | /*!40000 ALTER TABLE `device_channel` ENABLE KEYS */; | 140 | /*!40000 ALTER TABLE `device_channel` ENABLE KEYS */; |
| 137 | UNLOCK TABLES; | 141 | UNLOCK TABLES; |
| 138 | 142 | ||
| @@ -144,21 +148,22 @@ DROP TABLE IF EXISTS `device_mobile_position`; | @@ -144,21 +148,22 @@ DROP TABLE IF EXISTS `device_mobile_position`; | ||
| 144 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 148 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 145 | /*!50503 SET character_set_client = utf8mb4 */; | 149 | /*!50503 SET character_set_client = utf8mb4 */; |
| 146 | CREATE TABLE `device_mobile_position` ( | 150 | CREATE TABLE `device_mobile_position` ( |
| 147 | - `deviceId` varchar(50) NOT NULL, | ||
| 148 | - `channelId` varchar(50) NOT NULL, | ||
| 149 | - `deviceName` varchar(255) DEFAULT NULL, | ||
| 150 | - `time` varchar(50) NOT NULL, | ||
| 151 | - `longitude` double NOT NULL, | ||
| 152 | - `latitude` double NOT NULL, | ||
| 153 | - `altitude` double DEFAULT NULL, | ||
| 154 | - `speed` double DEFAULT NULL, | ||
| 155 | - `direction` double DEFAULT NULL, | ||
| 156 | - `reportSource` varchar(50) DEFAULT NULL, | ||
| 157 | - `geodeticSystem` varchar(50) DEFAULT NULL, | ||
| 158 | - `cnLng` varchar(50) DEFAULT NULL, | ||
| 159 | - `cnLat` varchar(50) DEFAULT NULL, | ||
| 160 | - PRIMARY KEY (`deviceId`,`time`) | ||
| 161 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 151 | + `id` int NOT NULL AUTO_INCREMENT, |
| 152 | + `deviceId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 153 | + `channelId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 154 | + `deviceName` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 155 | + `time` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 156 | + `longitude` double NOT NULL, | ||
| 157 | + `latitude` double NOT NULL, | ||
| 158 | + `altitude` double DEFAULT NULL, | ||
| 159 | + `speed` double DEFAULT NULL, | ||
| 160 | + `direction` double DEFAULT NULL, | ||
| 161 | + `reportSource` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 162 | + `geodeticSystem` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 163 | + `cnLng` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 164 | + `cnLat` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 165 | + PRIMARY KEY (`id`) | ||
| 166 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 162 | /*!40101 SET character_set_client = @saved_cs_client */; | 167 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 163 | 168 | ||
| 164 | -- | 169 | -- |
| @@ -178,21 +183,21 @@ DROP TABLE IF EXISTS `gb_stream`; | @@ -178,21 +183,21 @@ DROP TABLE IF EXISTS `gb_stream`; | ||
| 178 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 183 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 179 | /*!50503 SET character_set_client = utf8mb4 */; | 184 | /*!50503 SET character_set_client = utf8mb4 */; |
| 180 | CREATE TABLE `gb_stream` ( | 185 | CREATE TABLE `gb_stream` ( |
| 181 | - `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 182 | - `app` varchar(255) NOT NULL, | ||
| 183 | - `stream` varchar(255) NOT NULL, | ||
| 184 | - `gbId` varchar(50) NOT NULL, | ||
| 185 | - `name` varchar(255) DEFAULT NULL, | ||
| 186 | - `longitude` double DEFAULT NULL, | ||
| 187 | - `latitude` double DEFAULT NULL, | ||
| 188 | - `streamType` varchar(50) DEFAULT NULL, | ||
| 189 | - `mediaServerId` varchar(50) DEFAULT NULL, | ||
| 190 | - `status` int(11) DEFAULT NULL, | ||
| 191 | - `createStamp` bigint(20) DEFAULT NULL, | ||
| 192 | - PRIMARY KEY (`id`), | ||
| 193 | - UNIQUE KEY `app` (`app`,`stream`), | ||
| 194 | - UNIQUE KEY `gbId` (`gbId`) | ||
| 195 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 186 | + `id` int NOT NULL AUTO_INCREMENT, |
| 187 | + `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 188 | + `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 189 | + `gbId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 190 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 191 | + `longitude` double DEFAULT NULL, | ||
| 192 | + `latitude` double DEFAULT NULL, | ||
| 193 | + `streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 194 | + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 195 | + `status` int DEFAULT NULL, | ||
| 196 | + `createStamp` bigint DEFAULT NULL, | ||
| 197 | + PRIMARY KEY (`id`) USING BTREE, | ||
| 198 | + UNIQUE KEY `app` (`app`,`stream`) USING BTREE, | ||
| 199 | + UNIQUE KEY `gbId` (`gbId`) USING BTREE | ||
| 200 | +) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 196 | /*!40101 SET character_set_client = @saved_cs_client */; | 201 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 197 | 202 | ||
| 198 | -- | 203 | -- |
| @@ -201,6 +206,7 @@ CREATE TABLE `gb_stream` ( | @@ -201,6 +206,7 @@ CREATE TABLE `gb_stream` ( | ||
| 201 | 206 | ||
| 202 | LOCK TABLES `gb_stream` WRITE; | 207 | LOCK TABLES `gb_stream` WRITE; |
| 203 | /*!40000 ALTER TABLE `gb_stream` DISABLE KEYS */; | 208 | /*!40000 ALTER TABLE `gb_stream` DISABLE KEYS */; |
| 209 | +INSERT INTO `gb_stream` VALUES (74,'1000','10000000_000','34020000002000000001','测试1',0,0,'push','FQ3TF8yT83wh5Wvz',0,1645500864142),(75,'1000','10000001_000','34020000012000000002','测试2',0,0,'push','FQ3TF8yT83wh5Wvz',0,1645500864142),(76,'1000','10000002_000','34020000022000000003','测试3',0,0,'push','FQ3TF8yT83wh5Wvz',0,1645500864142); | ||
| 204 | /*!40000 ALTER TABLE `gb_stream` ENABLE KEYS */; | 210 | /*!40000 ALTER TABLE `gb_stream` ENABLE KEYS */; |
| 205 | UNLOCK TABLES; | 211 | UNLOCK TABLES; |
| 206 | 212 | ||
| @@ -212,17 +218,17 @@ DROP TABLE IF EXISTS `log`; | @@ -212,17 +218,17 @@ DROP TABLE IF EXISTS `log`; | ||
| 212 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 218 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 213 | /*!50503 SET character_set_client = utf8mb4 */; | 219 | /*!50503 SET character_set_client = utf8mb4 */; |
| 214 | CREATE TABLE `log` ( | 220 | CREATE TABLE `log` ( |
| 215 | - `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 216 | - `name` varchar(50) NOT NULL, | ||
| 217 | - `type` varchar(50) NOT NULL, | ||
| 218 | - `uri` varchar(200) NOT NULL, | ||
| 219 | - `address` varchar(50) NOT NULL, | ||
| 220 | - `result` varchar(50) NOT NULL, | ||
| 221 | - `timing` bigint(20) NOT NULL, | ||
| 222 | - `username` varchar(50) NOT NULL, | ||
| 223 | - `createTime` varchar(50) NOT NULL, | ||
| 224 | - PRIMARY KEY (`id`) | ||
| 225 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 221 | + `id` int NOT NULL AUTO_INCREMENT, |
| 222 | + `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 223 | + `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 224 | + `uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 225 | + `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 226 | + `result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 227 | + `timing` bigint NOT NULL, | ||
| 228 | + `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 229 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 230 | + PRIMARY KEY (`id`) USING BTREE | ||
| 231 | +) ENGINE=InnoDB AUTO_INCREMENT=206 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 226 | /*!40101 SET character_set_client = @saved_cs_client */; | 232 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 227 | 233 | ||
| 228 | -- | 234 | -- |
| @@ -231,6 +237,7 @@ CREATE TABLE `log` ( | @@ -231,6 +237,7 @@ CREATE TABLE `log` ( | ||
| 231 | 237 | ||
| 232 | LOCK TABLES `log` WRITE; | 238 | LOCK TABLES `log` WRITE; |
| 233 | /*!40000 ALTER TABLE `log` DISABLE KEYS */; | 239 | /*!40000 ALTER TABLE `log` DISABLE KEYS */; |
| 240 | +INSERT INTO `log` VALUES (163,'登录','GET','/api/user/login','127.0.0.1','200 OK',243,'admin','2022-02-22 10:18:15'),(164,'开始点播','GET','/api/play/start/34020000002000000005/34020000001310000001','127.0.0.1','200 OK',77,'admin','2022-02-22 10:18:35'),(165,'[设备查询] 同步设备通道','POST','/api/device/query/devices/34020000002000000005/sync','127.0.0.1','200 OK',10,'admin','2022-02-22 10:18:47'),(166,'开始点播','GET','/api/play/start/34020000002000000005/34020000001310000065','127.0.0.1','200 OK',19,'admin','2022-02-22 10:18:50'),(167,'停止点播','GET','/api/play/stop/34020000002000000005/34020000001310000065','127.0.0.1','200 OK',159,'admin','2022-02-22 10:19:08'),(168,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',305,'admin','2022-02-22 10:22:02'),(169,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',142,'admin','2022-02-22 10:22:28'),(170,'添加上级平台','POST','/api/platform/save','127.0.0.1','200 OK',11,'admin','2022-02-22 10:22:57'),(171,'登录','GET','/api/user/login','127.0.0.1','200 OK',255,'admin','2022-02-22 10:26:31'),(172,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',40,'admin','2022-02-22 10:26:44'),(173,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',139,'admin','2022-02-22 10:26:51'),(174,'登录','GET','/api/user/login','127.0.0.1','200 OK',657,'admin','2022-02-22 10:28:21'),(175,'登录','GET','/api/user/login','127.0.0.1','200 OK',302,'admin','2022-02-22 11:04:24'),(176,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',33,'admin','2022-02-22 11:04:34'),(177,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',17,'admin','2022-02-22 11:04:35'),(178,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',186,'admin','2022-02-22 11:04:44'),(179,'登录','GET','/api/user/login','127.0.0.1','200 OK',258,'admin','2022-02-22 11:05:05'),(180,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',97,'admin','2022-02-22 11:05:51'),(181,'登录','GET','/api/user/login','127.0.0.1','200 OK',300,'admin','2022-02-22 11:11:30'),(182,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',145,'admin','2022-02-22 11:12:00'),(183,'登录','GET','/api/user/login','127.0.0.1','200 OK',264,'admin','2022-02-22 11:12:42'),(184,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',41793,'admin','2022-02-22 11:13:42'),(185,'登录','GET','/api/user/login','127.0.0.1','200 OK',245,'admin','2022-02-22 11:13:58'),(186,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',86,'admin','2022-02-22 11:14:11'),(187,'登录','GET','/api/user/login','127.0.0.1','200 OK',293,'admin','2022-02-22 11:31:52'),(188,'向上级平台添加国标通道','POST','/api/platform/update_channel_for_gb','127.0.0.1','200 OK',14,'admin','2022-02-22 11:34:55'),(189,'向上级平台添加国标通道','POST','/api/platform/update_channel_for_gb','127.0.0.1','200 OK',11,'admin','2022-02-22 11:35:02'),(190,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',16,'admin','2022-02-22 11:37:00'),(191,'登录','GET','/api/user/login','127.0.0.1','200 OK',340,'admin','2022-02-22 11:38:15'),(192,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',16,'admin','2022-02-22 11:38:20'),(193,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',10,'admin','2022-02-22 11:38:28'),(194,'登录','GET','/api/user/login','127.0.0.1','200 OK',288,'admin','2022-02-22 11:39:34'),(195,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',29,'admin','2022-02-22 11:39:36'),(196,'启用代理','GET','/api/proxy/start','127.0.0.1','200 OK',594,'admin','2022-02-22 11:39:38'),(197,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',16,'admin','2022-02-22 11:39:43'),(198,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',27,'admin','2022-02-22 11:41:30'),(199,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',17,'admin','2022-02-22 11:41:42'),(200,'启用代理','GET','/api/proxy/start','127.0.0.1','200 OK',9,'admin','2022-02-22 11:41:44'),(201,'启用代理','GET','/api/proxy/start','127.0.0.1','200 OK',6,'admin','2022-02-22 11:41:47'),(202,'启用代理','GET','/api/proxy/start','127.0.0.1','200 OK',67,'admin','2022-02-22 11:41:48'),(203,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',14,'admin','2022-02-22 11:41:51'),(204,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',16,'admin','2022-02-22 11:41:52'),(205,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',14,'admin','2022-02-22 11:41:53'); | ||
| 234 | /*!40000 ALTER TABLE `log` ENABLE KEYS */; | 241 | /*!40000 ALTER TABLE `log` ENABLE KEYS */; |
| 235 | UNLOCK TABLES; | 242 | UNLOCK TABLES; |
| 236 | 243 | ||
| @@ -242,32 +249,32 @@ DROP TABLE IF EXISTS `media_server`; | @@ -242,32 +249,32 @@ DROP TABLE IF EXISTS `media_server`; | ||
| 242 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 249 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 243 | /*!50503 SET character_set_client = utf8mb4 */; | 250 | /*!50503 SET character_set_client = utf8mb4 */; |
| 244 | CREATE TABLE `media_server` ( | 251 | CREATE TABLE `media_server` ( |
| 245 | - `id` varchar(255) NOT NULL, | ||
| 246 | - `ip` varchar(50) NOT NULL, | ||
| 247 | - `hookIp` varchar(50) NOT NULL, | ||
| 248 | - `sdpIp` varchar(50) NOT NULL, | ||
| 249 | - `streamIp` varchar(50) NOT NULL, | ||
| 250 | - `httpPort` int(11) NOT NULL, | ||
| 251 | - `httpSSlPort` int(11) NOT NULL, | ||
| 252 | - `rtmpPort` int(11) NOT NULL, | ||
| 253 | - `rtmpSSlPort` int(11) NOT NULL, | ||
| 254 | - `rtpProxyPort` int(11) NOT NULL, | ||
| 255 | - `rtspPort` int(11) NOT NULL, | ||
| 256 | - `rtspSSLPort` int(11) NOT NULL, | ||
| 257 | - `autoConfig` int(11) NOT NULL, | ||
| 258 | - `secret` varchar(50) NOT NULL, | ||
| 259 | - `streamNoneReaderDelayMS` int(11) NOT NULL, | ||
| 260 | - `rtpEnable` int(11) NOT NULL, | ||
| 261 | - `rtpPortRange` varchar(50) NOT NULL, | ||
| 262 | - `sendRtpPortRange` varchar(50) NOT NULL, | ||
| 263 | - `recordAssistPort` int(11) NOT NULL, | ||
| 264 | - `defaultServer` int(11) NOT NULL, | ||
| 265 | - `createTime` varchar(50) NOT NULL, | ||
| 266 | - `updateTime` varchar(50) NOT NULL, | ||
| 267 | - `hookAliveInterval` int(11) NOT NULL, | ||
| 268 | - PRIMARY KEY (`id`), | ||
| 269 | - UNIQUE KEY `media_server_i` (`ip`,`httpPort`) | ||
| 270 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 252 | + `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| 253 | + `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 254 | + `hookIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 255 | + `sdpIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 256 | + `streamIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 257 | + `httpPort` int NOT NULL, | ||
| 258 | + `httpSSlPort` int NOT NULL, | ||
| 259 | + `rtmpPort` int NOT NULL, | ||
| 260 | + `rtmpSSlPort` int NOT NULL, | ||
| 261 | + `rtpProxyPort` int NOT NULL, | ||
| 262 | + `rtspPort` int NOT NULL, | ||
| 263 | + `rtspSSLPort` int NOT NULL, | ||
| 264 | + `autoConfig` int NOT NULL, | ||
| 265 | + `secret` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 266 | + `streamNoneReaderDelayMS` int NOT NULL, | ||
| 267 | + `rtpEnable` int NOT NULL, | ||
| 268 | + `rtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 269 | + `sendRtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 270 | + `recordAssistPort` int NOT NULL, | ||
| 271 | + `defaultServer` int NOT NULL, | ||
| 272 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 273 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 274 | + `hookAliveInterval` int NOT NULL, | ||
| 275 | + PRIMARY KEY (`id`) USING BTREE, | ||
| 276 | + UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE | ||
| 277 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 271 | /*!40101 SET character_set_client = @saved_cs_client */; | 278 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 272 | 279 | ||
| 273 | -- | 280 | -- |
| @@ -276,6 +283,7 @@ CREATE TABLE `media_server` ( | @@ -276,6 +283,7 @@ CREATE TABLE `media_server` ( | ||
| 276 | 283 | ||
| 277 | LOCK TABLES `media_server` WRITE; | 284 | LOCK TABLES `media_server` WRITE; |
| 278 | /*!40000 ALTER TABLE `media_server` DISABLE KEYS */; | 285 | /*!40000 ALTER TABLE `media_server` DISABLE KEYS */; |
| 286 | +INSERT INTO `media_server` VALUES ('FQ3TF8yT83wh5Wvz','192.168.1.3','192.168.1.3','192.168.1.3','192.168.1.3',6080,0,10935,0,10000,10554,0,1,'035c73f7-bb6b-4889-a715-d9eb2d1925cc',18000,1,'30000,30500','30000,30500',18081,1,'2022-02-22 11:39:33','2022-02-22 11:39:33',30); | ||
| 279 | /*!40000 ALTER TABLE `media_server` ENABLE KEYS */; | 287 | /*!40000 ALTER TABLE `media_server` ENABLE KEYS */; |
| 280 | UNLOCK TABLES; | 288 | UNLOCK TABLES; |
| 281 | 289 | ||
| @@ -287,29 +295,29 @@ DROP TABLE IF EXISTS `parent_platform`; | @@ -287,29 +295,29 @@ DROP TABLE IF EXISTS `parent_platform`; | ||
| 287 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 295 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 288 | /*!50503 SET character_set_client = utf8mb4 */; | 296 | /*!50503 SET character_set_client = utf8mb4 */; |
| 289 | CREATE TABLE `parent_platform` ( | 297 | CREATE TABLE `parent_platform` ( |
| 290 | - `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 291 | - `enable` int(11) DEFAULT NULL, | ||
| 292 | - `name` varchar(255) DEFAULT NULL, | ||
| 293 | - `serverGBId` varchar(50) NOT NULL, | ||
| 294 | - `serverGBDomain` varchar(50) DEFAULT NULL, | ||
| 295 | - `serverIP` varchar(50) DEFAULT NULL, | ||
| 296 | - `serverPort` int(11) DEFAULT NULL, | ||
| 297 | - `deviceGBId` varchar(50) NOT NULL, | ||
| 298 | - `deviceIp` varchar(50) DEFAULT NULL, | ||
| 299 | - `devicePort` varchar(50) DEFAULT NULL, | ||
| 300 | - `username` varchar(255) DEFAULT NULL, | ||
| 301 | - `password` varchar(50) DEFAULT NULL, | ||
| 302 | - `expires` varchar(50) DEFAULT NULL, | ||
| 303 | - `keepTimeout` varchar(50) DEFAULT NULL, | ||
| 304 | - `transport` varchar(50) DEFAULT NULL, | ||
| 305 | - `characterSet` varchar(50) DEFAULT NULL, | ||
| 306 | - `catalogId` varchar(50) NOT NULL, | ||
| 307 | - `ptz` int(11) DEFAULT NULL, | ||
| 308 | - `rtcp` int(11) DEFAULT NULL, | ||
| 309 | - `status` bit(1) DEFAULT NULL, | ||
| 310 | - `shareAllLiveStream` int(11) DEFAULT NULL, | ||
| 311 | - PRIMARY KEY (`id`,`serverGBId`) | ||
| 312 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 298 | + `id` int NOT NULL AUTO_INCREMENT, |
| 299 | + `enable` int DEFAULT NULL, | ||
| 300 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 301 | + `serverGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 302 | + `serverGBDomain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 303 | + `serverIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 304 | + `serverPort` int DEFAULT NULL, | ||
| 305 | + `deviceGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 306 | + `deviceIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 307 | + `devicePort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 308 | + `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 309 | + `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 310 | + `expires` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 311 | + `keepTimeout` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 312 | + `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 313 | + `characterSet` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 314 | + `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 315 | + `ptz` int DEFAULT NULL, | ||
| 316 | + `rtcp` int DEFAULT NULL, | ||
| 317 | + `status` bit(1) DEFAULT NULL, | ||
| 318 | + `shareAllLiveStream` int DEFAULT NULL, | ||
| 319 | + PRIMARY KEY (`id`,`serverGBId`) USING BTREE | ||
| 320 | +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 313 | /*!40101 SET character_set_client = @saved_cs_client */; | 321 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 314 | 322 | ||
| 315 | -- | 323 | -- |
| @@ -318,6 +326,7 @@ CREATE TABLE `parent_platform` ( | @@ -318,6 +326,7 @@ CREATE TABLE `parent_platform` ( | ||
| 318 | 326 | ||
| 319 | LOCK TABLES `parent_platform` WRITE; | 327 | LOCK TABLES `parent_platform` WRITE; |
| 320 | /*!40000 ALTER TABLE `parent_platform` DISABLE KEYS */; | 328 | /*!40000 ALTER TABLE `parent_platform` DISABLE KEYS */; |
| 329 | +INSERT INTO `parent_platform` VALUES (4,0,'11111','111111111111111','1111111111','11.111.11.11',2342,'34020000013000000001','192.168.1.3','15060','34020000013000000001','12345678','300','60','UDP','GB2312','111111111111111',1,0,_binary '\0',0),(5,0,'2222','222222222222222','2222222222','222.22.2.2',2222,'34020000013000000001','192.168.1.3','15060','34020000013000000001','12345678','300','60','UDP','GB2312','222222222222222',1,0,_binary '\0',0); | ||
| 321 | /*!40000 ALTER TABLE `parent_platform` ENABLE KEYS */; | 330 | /*!40000 ALTER TABLE `parent_platform` ENABLE KEYS */; |
| 322 | UNLOCK TABLES; | 331 | UNLOCK TABLES; |
| 323 | 332 | ||
| @@ -329,12 +338,12 @@ DROP TABLE IF EXISTS `platform_catalog`; | @@ -329,12 +338,12 @@ DROP TABLE IF EXISTS `platform_catalog`; | ||
| 329 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 338 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 330 | /*!50503 SET character_set_client = utf8mb4 */; | 339 | /*!50503 SET character_set_client = utf8mb4 */; |
| 331 | CREATE TABLE `platform_catalog` ( | 340 | CREATE TABLE `platform_catalog` ( |
| 332 | - `id` varchar(50) NOT NULL, | ||
| 333 | - `platformId` varchar(50) NOT NULL, | ||
| 334 | - `name` varchar(255) NOT NULL, | ||
| 335 | - `parentId` varchar(50) DEFAULT NULL, | ||
| 336 | - PRIMARY KEY (`id`) | ||
| 337 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 341 | + `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| 342 | + `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 343 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 344 | + `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 345 | + PRIMARY KEY (`id`) USING BTREE | ||
| 346 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 338 | /*!40101 SET character_set_client = @saved_cs_client */; | 347 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 339 | 348 | ||
| 340 | -- | 349 | -- |
| @@ -354,13 +363,14 @@ DROP TABLE IF EXISTS `platform_gb_channel`; | @@ -354,13 +363,14 @@ DROP TABLE IF EXISTS `platform_gb_channel`; | ||
| 354 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 363 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 355 | /*!50503 SET character_set_client = utf8mb4 */; | 364 | /*!50503 SET character_set_client = utf8mb4 */; |
| 356 | CREATE TABLE `platform_gb_channel` ( | 365 | CREATE TABLE `platform_gb_channel` ( |
| 357 | - `channelId` varchar(50) NOT NULL, | ||
| 358 | - `deviceId` varchar(50) NOT NULL, | ||
| 359 | - `platformId` varchar(50) NOT NULL, | ||
| 360 | - `deviceAndChannelId` varchar(50) NOT NULL, | ||
| 361 | - `catalogId` varchar(50) NOT NULL, | ||
| 362 | - PRIMARY KEY (`deviceAndChannelId`,`platformId`) | ||
| 363 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 366 | + `id` int NOT NULL AUTO_INCREMENT, |
| 367 | + `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 368 | + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 369 | + `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 370 | + `deviceAndChannelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 371 | + `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 372 | + PRIMARY KEY (`id`) | ||
| 373 | +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 364 | /*!40101 SET character_set_client = @saved_cs_client */; | 374 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 365 | 375 | ||
| 366 | -- | 376 | -- |
| @@ -369,6 +379,7 @@ CREATE TABLE `platform_gb_channel` ( | @@ -369,6 +379,7 @@ CREATE TABLE `platform_gb_channel` ( | ||
| 369 | 379 | ||
| 370 | LOCK TABLES `platform_gb_channel` WRITE; | 380 | LOCK TABLES `platform_gb_channel` WRITE; |
| 371 | /*!40000 ALTER TABLE `platform_gb_channel` DISABLE KEYS */; | 381 | /*!40000 ALTER TABLE `platform_gb_channel` DISABLE KEYS */; |
| 382 | +INSERT INTO `platform_gb_channel` VALUES (1,'34020000001310000001','34020000002000000005','111111111111111','34020000002000000005_34020000001310000001','111111111111111'),(2,'34020000001310000065','34020000002000000005','222222222222222','34020000002000000005_34020000001310000065','222222222222222'); | ||
| 372 | /*!40000 ALTER TABLE `platform_gb_channel` ENABLE KEYS */; | 383 | /*!40000 ALTER TABLE `platform_gb_channel` ENABLE KEYS */; |
| 373 | UNLOCK TABLES; | 384 | UNLOCK TABLES; |
| 374 | 385 | ||
| @@ -380,12 +391,12 @@ DROP TABLE IF EXISTS `platform_gb_stream`; | @@ -380,12 +391,12 @@ DROP TABLE IF EXISTS `platform_gb_stream`; | ||
| 380 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 391 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 381 | /*!50503 SET character_set_client = utf8mb4 */; | 392 | /*!50503 SET character_set_client = utf8mb4 */; |
| 382 | CREATE TABLE `platform_gb_stream` ( | 393 | CREATE TABLE `platform_gb_stream` ( |
| 383 | - `platformId` varchar(50) NOT NULL, | ||
| 384 | - `app` varchar(255) NOT NULL, | ||
| 385 | - `stream` varchar(255) NOT NULL, | ||
| 386 | - `catalogId` varchar(50) NOT NULL, | ||
| 387 | - PRIMARY KEY (`platformId`,`app`,`stream`) | ||
| 388 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 394 | + `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| 395 | + `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 396 | + `gbStreamId` int NOT NULL, | ||
| 397 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 398 | + PRIMARY KEY (`id`) | ||
| 399 | +) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 389 | /*!40101 SET character_set_client = @saved_cs_client */; | 400 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 390 | 401 | ||
| 391 | -- | 402 | -- |
| @@ -394,37 +405,11 @@ CREATE TABLE `platform_gb_stream` ( | @@ -394,37 +405,11 @@ CREATE TABLE `platform_gb_stream` ( | ||
| 394 | 405 | ||
| 395 | LOCK TABLES `platform_gb_stream` WRITE; | 406 | LOCK TABLES `platform_gb_stream` WRITE; |
| 396 | /*!40000 ALTER TABLE `platform_gb_stream` DISABLE KEYS */; | 407 | /*!40000 ALTER TABLE `platform_gb_stream` DISABLE KEYS */; |
| 408 | +INSERT INTO `platform_gb_stream` VALUES ('111111111111111','111111111111111',70,35),('111111111111111','111111111111111',71,36),('111111111111111','111111111111111',72,37),('222222222222222','222222222222222',73,38),('111111111111111','111111111111111',74,39),('111111111111111','111111111111111',75,40),('111111111111111','111111111111111',76,41); | ||
| 397 | /*!40000 ALTER TABLE `platform_gb_stream` ENABLE KEYS */; | 409 | /*!40000 ALTER TABLE `platform_gb_stream` ENABLE KEYS */; |
| 398 | UNLOCK TABLES; | 410 | UNLOCK TABLES; |
| 399 | 411 | ||
| 400 | -- | 412 | -- |
| 401 | --- Table structure for table `user_role` | ||
| 402 | --- | ||
| 403 | - | ||
| 404 | -DROP TABLE IF EXISTS `user_role`; | ||
| 405 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | ||
| 406 | -/*!50503 SET character_set_client = utf8mb4 */; | ||
| 407 | -CREATE TABLE `user_role` ( | ||
| 408 | - `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 409 | - `name` varchar(50) NOT NULL, | ||
| 410 | - `authority` varchar(50) NOT NULL, | ||
| 411 | - `createTime` varchar(50) NOT NULL, | ||
| 412 | - `updateTime` varchar(50) NOT NULL, | ||
| 413 | - PRIMARY KEY (`id`) | ||
| 414 | -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; | ||
| 415 | -/*!40101 SET character_set_client = @saved_cs_client */; | ||
| 416 | - | ||
| 417 | --- | ||
| 418 | --- Dumping data for table `user_role` | ||
| 419 | --- | ||
| 420 | - | ||
| 421 | -LOCK TABLES `user_role` WRITE; | ||
| 422 | -/*!40000 ALTER TABLE `user_role` DISABLE KEYS */; | ||
| 423 | -INSERT INTO `user_role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); | ||
| 424 | -/*!40000 ALTER TABLE `user_role` ENABLE KEYS */; | ||
| 425 | -UNLOCK TABLES; | ||
| 426 | - | ||
| 427 | --- | ||
| 428 | -- Table structure for table `stream_proxy` | 413 | -- Table structure for table `stream_proxy` |
| 429 | -- | 414 | -- |
| 430 | 415 | ||
| @@ -432,24 +417,25 @@ DROP TABLE IF EXISTS `stream_proxy`; | @@ -432,24 +417,25 @@ DROP TABLE IF EXISTS `stream_proxy`; | ||
| 432 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 417 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 433 | /*!50503 SET character_set_client = utf8mb4 */; | 418 | /*!50503 SET character_set_client = utf8mb4 */; |
| 434 | CREATE TABLE `stream_proxy` ( | 419 | CREATE TABLE `stream_proxy` ( |
| 435 | - `type` varchar(50) NOT NULL, | ||
| 436 | - `app` varchar(255) NOT NULL, | ||
| 437 | - `stream` varchar(255) NOT NULL, | ||
| 438 | - `url` varchar(255) DEFAULT NULL, | ||
| 439 | - `src_url` varchar(255) DEFAULT NULL, | ||
| 440 | - `dst_url` varchar(255) DEFAULT NULL, | ||
| 441 | - `timeout_ms` int(11) DEFAULT NULL, | ||
| 442 | - `ffmpeg_cmd_key` varchar(255) DEFAULT NULL, | ||
| 443 | - `rtp_type` varchar(50) DEFAULT NULL, | ||
| 444 | - `mediaServerId` varchar(50) DEFAULT NULL, | ||
| 445 | - `enable_hls` bit(1) DEFAULT NULL, | ||
| 446 | - `enable_mp4` bit(1) DEFAULT NULL, | ||
| 447 | - `enable` bit(1) NOT NULL, | ||
| 448 | - `status` bit(1) NOT NULL, | ||
| 449 | - `enable_remove_none_reader` bit(1) NOT NULL, | ||
| 450 | - `createTime` varchar(50) NOT NULL, | ||
| 451 | - PRIMARY KEY (`app`,`stream`) | ||
| 452 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 420 | + `id` int NOT NULL AUTO_INCREMENT, |
| 421 | + `type` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 422 | + `app` varchar(255) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 423 | + `stream` varchar(255) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 424 | + `url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 425 | + `src_url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 426 | + `dst_url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 427 | + `timeout_ms` int DEFAULT NULL, | ||
| 428 | + `ffmpeg_cmd_key` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 429 | + `rtp_type` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 430 | + `mediaServerId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 431 | + `enable_hls` bit(1) DEFAULT NULL, | ||
| 432 | + `enable_mp4` bit(1) DEFAULT NULL, | ||
| 433 | + `enable` bit(1) NOT NULL, | ||
| 434 | + `status` bit(1) NOT NULL, | ||
| 435 | + `enable_remove_none_reader` bit(1) NOT NULL, | ||
| 436 | + `createTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 437 | + PRIMARY KEY (`id`) | ||
| 438 | +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 453 | /*!40101 SET character_set_client = @saved_cs_client */; | 439 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 454 | 440 | ||
| 455 | -- | 441 | -- |
| @@ -469,16 +455,18 @@ DROP TABLE IF EXISTS `stream_push`; | @@ -469,16 +455,18 @@ DROP TABLE IF EXISTS `stream_push`; | ||
| 469 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 455 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 470 | /*!50503 SET character_set_client = utf8mb4 */; | 456 | /*!50503 SET character_set_client = utf8mb4 */; |
| 471 | CREATE TABLE `stream_push` ( | 457 | CREATE TABLE `stream_push` ( |
| 472 | - `app` varchar(255) NOT NULL, | ||
| 473 | - `stream` varchar(255) NOT NULL, | ||
| 474 | - `totalReaderCount` varchar(50) DEFAULT NULL, | ||
| 475 | - `originType` int(11) DEFAULT NULL, | ||
| 476 | - `originTypeStr` varchar(50) DEFAULT NULL, | ||
| 477 | - `createStamp` bigint(20) DEFAULT NULL, | ||
| 478 | - `aliveSecond` int(11) DEFAULT NULL, | ||
| 479 | - `mediaServerId` varchar(50) DEFAULT NULL, | ||
| 480 | - PRIMARY KEY (`app`,`stream`) | ||
| 481 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | 458 | + `id` int NOT NULL AUTO_INCREMENT, |
| 459 | + `app` varchar(255) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 460 | + `stream` varchar(255) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 461 | + `totalReaderCount` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 462 | + `originType` int DEFAULT NULL, | ||
| 463 | + `originTypeStr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 464 | + `createStamp` bigint DEFAULT NULL, | ||
| 465 | + `aliveSecond` int DEFAULT NULL, | ||
| 466 | + `mediaServerId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 467 | + PRIMARY KEY (`id`), | ||
| 468 | + UNIQUE KEY `stream_push_pk` (`app`,`stream`) | ||
| 469 | +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 482 | /*!40101 SET character_set_client = @saved_cs_client */; | 470 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 483 | 471 | ||
| 484 | -- | 472 | -- |
| @@ -487,6 +475,7 @@ CREATE TABLE `stream_push` ( | @@ -487,6 +475,7 @@ CREATE TABLE `stream_push` ( | ||
| 487 | 475 | ||
| 488 | LOCK TABLES `stream_push` WRITE; | 476 | LOCK TABLES `stream_push` WRITE; |
| 489 | /*!40000 ALTER TABLE `stream_push` DISABLE KEYS */; | 477 | /*!40000 ALTER TABLE `stream_push` DISABLE KEYS */; |
| 478 | +INSERT INTO `stream_push` VALUES (13,'1000','10000000_000','0',2,'rtsp_push',1645500864142,NULL,'FQ3TF8yT83wh5Wvz'),(14,'1000','10000001_000','0',2,'rtsp_push',1645500864142,NULL,'FQ3TF8yT83wh5Wvz'),(15,'1000','10000002_000','0',2,'rtsp_push',1645500864142,NULL,'FQ3TF8yT83wh5Wvz'); | ||
| 490 | /*!40000 ALTER TABLE `stream_push` ENABLE KEYS */; | 479 | /*!40000 ALTER TABLE `stream_push` ENABLE KEYS */; |
| 491 | UNLOCK TABLES; | 480 | UNLOCK TABLES; |
| 492 | 481 | ||
| @@ -498,15 +487,15 @@ DROP TABLE IF EXISTS `user`; | @@ -498,15 +487,15 @@ DROP TABLE IF EXISTS `user`; | ||
| 498 | /*!40101 SET @saved_cs_client = @@character_set_client */; | 487 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 499 | /*!50503 SET character_set_client = utf8mb4 */; | 488 | /*!50503 SET character_set_client = utf8mb4 */; |
| 500 | CREATE TABLE `user` ( | 489 | CREATE TABLE `user` ( |
| 501 | - `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 502 | - `username` varchar(255) NOT NULL, | ||
| 503 | - `password` varchar(255) NOT NULL, | ||
| 504 | - `roleId` int(11) NOT NULL, | ||
| 505 | - `createTime` varchar(50) NOT NULL, | ||
| 506 | - `updateTime` varchar(50) NOT NULL, | ||
| 507 | - PRIMARY KEY (`id`), | ||
| 508 | - UNIQUE KEY `user_username_uindex` (`username`) | ||
| 509 | -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; | 490 | + `id` int NOT NULL AUTO_INCREMENT, |
| 491 | + `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 492 | + `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 493 | + `roleId` int NOT NULL, | ||
| 494 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 495 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 496 | + PRIMARY KEY (`id`) USING BTREE, | ||
| 497 | + UNIQUE KEY `user_username_uindex` (`username`) USING BTREE | ||
| 498 | +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 510 | /*!40101 SET character_set_client = @saved_cs_client */; | 499 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 511 | 500 | ||
| 512 | -- | 501 | -- |
| @@ -518,6 +507,33 @@ LOCK TABLES `user` WRITE; | @@ -518,6 +507,33 @@ LOCK TABLES `user` WRITE; | ||
| 518 | INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57'); | 507 | INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57'); |
| 519 | /*!40000 ALTER TABLE `user` ENABLE KEYS */; | 508 | /*!40000 ALTER TABLE `user` ENABLE KEYS */; |
| 520 | UNLOCK TABLES; | 509 | UNLOCK TABLES; |
| 510 | + | ||
| 511 | +-- | ||
| 512 | +-- Table structure for table `user_role` | ||
| 513 | +-- | ||
| 514 | + | ||
| 515 | +DROP TABLE IF EXISTS `user_role`; | ||
| 516 | +/*!40101 SET @saved_cs_client = @@character_set_client */; | ||
| 517 | +/*!50503 SET character_set_client = utf8mb4 */; | ||
| 518 | +CREATE TABLE `user_role` ( | ||
| 519 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 520 | + `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 521 | + `authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 522 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 523 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 524 | + PRIMARY KEY (`id`) USING BTREE | ||
| 525 | +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 526 | +/*!40101 SET character_set_client = @saved_cs_client */; | ||
| 527 | + | ||
| 528 | +-- | ||
| 529 | +-- Dumping data for table `user_role` | ||
| 530 | +-- | ||
| 531 | + | ||
| 532 | +LOCK TABLES `user_role` WRITE; | ||
| 533 | +/*!40000 ALTER TABLE `user_role` DISABLE KEYS */; | ||
| 534 | +INSERT INTO `user_role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); | ||
| 535 | +/*!40000 ALTER TABLE `user_role` ENABLE KEYS */; | ||
| 536 | +UNLOCK TABLES; | ||
| 521 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | 537 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
| 522 | 538 | ||
| 523 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | 539 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
| @@ -528,4 +544,4 @@ UNLOCK TABLES; | @@ -528,4 +544,4 @@ UNLOCK TABLES; | ||
| 528 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | 544 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
| 529 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | 545 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
| 530 | 546 | ||
| 531 | --- Dump completed on 2022-01-25 15:36:42 | 547 | +-- Dump completed on 2022-02-22 11:43:00 |
sql/update.sql deleted
100644 → 0
| 1 | -ALTER TABLE stream_proxy ADD status bit(1) not null; | ||
| 2 | - | ||
| 3 | -# 去除子查询优化查询速度 | ||
| 4 | -alter table device_channel | ||
| 5 | - add subCount int default 0 null; | ||
| 6 | - | ||
| 7 | -update device_channel dc set dc.subCount = (select te.count from (SELECT count(0) as count FROM device_channel WHERE parentId = dc.channelId) te) | ||
| 8 | \ No newline at end of file | 0 | \ No newline at end of file |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
| @@ -4,6 +4,11 @@ package com.genersoft.iot.vmp.gb28181.bean; | @@ -4,6 +4,11 @@ package com.genersoft.iot.vmp.gb28181.bean; | ||
| 4 | public class Device { | 4 | public class Device { |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| 7 | + * Id | ||
| 8 | + */ | ||
| 9 | + private int id; | ||
| 10 | + | ||
| 11 | + /** | ||
| 7 | * 设备Id | 12 | * 设备Id |
| 8 | */ | 13 | */ |
| 9 | private String deviceId; | 14 | private String deviceId; |
| @@ -114,7 +119,13 @@ public class Device { | @@ -114,7 +119,13 @@ public class Device { | ||
| 114 | */ | 119 | */ |
| 115 | private int subscribeCycleForCatalog ; | 120 | private int subscribeCycleForCatalog ; |
| 116 | 121 | ||
| 122 | + public int getId() { | ||
| 123 | + return id; | ||
| 124 | + } | ||
| 117 | 125 | ||
| 126 | + public void setId(int id) { | ||
| 127 | + this.id = id; | ||
| 128 | + } | ||
| 118 | 129 | ||
| 119 | public String getDeviceId() { | 130 | public String getDeviceId() { |
| 120 | return deviceId; | 131 | return deviceId; |
| @@ -283,4 +294,6 @@ public class Device { | @@ -283,4 +294,6 @@ public class Device { | ||
| 283 | public void setSubscribeCycleForCatalog(int subscribeCycleForCatalog) { | 294 | public void setSubscribeCycleForCatalog(int subscribeCycleForCatalog) { |
| 284 | this.subscribeCycleForCatalog = subscribeCycleForCatalog; | 295 | this.subscribeCycleForCatalog = subscribeCycleForCatalog; |
| 285 | } | 296 | } |
| 297 | + | ||
| 298 | + | ||
| 286 | } | 299 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java
| @@ -5,6 +5,7 @@ package com.genersoft.iot.vmp.gb28181.bean; | @@ -5,6 +5,7 @@ package com.genersoft.iot.vmp.gb28181.bean; | ||
| 5 | */ | 5 | */ |
| 6 | public class GbStream extends PlatformGbStream{ | 6 | public class GbStream extends PlatformGbStream{ |
| 7 | 7 | ||
| 8 | + private int id; | ||
| 8 | private String app; | 9 | private String app; |
| 9 | private String stream; | 10 | private String stream; |
| 10 | private String gbId; | 11 | private String gbId; |
| @@ -19,6 +20,14 @@ public class GbStream extends PlatformGbStream{ | @@ -19,6 +20,14 @@ public class GbStream extends PlatformGbStream{ | ||
| 19 | */ | 20 | */ |
| 20 | public Long createStamp; | 21 | public Long createStamp; |
| 21 | 22 | ||
| 23 | + public int getId() { | ||
| 24 | + return id; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public void setId(int id) { | ||
| 28 | + this.id = id; | ||
| 29 | + } | ||
| 30 | + | ||
| 22 | public String getApp() { | 31 | public String getApp() { |
| 23 | return app; | 32 | return app; |
| 24 | } | 33 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/MobilePosition.java
| @@ -8,6 +8,10 @@ package com.genersoft.iot.vmp.gb28181.bean; | @@ -8,6 +8,10 @@ package com.genersoft.iot.vmp.gb28181.bean; | ||
| 8 | 8 | ||
| 9 | public class MobilePosition { | 9 | public class MobilePosition { |
| 10 | /** | 10 | /** |
| 11 | + * Id | ||
| 12 | + */ | ||
| 13 | + private int id; | ||
| 14 | + /** | ||
| 11 | * 设备Id | 15 | * 设备Id |
| 12 | */ | 16 | */ |
| 13 | private String deviceId; | 17 | private String deviceId; |
| @@ -72,6 +76,13 @@ public class MobilePosition { | @@ -72,6 +76,13 @@ public class MobilePosition { | ||
| 72 | */ | 76 | */ |
| 73 | private String cnLat; | 77 | private String cnLat; |
| 74 | 78 | ||
| 79 | + public int getId() { | ||
| 80 | + return id; | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + public void setId(int id) { | ||
| 84 | + this.id = id; | ||
| 85 | + } | ||
| 75 | 86 | ||
| 76 | public String getDeviceId() { | 87 | public String getDeviceId() { |
| 77 | return deviceId; | 88 | return deviceId; |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformGbStream.java
| 1 | package com.genersoft.iot.vmp.gb28181.bean; | 1 | package com.genersoft.iot.vmp.gb28181.bean; |
| 2 | 2 | ||
| 3 | public class PlatformGbStream { | 3 | public class PlatformGbStream { |
| 4 | - private String app; | ||
| 5 | - private String stream; | 4 | + private String gbStreamId; |
| 6 | private String platformId; | 5 | private String platformId; |
| 7 | private String catalogId; | 6 | private String catalogId; |
| 8 | 7 | ||
| 9 | - public String getApp() { | ||
| 10 | - return app; | 8 | + public String getGbStreamId() { |
| 9 | + return gbStreamId; | ||
| 11 | } | 10 | } |
| 12 | 11 | ||
| 13 | - public void setApp(String app) { | ||
| 14 | - this.app = app; | ||
| 15 | - } | ||
| 16 | - | ||
| 17 | - public String getStream() { | ||
| 18 | - return stream; | ||
| 19 | - } | ||
| 20 | - | ||
| 21 | - public void setStream(String stream) { | ||
| 22 | - this.stream = stream; | 12 | + public void setGbStreamId(String gbStreamId) { |
| 13 | + this.gbStreamId = gbStreamId; | ||
| 23 | } | 14 | } |
| 24 | 15 | ||
| 25 | public String getPlatformId() { | 16 | public String getPlatformId() { |
src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java
| @@ -76,7 +76,10 @@ public class KeepaliveTimeoutListenerForPlatform extends RedisKeyExpirationEvent | @@ -76,7 +76,10 @@ public class KeepaliveTimeoutListenerForPlatform extends RedisKeyExpirationEvent | ||
| 76 | eventResult.callId = callid; | 76 | eventResult.callId = callid; |
| 77 | eventResult.msg = "注册超时"; | 77 | eventResult.msg = "注册超时"; |
| 78 | eventResult.type = "register timeout"; | 78 | eventResult.type = "register timeout"; |
| 79 | - sipSubscribe.getErrorSubscribe(callid).response(eventResult); | 79 | + if (sipSubscribe.getErrorSubscribe(callid) != null) { |
| 80 | + sipSubscribe.getErrorSubscribe(callid).response(eventResult); | ||
| 81 | + } | ||
| 82 | + | ||
| 80 | } | 83 | } |
| 81 | 84 | ||
| 82 | } | 85 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| @@ -102,7 +102,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -102,7 +102,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 102 | 102 | ||
| 103 | sipSubscribe.addErrorSubscribe(callIdHeader.getCallId(), (event)->{ | 103 | sipSubscribe.addErrorSubscribe(callIdHeader.getCallId(), (event)->{ |
| 104 | if (event != null) { | 104 | if (event != null) { |
| 105 | - logger.info("向上级平台 [ {} ] 注册发上错误: {} ", | 105 | + logger.info("向上级平台 [ {} ] 注册发生错误: {} ", |
| 106 | parentPlatform.getServerGBId(), | 106 | parentPlatform.getServerGBId(), |
| 107 | event.msg); | 107 | event.msg); |
| 108 | } | 108 | } |
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
| @@ -373,7 +373,8 @@ public class StreamPushServiceImpl implements IStreamPushService { | @@ -373,7 +373,8 @@ public class StreamPushServiceImpl implements IStreamPushService { | ||
| 373 | return; | 373 | return; |
| 374 | } | 374 | } |
| 375 | } | 375 | } |
| 376 | - platformGbStreamMapper.batchAdd(platformId, catalogId, streamPushItems); | 376 | + List<GbStream> gbStreamList = gbStreamMapper.selectAllForAppAndStream(streamPushItems); |
| 377 | + platformGbStreamMapper.batchAdd(platformId, catalogId, gbStreamList); | ||
| 377 | eventPublisher.catalogEventPublishForStream(platformId, streamPushItems.toArray(new GbStream[0]), CatalogEvent.ADD); | 378 | eventPublisher.catalogEventPublishForStream(platformId, streamPushItems.toArray(new GbStream[0]), CatalogEvent.ADD); |
| 378 | } | 379 | } |
| 379 | } | 380 | } |
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java
| @@ -17,7 +17,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus | @@ -17,7 +17,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus | ||
| 17 | private List<StreamPushItem> streamPushItems = new ArrayList<>(); | 17 | private List<StreamPushItem> streamPushItems = new ArrayList<>(); |
| 18 | private Map<String, UploadData> streamPushItemsForPlatform = new HashMap<>(); | 18 | private Map<String, UploadData> streamPushItemsForPlatform = new HashMap<>(); |
| 19 | private Set<String> streamPushStreamSet = new HashSet<>(); | 19 | private Set<String> streamPushStreamSet = new HashSet<>(); |
| 20 | - private Set<String> streamPushGBSet = new HashSet<>(); | 20 | + private Map<String,String> streamPushGBMap = new HashMap<>(); |
| 21 | private List<String> errorStreamList = new ArrayList<>(); | 21 | private List<String> errorStreamList = new ArrayList<>(); |
| 22 | private List<String> errorGBList = new ArrayList<>(); | 22 | private List<String> errorGBList = new ArrayList<>(); |
| 23 | // 读取数量计数器 | 23 | // 读取数量计数器 |
| @@ -50,13 +50,17 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus | @@ -50,13 +50,17 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus | ||
| 50 | || StringUtils.isEmpty(streamPushExcelDto.getGbId())) { | 50 | || StringUtils.isEmpty(streamPushExcelDto.getGbId())) { |
| 51 | return; | 51 | return; |
| 52 | } | 52 | } |
| 53 | - if (streamPushGBSet.contains(streamPushExcelDto.getGbId())) { | ||
| 54 | - errorGBList.add(streamPushExcelDto.getGbId()); | 53 | + if (streamPushGBMap.get(streamPushExcelDto.getApp() + streamPushExcelDto.getStream()) == null) { |
| 54 | + streamPushGBMap.put(streamPushExcelDto.getApp() + streamPushExcelDto.getStream(), streamPushExcelDto.getGbId()); | ||
| 55 | + | ||
| 56 | + }else { | ||
| 57 | + if (!streamPushGBMap.get(streamPushExcelDto.getApp() + streamPushExcelDto.getStream()).equals(streamPushExcelDto.getGbId())) { | ||
| 58 | + errorGBList.add(streamPushExcelDto.getGbId() + "(同一组app+stream使用了不同国标ID)"); | ||
| 59 | + return; | ||
| 60 | + } | ||
| 55 | } | 61 | } |
| 56 | if (streamPushStreamSet.contains(streamPushExcelDto.getApp() + streamPushExcelDto.getStream() + streamPushExcelDto.getPlatformId())) { | 62 | if (streamPushStreamSet.contains(streamPushExcelDto.getApp() + streamPushExcelDto.getStream() + streamPushExcelDto.getPlatformId())) { |
| 57 | - errorStreamList.add(streamPushExcelDto.getApp() + "/" + streamPushExcelDto.getStream()); | ||
| 58 | - } | ||
| 59 | - if (streamPushGBSet.contains(streamPushExcelDto.getGbId()) || streamPushStreamSet.contains(streamPushExcelDto.getApp() + streamPushExcelDto.getStream() + streamPushExcelDto.getPlatformId())) { | 63 | + errorStreamList.add(streamPushExcelDto.getApp() + "/" + streamPushExcelDto.getStream()+ "/" + streamPushExcelDto.getPlatformId() + "(同一组app+stream添加在了同一个平台下)"); |
| 60 | return; | 64 | return; |
| 61 | } | 65 | } |
| 62 | 66 | ||
| @@ -95,8 +99,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus | @@ -95,8 +99,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus | ||
| 95 | 99 | ||
| 96 | } | 100 | } |
| 97 | 101 | ||
| 98 | - streamPushGBSet.add(streamPushExcelDto.getGbId()); | ||
| 99 | - streamPushStreamSet.add(streamPushExcelDto.getApp()+streamPushExcelDto.getStream()); | 102 | + streamPushStreamSet.add(streamPushExcelDto.getApp()+streamPushExcelDto.getStream() + streamPushExcelDto.getPlatformId()); |
| 100 | loadedSize ++; | 103 | loadedSize ++; |
| 101 | if (loadedSize > 1000) { | 104 | if (loadedSize > 1000) { |
| 102 | saveData(); | 105 | saveData(); |
| @@ -111,7 +114,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus | @@ -111,7 +114,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus | ||
| 111 | public void doAfterAllAnalysed(AnalysisContext analysisContext) { | 114 | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| 112 | // 这里也要保存数据,确保最后遗留的数据也存储到数据库 | 115 | // 这里也要保存数据,确保最后遗留的数据也存储到数据库 |
| 113 | saveData(); | 116 | saveData(); |
| 114 | - streamPushGBSet.clear(); | 117 | + streamPushGBMap.clear(); |
| 115 | streamPushStreamSet.clear(); | 118 | streamPushStreamSet.clear(); |
| 116 | errorDataHandler.handle(errorStreamList, errorGBList); | 119 | errorDataHandler.handle(errorStreamList, errorGBList); |
| 117 | } | 120 | } |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
| @@ -86,8 +86,6 @@ public interface DeviceChannelMapper { | @@ -86,8 +86,6 @@ public interface DeviceChannelMapper { | ||
| 86 | @Update(value = {"UPDATE device_channel SET streamId=#{streamId} WHERE deviceId=#{deviceId} AND channelId=#{channelId}"}) | 86 | @Update(value = {"UPDATE device_channel SET streamId=#{streamId} WHERE deviceId=#{deviceId} AND channelId=#{channelId}"}) |
| 87 | void startPlay(String deviceId, String channelId, String streamId); | 87 | void startPlay(String deviceId, String channelId, String streamId); |
| 88 | 88 | ||
| 89 | - | ||
| 90 | - | ||
| 91 | @Select(value = {" <script>" + | 89 | @Select(value = {" <script>" + |
| 92 | "SELECT dc.channelId, "+ | 90 | "SELECT dc.channelId, "+ |
| 93 | "dc.deviceId, " + | 91 | "dc.deviceId, " + |
| @@ -107,7 +105,7 @@ public interface DeviceChannelMapper { | @@ -107,7 +105,7 @@ public interface DeviceChannelMapper { | ||
| 107 | " <if test='online == false' > AND dc.status=0</if> " + | 105 | " <if test='online == false' > AND dc.status=0</if> " + |
| 108 | " <if test='hasSubChannel!= null and hasSubChannel == true' > AND dc2.channelId is not null</if> " + | 106 | " <if test='hasSubChannel!= null and hasSubChannel == true' > AND dc2.channelId is not null</if> " + |
| 109 | " <if test='hasSubChannel!= null and hasSubChannel == false' > AND dc2.channelId is null</if> " + | 107 | " <if test='hasSubChannel!= null and hasSubChannel == false' > AND dc2.channelId is null</if> " + |
| 110 | - " <if test='catalogId == null ' > AND pgc.platformId is null AND pgc.catalogId is null</if> " + | 108 | + " <if test='catalogId == null ' > AND ((pgc.platformId IS NULL AND pgc.catalogId IS NULL) or (pgc.platformId != #{platformId}))</if> " + |
| 111 | " <if test='catalogId != null ' > AND pgc.platformId =#{platformId} AND pgc.catalogId = #{catalogId}</if> " + | 109 | " <if test='catalogId != null ' > AND pgc.platformId =#{platformId} AND pgc.catalogId = #{catalogId}</if> " + |
| 112 | " ORDER BY dc.deviceId, dc.channelId ASC" + | 110 | " ORDER BY dc.deviceId, dc.channelId ASC" + |
| 113 | " </script>"}) | 111 | " </script>"}) |
src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
| @@ -38,12 +38,13 @@ public interface GbStreamMapper { | @@ -38,12 +38,13 @@ public interface GbStreamMapper { | ||
| 38 | int del(String app, String stream); | 38 | int del(String app, String stream); |
| 39 | 39 | ||
| 40 | @Select("<script> "+ | 40 | @Select("<script> "+ |
| 41 | - "SELECT gs.*, pgs.platformId AS platformId, pgs.catalogId AS catalogId FROM gb_stream gs " + | ||
| 42 | - "LEFT JOIN platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " + | 41 | + "SELECT gs.* FROM gb_stream gs " + |
| 43 | "WHERE " + | 42 | "WHERE " + |
| 44 | "1=1 " + | 43 | "1=1 " + |
| 45 | - " <if test='catalogId != null'> AND pgs.platformId = #{platformId} AND pgs.catalogId = #{catalogId}</if> " + | ||
| 46 | - " <if test='catalogId == null'> AND pgs.platformId is null AND pgs.catalogId is null</if> " + | 44 | + " <if test='catalogId != null'> AND gs.id in" + |
| 45 | + "(select pgs.gbStreamId from platform_gb_stream pgs where pgs.platformId = #{platformId} and pgs.catalogId=#{catalogId})</if> " + | ||
| 46 | + " <if test='catalogId == null'> AND gs.id not in" + | ||
| 47 | + "(select pgs.gbStreamId from platform_gb_stream pgs where pgs.platformId = #{platformId}) </if> " + | ||
| 47 | " <if test='query != null'> AND (gs.app LIKE '%${query}%' OR gs.stream LIKE '%${query}%' OR gs.gbId LIKE '%${query}%' OR gs.name LIKE '%${query}%')</if> " + | 48 | " <if test='query != null'> AND (gs.app LIKE '%${query}%' OR gs.stream LIKE '%${query}%' OR gs.gbId LIKE '%${query}%' OR gs.name LIKE '%${query}%')</if> " + |
| 48 | " <if test='pushing == true' > AND gs.status=1</if>" + | 49 | " <if test='pushing == true' > AND gs.status=1</if>" + |
| 49 | " <if test='pushing == false' > AND gs.status=0</if>" + | 50 | " <if test='pushing == false' > AND gs.status=0</if>" + |
| @@ -59,18 +60,18 @@ public interface GbStreamMapper { | @@ -59,18 +60,18 @@ public interface GbStreamMapper { | ||
| 59 | List<GbStream> selectByGBId(String gbId); | 60 | List<GbStream> selectByGBId(String gbId); |
| 60 | 61 | ||
| 61 | @Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " + | 62 | @Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " + |
| 62 | - "LEFT JOIN platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " + | 63 | + "LEFT JOIN platform_gb_stream pgs ON gs.id = pgs.catalogId " + |
| 63 | "WHERE gs.gbId = '${gbId}' AND pgs.platformId = '${platformId}'") | 64 | "WHERE gs.gbId = '${gbId}' AND pgs.platformId = '${platformId}'") |
| 64 | GbStream queryStreamInPlatform(String platformId, String gbId); | 65 | GbStream queryStreamInPlatform(String platformId, String gbId); |
| 65 | 66 | ||
| 66 | @Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " + | 67 | @Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " + |
| 67 | - "LEFT JOIN platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " + | ||
| 68 | - "WHERE pgs.platformId = '${platformId}'") | 68 | + "LEFT JOIN platform_gb_stream pgs ON gs.id = pgs.gbStreamId " + |
| 69 | + "WHERE pgs.platformId = #{platformId}") | ||
| 69 | List<GbStream> queryGbStreamListInPlatform(String platformId); | 70 | List<GbStream> queryGbStreamListInPlatform(String platformId); |
| 70 | 71 | ||
| 71 | 72 | ||
| 72 | - @Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs LEFT JOIN platform_gb_stream pgs " + | ||
| 73 | - "ON gs.app = pgs.app and gs.stream = pgs.stream WHERE pgs.app is NULL and pgs.stream is NULL") | 73 | + @Select("SELECT gs.* FROM gb_stream gs LEFT JOIN platform_gb_stream pgs " + |
| 74 | + "ON gs.id = pgs.gbStreamId WHERE pgs.gbStreamId is NULL") | ||
| 74 | List<GbStream> queryStreamNotInPlatform(); | 75 | List<GbStream> queryStreamNotInPlatform(); |
| 75 | 76 | ||
| 76 | @Update("UPDATE gb_stream " + | 77 | @Update("UPDATE gb_stream " + |
| @@ -124,4 +125,12 @@ public interface GbStreamMapper { | @@ -124,4 +125,12 @@ public interface GbStreamMapper { | ||
| 124 | "</foreach>" + | 125 | "</foreach>" + |
| 125 | "</script>"}) | 126 | "</script>"}) |
| 126 | int updateStreamGPS(List<GPSMsgInfo> gpsMsgInfos); | 127 | int updateStreamGPS(List<GPSMsgInfo> gpsMsgInfos); |
| 128 | + | ||
| 129 | + @Select("<script> "+ | ||
| 130 | + "SELECT * FROM gb_stream where " + | ||
| 131 | + "<foreach collection='streamPushItems' item='item' separator='or'>" + | ||
| 132 | + "(app=#{item.app} and stream=#{item.stream}) " + | ||
| 133 | + "</foreach>" + | ||
| 134 | + "</script>") | ||
| 135 | + List<GbStream> selectAllForAppAndStream(List<StreamPushItem> streamPushItems); | ||
| 127 | } | 136 | } |
src/main/java/com/genersoft/iot/vmp/storager/dao/LogMapper.java
| @@ -21,7 +21,6 @@ public interface LogMapper { | @@ -21,7 +21,6 @@ public interface LogMapper { | ||
| 21 | "values ('${name}', '${type}', '${uri}', '${address}', '${result}', ${timing}, '${username}', '${createTime}')") | 21 | "values ('${name}', '${type}', '${uri}', '${address}', '${result}', ${timing}, '${username}', '${createTime}')") |
| 22 | int add(LogDto logDto); | 22 | int add(LogDto logDto); |
| 23 | 23 | ||
| 24 | - | ||
| 25 | @Select(value = {"<script>" + | 24 | @Select(value = {"<script>" + |
| 26 | " SELECT * FROM log " + | 25 | " SELECT * FROM log " + |
| 27 | " WHERE 1=1 " + | 26 | " WHERE 1=1 " + |
| @@ -33,7 +32,6 @@ public interface LogMapper { | @@ -33,7 +32,6 @@ public interface LogMapper { | ||
| 33 | " </script>"}) | 32 | " </script>"}) |
| 34 | List<LogDto> query(String query, String type, String startTime, String endTime); | 33 | List<LogDto> query(String query, String type, String startTime, String endTime); |
| 35 | 34 | ||
| 36 | - | ||
| 37 | @Delete("DELETE FROM log") | 35 | @Delete("DELETE FROM log") |
| 38 | int clear(); | 36 | int clear(); |
| 39 | } | 37 | } |
src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
| @@ -54,7 +54,11 @@ public interface ParentPlatformMapper { | @@ -54,7 +54,11 @@ public interface ParentPlatformMapper { | ||
| 54 | " +\n" + | 54 | " +\n" + |
| 55 | " (SELECT count(0)\n" + | 55 | " (SELECT count(0)\n" + |
| 56 | " FROM platform_gb_stream pgs\n" + | 56 | " FROM platform_gb_stream pgs\n" + |
| 57 | - " WHERE pgs.platformId = pp.serverGBId)) as channelCount\n" + | 57 | + " WHERE pgs.platformId = pp.serverGBId)\n" + |
| 58 | + " +\n" + | ||
| 59 | + " (SELECT count(0)\n" + | ||
| 60 | + " FROM platform_catalog pgc\n" + | ||
| 61 | + " WHERE pgc.platformId = pp.serverGBId)) as channelCount\n" + | ||
| 58 | "FROM parent_platform pp ") | 62 | "FROM parent_platform pp ") |
| 59 | List<ParentPlatform> getParentPlatformList(); | 63 | List<ParentPlatform> getParentPlatformList(); |
| 60 | 64 |
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
| @@ -34,7 +34,6 @@ public interface PlatformChannelMapper { | @@ -34,7 +34,6 @@ public interface PlatformChannelMapper { | ||
| 34 | "</script>") | 34 | "</script>") |
| 35 | int addChannels(String platformId, List<ChannelReduce> channelReducesToAdd); | 35 | int addChannels(String platformId, List<ChannelReduce> channelReducesToAdd); |
| 36 | 36 | ||
| 37 | - | ||
| 38 | @Delete("<script> "+ | 37 | @Delete("<script> "+ |
| 39 | "DELETE FROM platform_gb_channel WHERE platformId='${platformId}' AND deviceAndChannelId in" + | 38 | "DELETE FROM platform_gb_channel WHERE platformId='${platformId}' AND deviceAndChannelId in" + |
| 40 | "<foreach collection='channelReducesToDel' item='item' open='(' separator=',' close=')' > '${item.deviceId}_${item.channelId}'</foreach>" + | 39 | "<foreach collection='channelReducesToDel' item='item' open='(' separator=',' close=')' > '${item.deviceId}_${item.channelId}'</foreach>" + |
| @@ -51,12 +50,10 @@ public interface PlatformChannelMapper { | @@ -51,12 +50,10 @@ public interface PlatformChannelMapper { | ||
| 51 | "</script>") | 50 | "</script>") |
| 52 | int cleanChannelForGB(String platformId); | 51 | int cleanChannelForGB(String platformId); |
| 53 | 52 | ||
| 54 | - | ||
| 55 | @Select("SELECT * FROM device_channel WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE " + | 53 | @Select("SELECT * FROM device_channel WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE " + |
| 56 | "platformId='${platformId}' AND channelId='${channelId}' ) AND channelId='${channelId}'") | 54 | "platformId='${platformId}' AND channelId='${channelId}' ) AND channelId='${channelId}'") |
| 57 | DeviceChannel queryChannelInParentPlatform(String platformId, String channelId); | 55 | DeviceChannel queryChannelInParentPlatform(String platformId, String channelId); |
| 58 | 56 | ||
| 59 | - | ||
| 60 | @Select("select dc.channelId as id, dc.name as name, pgc.platformId as platformId, pgc.catalogId as parentId, 0 as childrenCount, 1 as type " + | 57 | @Select("select dc.channelId as id, dc.name as name, pgc.platformId as platformId, pgc.catalogId as parentId, 0 as childrenCount, 1 as type " + |
| 61 | "from device_channel dc left join platform_gb_channel pgc on dc.deviceId = pgc.deviceId and dc.channelId = pgc.channelId " + | 58 | "from device_channel dc left join platform_gb_channel pgc on dc.deviceId = pgc.deviceId and dc.channelId = pgc.channelId " + |
| 62 | "where pgc.platformId=#{platformId} and pgc.catalogId=#{catalogId}") | 59 | "where pgc.platformId=#{platformId} and pgc.catalogId=#{catalogId}") |
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
| @@ -16,22 +16,22 @@ import java.util.List; | @@ -16,22 +16,22 @@ import java.util.List; | ||
| 16 | @Repository | 16 | @Repository |
| 17 | public interface PlatformGbStreamMapper { | 17 | public interface PlatformGbStreamMapper { |
| 18 | 18 | ||
| 19 | - @Insert("REPLACE INTO platform_gb_stream (app, stream, platformId, catalogId) VALUES" + | ||
| 20 | - "('${app}', '${stream}', '${platformId}', '${catalogId}')") | 19 | + @Insert("REPLACE INTO platform_gb_stream (gbStreamId, platformId, catalogId) VALUES" + |
| 20 | + "( #{id}, #{platformId}, #{catalogId})") | ||
| 21 | int add(PlatformGbStream platformGbStream); | 21 | int add(PlatformGbStream platformGbStream); |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | @Insert("<script> " + | 24 | @Insert("<script> " + |
| 25 | "REPLACE into platform_gb_stream " + | 25 | "REPLACE into platform_gb_stream " + |
| 26 | - "(app, stream, platformId, catalogId) " + | 26 | + "(gbStreamId, platformId, catalogId) " + |
| 27 | "values " + | 27 | "values " + |
| 28 | "<foreach collection='streamPushItems' index='index' item='item' separator=','> " + | 28 | "<foreach collection='streamPushItems' index='index' item='item' separator=','> " + |
| 29 | - "('${item.app}', '${item.stream}', '${platformId}', '${catalogId}')" + | 29 | + "(#{item.id}, #{platformId}, #{catalogId})" + |
| 30 | "</foreach> " + | 30 | "</foreach> " + |
| 31 | "</script>") | 31 | "</script>") |
| 32 | - int batchAdd(String platformId, String catalogId, List<StreamPushItem> streamPushItems); | 32 | + int batchAdd(String platformId, String catalogId, List<GbStream> streamPushItems); |
| 33 | 33 | ||
| 34 | - @Delete("DELETE FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream}") | 34 | + @Delete("DELETE FROM platform_gb_stream WHERE gbStreamId = (select id from gb_stream where app=#{app} AND stream=#{stream})") |
| 35 | int delByAppAndStream(String app, String stream); | 35 | int delByAppAndStream(String app, String stream); |
| 36 | 36 | ||
| 37 | @Delete("DELETE FROM platform_gb_stream WHERE platformId=#{platformId}") | 37 | @Delete("DELETE FROM platform_gb_stream WHERE platformId=#{platformId}") |
| @@ -42,27 +42,28 @@ public interface PlatformGbStreamMapper { | @@ -42,27 +42,28 @@ public interface PlatformGbStreamMapper { | ||
| 42 | "FROM " + | 42 | "FROM " + |
| 43 | "platform_gb_stream pgs " + | 43 | "platform_gb_stream pgs " + |
| 44 | "LEFT JOIN parent_platform pp ON pp.serverGBId = pgs.platformId " + | 44 | "LEFT JOIN parent_platform pp ON pp.serverGBId = pgs.platformId " + |
| 45 | + "LEFT JOIN gb_stream gs ON gs.id = pgs.gbStreamId " + | ||
| 45 | "WHERE " + | 46 | "WHERE " + |
| 46 | - "pgs.app =#{app} " + | ||
| 47 | - "AND pgs.stream =#{stream} ") | 47 | + "gs.app =#{app} " + |
| 48 | + "AND gs.stream =#{stream} ") | ||
| 48 | List<ParentPlatform> selectByAppAndStream(String app, String stream); | 49 | List<ParentPlatform> selectByAppAndStream(String app, String stream); |
| 49 | 50 | ||
| 50 | @Select("SELECT pgs.*, gs.gbId FROM platform_gb_stream pgs " + | 51 | @Select("SELECT pgs.*, gs.gbId FROM platform_gb_stream pgs " + |
| 51 | - "LEFT JOIN gb_stream gs ON pgs.app = gs.app AND pgs.stream = gs.stream " + | ||
| 52 | - "WHERE pgs.app=#{app} AND pgs.stream=#{stream} AND pgs.platformId=#{serverGBId}") | 52 | + "LEFT JOIN gb_stream gs ON pgs.gbStreamId = gs.id " + |
| 53 | + "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platformId=#{serverGBId}") | ||
| 53 | StreamProxyItem selectOne(String app, String stream, String serverGBId); | 54 | StreamProxyItem selectOne(String app, String stream, String serverGBId); |
| 54 | 55 | ||
| 55 | @Select("select gs.* \n" + | 56 | @Select("select gs.* \n" + |
| 56 | "from gb_stream gs\n" + | 57 | "from gb_stream gs\n" + |
| 57 | " left join platform_gb_stream pgs\n" + | 58 | " left join platform_gb_stream pgs\n" + |
| 58 | - " on gs.app = pgs.app and gs.stream = pgs.stream\n" + | 59 | + " on gs.id = pgs.gbStreamId\n" + |
| 59 | "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}") | 60 | "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}") |
| 60 | List<GbStream> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId); | 61 | List<GbStream> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId); |
| 61 | 62 | ||
| 62 | @Select("select gs.gbId as id, gs.name as name, pgs.platformId as platformId, pgs.catalogId as catalogId , 0 as childrenCount, 2 as type\n" + | 63 | @Select("select gs.gbId as id, gs.name as name, pgs.platformId as platformId, pgs.catalogId as catalogId , 0 as childrenCount, 2 as type\n" + |
| 63 | "from gb_stream gs\n" + | 64 | "from gb_stream gs\n" + |
| 64 | " left join platform_gb_stream pgs\n" + | 65 | " left join platform_gb_stream pgs\n" + |
| 65 | - " on gs.app = pgs.app and gs.stream = pgs.stream\n" + | 66 | + " on gs.id = pgs.gbStreamId\n" + |
| 66 | "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}") | 67 | "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}") |
| 67 | List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId); | 68 | List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId); |
| 68 | 69 | ||
| @@ -76,29 +77,31 @@ public interface PlatformGbStreamMapper { | @@ -76,29 +77,31 @@ public interface PlatformGbStreamMapper { | ||
| 76 | "parent_platform pp " + | 77 | "parent_platform pp " + |
| 77 | "left join platform_gb_stream pgs on " + | 78 | "left join platform_gb_stream pgs on " + |
| 78 | "pp.serverGBId = pgs.platformId " + | 79 | "pp.serverGBId = pgs.platformId " + |
| 80 | + "left join gb_stream gs " + | ||
| 81 | + "gs.id = pgs.gbStreamId " + | ||
| 79 | "WHERE " + | 82 | "WHERE " + |
| 80 | - "pgs.app = #{app} " + | ||
| 81 | - "AND pgs.stream = #{stream}" + | 83 | + "gs.app = #{app} " + |
| 84 | + "AND gs.stream = #{stream}" + | ||
| 82 | "AND pp.serverGBId IN" + | 85 | "AND pp.serverGBId IN" + |
| 83 | "<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + | 86 | "<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + |
| 84 | "</script> ") | 87 | "</script> ") |
| 85 | List<ParentPlatform> queryPlatFormListForGBWithGBId(String app, String stream, List<String> platforms); | 88 | List<ParentPlatform> queryPlatFormListForGBWithGBId(String app, String stream, List<String> platforms); |
| 86 | 89 | ||
| 87 | - @Delete("DELETE FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream} AND platformId=#{platformId}") | 90 | + @Delete("DELETE FROM platform_gb_stream WHERE gbStreamId = (select id from gb_stream where app=#{app} AND stream=#{stream}) AND platformId=#{platformId}") |
| 88 | int delByAppAndStreamAndPlatform(String app, String stream, String platformId); | 91 | int delByAppAndStreamAndPlatform(String app, String stream, String platformId); |
| 89 | 92 | ||
| 90 | @Delete("<script> "+ | 93 | @Delete("<script> "+ |
| 91 | - "DELETE FROM platform_gb_stream where " + | ||
| 92 | - "<foreach collection='gbStreams' item='item' separator='or'>" + | ||
| 93 | - "(app=#{item.app} and stream=#{item.stream}) " + | 94 | + "DELETE FROM platform_gb_stream where gbStreamId in " + |
| 95 | + "<foreach collection='gbStreams' item='item' open='(' separator=',' close=')' >" + | ||
| 96 | + "#{item.id}" + | ||
| 94 | "</foreach>" + | 97 | "</foreach>" + |
| 95 | "</script>") | 98 | "</script>") |
| 96 | void delByGbStreams(List<GbStream> gbStreams); | 99 | void delByGbStreams(List<GbStream> gbStreams); |
| 97 | 100 | ||
| 98 | @Delete("<script> "+ | 101 | @Delete("<script> "+ |
| 99 | - "DELETE FROM platform_gb_stream where " + | ||
| 100 | - "<foreach collection='gbStreams' item='item' separator='or'>" + | ||
| 101 | - "(app=#{item.app} and stream=#{item.stream}) and platformId=#{platformId}" + | 102 | + "DELETE FROM platform_gb_stream where platformId=#{platformId} and gbStreamId in " + |
| 103 | + "<foreach collection='gbStreams' item='item' open='(' separator=',' close=')'>" + | ||
| 104 | + "#{item.id} " + | ||
| 102 | "</foreach>" + | 105 | "</foreach>" + |
| 103 | "</script>") | 106 | "</script>") |
| 104 | void delByAppAndStreamsByPlatformId(List<GbStream> gbStreams, String platformId); | 107 | void delByAppAndStreamsByPlatformId(List<GbStream> gbStreams, String platformId); |
src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java
| @@ -61,7 +61,7 @@ public interface StreamPushMapper { | @@ -61,7 +61,7 @@ public interface StreamPushMapper { | ||
| 61 | @Select(value = {" <script>" + | 61 | @Select(value = {" <script>" + |
| 62 | "SELECT " + | 62 | "SELECT " + |
| 63 | "st.*, " + | 63 | "st.*, " + |
| 64 | - "pgs.gbId, pgs.status, pgs.name, pgs.longitude, pgs.latitude " + | 64 | + "pgs.gbId, pgs.status, pgs.name, pgs.longitude, pgs.latitude , pgs.id " + |
| 65 | "from " + | 65 | "from " + |
| 66 | "stream_push st " + | 66 | "stream_push st " + |
| 67 | "LEFT JOIN gb_stream pgs " + | 67 | "LEFT JOIN gb_stream pgs " + |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
| @@ -705,9 +705,18 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { | @@ -705,9 +705,18 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { | ||
| 705 | streamProxyItem.setCreateTime(now); | 705 | streamProxyItem.setCreateTime(now); |
| 706 | streamProxyItem.setCreateStamp(System.currentTimeMillis()); | 706 | streamProxyItem.setCreateStamp(System.currentTimeMillis()); |
| 707 | try { | 707 | try { |
| 708 | - if (gbStreamMapper.add(streamProxyItem)<0 || streamProxyMapper.add(streamProxyItem) < 0) { | 708 | + if (streamProxyMapper.add(streamProxyItem) > 0) { |
| 709 | + if (!StringUtils.isEmpty(streamProxyItem.getGbId())) { | ||
| 710 | + if (gbStreamMapper.add(streamProxyItem) > 0) { | ||
| 711 | + //事务回滚 | ||
| 712 | + dataSourceTransactionManager.rollback(transactionStatus); | ||
| 713 | + return false; | ||
| 714 | + } | ||
| 715 | + } | ||
| 716 | + }else { | ||
| 709 | //事务回滚 | 717 | //事务回滚 |
| 710 | dataSourceTransactionManager.rollback(transactionStatus); | 718 | dataSourceTransactionManager.rollback(transactionStatus); |
| 719 | + return false; | ||
| 711 | } | 720 | } |
| 712 | result = true; | 721 | result = true; |
| 713 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 | 722 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| @@ -731,10 +740,20 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { | @@ -731,10 +740,20 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { | ||
| 731 | boolean result = false; | 740 | boolean result = false; |
| 732 | streamProxyItem.setStreamType("proxy"); | 741 | streamProxyItem.setStreamType("proxy"); |
| 733 | try { | 742 | try { |
| 734 | - if (gbStreamMapper.update(streamProxyItem)<0 || streamProxyMapper.update(streamProxyItem) < 0) { | 743 | + if (streamProxyMapper.update(streamProxyItem) > 0) { |
| 744 | + if (!StringUtils.isEmpty(streamProxyItem.getGbId())) { | ||
| 745 | + if (gbStreamMapper.update(streamProxyItem) > 0) { | ||
| 746 | + //事务回滚 | ||
| 747 | + dataSourceTransactionManager.rollback(transactionStatus); | ||
| 748 | + return false; | ||
| 749 | + } | ||
| 750 | + } | ||
| 751 | + }else { | ||
| 735 | //事务回滚 | 752 | //事务回滚 |
| 736 | dataSourceTransactionManager.rollback(transactionStatus); | 753 | dataSourceTransactionManager.rollback(transactionStatus); |
| 754 | + return false; | ||
| 737 | } | 755 | } |
| 756 | + | ||
| 738 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 | 757 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| 739 | result = true; | 758 | result = true; |
| 740 | }catch (Exception e) { | 759 | }catch (Exception e) { |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java
| @@ -67,6 +67,8 @@ public class GbStreamController { | @@ -67,6 +67,8 @@ public class GbStreamController { | ||
| 67 | mediaServerId = null; | 67 | mediaServerId = null; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | + // catalogId 为null 查询未在平台下分配的数据 | ||
| 71 | + // catalogId 不为null 查询平台下这个,目录下的通道 | ||
| 70 | return gbStreamService.getAll(page, count, platformId, catalogId, query, pushing, mediaServerId); | 72 | return gbStreamService.getAll(page, count, platformId, catalogId, query, pushing, mediaServerId); |
| 71 | } | 73 | } |
| 72 | 74 |
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
| @@ -71,6 +71,7 @@ public class StreamProxyController { | @@ -71,6 +71,7 @@ public class StreamProxyController { | ||
| 71 | logger.info("添加代理: " + JSONObject.toJSONString(param)); | 71 | logger.info("添加代理: " + JSONObject.toJSONString(param)); |
| 72 | if (StringUtils.isEmpty(param.getMediaServerId())) param.setMediaServerId("auto"); | 72 | if (StringUtils.isEmpty(param.getMediaServerId())) param.setMediaServerId("auto"); |
| 73 | if (StringUtils.isEmpty(param.getType())) param.setType("default"); | 73 | if (StringUtils.isEmpty(param.getType())) param.setType("default"); |
| 74 | + if (StringUtils.isEmpty(param.getGbId())) param.setGbId(null); | ||
| 74 | WVPResult<StreamInfo> result = streamProxyService.save(param); | 75 | WVPResult<StreamInfo> result = streamProxyService.save(param); |
| 75 | return result; | 76 | return result; |
| 76 | } | 77 | } |
web_src/src/components/dialog/chooseChannelForGb.vue
| @@ -43,8 +43,8 @@ | @@ -43,8 +43,8 @@ | ||
| 43 | <el-table-column label="操作" width="100" align="center" fixed="right"> | 43 | <el-table-column label="操作" width="100" align="center" fixed="right"> |
| 44 | <template slot-scope="scope"> | 44 | <template slot-scope="scope"> |
| 45 | <el-button-group> | 45 | <el-button-group> |
| 46 | - <el-button size="mini" icon="el-icon-plus" v-if="!scope.row.platformId" @click="add(scope.row)">添加</el-button> | ||
| 47 | - <el-button size="mini" icon="el-icon-delete" v-if="scope.row.platformId" type="danger" @click="remove(scope.row)">移除</el-button> | 46 | + <el-button size="mini" icon="el-icon-plus" v-if="catalogId === null" @click="add(scope.row)">添加</el-button> |
| 47 | + <el-button size="mini" icon="el-icon-delete" v-if="catalogId !== null" type="danger" @click="remove(scope.row)">移除</el-button> | ||
| 48 | </el-button-group> | 48 | </el-button-group> |
| 49 | </template> | 49 | </template> |
| 50 | </el-table-column> | 50 | </el-table-column> |
web_src/src/components/dialog/chooseChannelForStream.vue
| @@ -47,8 +47,8 @@ | @@ -47,8 +47,8 @@ | ||
| 47 | <el-table-column label="操作" width="100" align="center" fixed="right" > | 47 | <el-table-column label="操作" width="100" align="center" fixed="right" > |
| 48 | <template slot-scope="scope"> | 48 | <template slot-scope="scope"> |
| 49 | <el-button-group> | 49 | <el-button-group> |
| 50 | - <el-button size="mini" icon="el-icon-plus" v-if="!scope.row.platformId" @click="add(scope.row, scope)">添加</el-button> | ||
| 51 | - <el-button size="mini" icon="el-icon-delete" v-if="scope.row.platformId" type="danger" @click="remove(scope.row, scope)">移除</el-button> | 50 | + <el-button size="mini" icon="el-icon-plus" v-if="catalogId === null" @click="add(scope.row, scope)">添加</el-button> |
| 51 | + <el-button size="mini" icon="el-icon-delete" v-if="catalogId !== null" type="danger" @click="remove(scope.row, scope)">移除</el-button> | ||
| 52 | </el-button-group> | 52 | </el-button-group> |
| 53 | </template> | 53 | </template> |
| 54 | </el-table-column> | 54 | </el-table-column> |
| @@ -76,6 +76,7 @@ export default { | @@ -76,6 +76,7 @@ export default { | ||
| 76 | props: ['platformId', 'catalogId', 'catalogName'], | 76 | props: ['platformId', 'catalogId', 'catalogName'], |
| 77 | created() { | 77 | created() { |
| 78 | this.initData(); | 78 | this.initData(); |
| 79 | + console.log(this.catalogId) | ||
| 79 | }, | 80 | }, |
| 80 | components: { | 81 | components: { |
| 81 | getCatalog, | 82 | getCatalog, |