Commit 9d37b411ec6f0eea32b7d659d62f31bee4d93dbb
Committed by
GitHub
Merge pull request #375 from MeBetterMan/wvp-28181-2.0
修改3个小bug
Showing
3 changed files
with
93 additions
and
76 deletions
Too many changes to show.
To preserve performance only 3 of 5 files are displayed.
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
| @@ -717,7 +717,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { | @@ -717,7 +717,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { | ||
| 717 | try { | 717 | try { |
| 718 | if (streamProxyMapper.add(streamProxyItem) > 0) { | 718 | if (streamProxyMapper.add(streamProxyItem) > 0) { |
| 719 | if (!StringUtils.isEmpty(streamProxyItem.getGbId())) { | 719 | if (!StringUtils.isEmpty(streamProxyItem.getGbId())) { |
| 720 | - if (gbStreamMapper.add(streamProxyItem) > 0) { | 720 | + if (gbStreamMapper.add(streamProxyItem) < 0) { |
| 721 | //事务回滚 | 721 | //事务回滚 |
| 722 | dataSourceTransactionManager.rollback(transactionStatus); | 722 | dataSourceTransactionManager.rollback(transactionStatus); |
| 723 | return false; | 723 | return false; |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
| @@ -48,11 +48,12 @@ public class PlatformController { | @@ -48,11 +48,12 @@ public class PlatformController { | ||
| 48 | @Autowired | 48 | @Autowired |
| 49 | private ISIPCommanderForPlatform commanderForPlatform; | 49 | private ISIPCommanderForPlatform commanderForPlatform; |
| 50 | 50 | ||
| 51 | - @Autowired | ||
| 52 | - private SipConfig sipConfig; | 51 | + @Autowired |
| 52 | + private SipConfig sipConfig; | ||
| 53 | 53 | ||
| 54 | /** | 54 | /** |
| 55 | * 获取国标服务的配置 | 55 | * 获取国标服务的配置 |
| 56 | + * | ||
| 56 | * @return | 57 | * @return |
| 57 | */ | 58 | */ |
| 58 | @ApiOperation("获取国标服务的配置") | 59 | @ApiOperation("获取国标服务的配置") |
| @@ -65,8 +66,10 @@ public class PlatformController { | @@ -65,8 +66,10 @@ public class PlatformController { | ||
| 65 | result.put("password", sipConfig.getPassword()); | 66 | result.put("password", sipConfig.getPassword()); |
| 66 | return new ResponseEntity<>(result, HttpStatus.OK); | 67 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 67 | } | 68 | } |
| 69 | + | ||
| 68 | /** | 70 | /** |
| 69 | * 获取级联服务器信息 | 71 | * 获取级联服务器信息 |
| 72 | + * | ||
| 70 | * @return | 73 | * @return |
| 71 | */ | 74 | */ |
| 72 | @ApiOperation("获取国标服务的配置") | 75 | @ApiOperation("获取国标服务的配置") |
| @@ -78,7 +81,7 @@ public class PlatformController { | @@ -78,7 +81,7 @@ public class PlatformController { | ||
| 78 | wvpResult.setCode(0); | 81 | wvpResult.setCode(0); |
| 79 | wvpResult.setMsg("success"); | 82 | wvpResult.setMsg("success"); |
| 80 | wvpResult.setData(parentPlatform); | 83 | wvpResult.setData(parentPlatform); |
| 81 | - }else { | 84 | + } else { |
| 82 | wvpResult.setCode(-1); | 85 | wvpResult.setCode(-1); |
| 83 | wvpResult.setMsg("未查询到此平台"); | 86 | wvpResult.setMsg("未查询到此平台"); |
| 84 | } | 87 | } |
| @@ -87,7 +90,8 @@ public class PlatformController { | @@ -87,7 +90,8 @@ public class PlatformController { | ||
| 87 | 90 | ||
| 88 | /** | 91 | /** |
| 89 | * 分页查询级联平台 | 92 | * 分页查询级联平台 |
| 90 | - * @param page 当前页 | 93 | + * |
| 94 | + * @param page 当前页 | ||
| 91 | * @param count 每页条数 | 95 | * @param count 每页条数 |
| 92 | * @return | 96 | * @return |
| 93 | */ | 97 | */ |
| @@ -97,7 +101,7 @@ public class PlatformController { | @@ -97,7 +101,7 @@ public class PlatformController { | ||
| 97 | @ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class), | 101 | @ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class), |
| 98 | @ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class), | 102 | @ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class), |
| 99 | }) | 103 | }) |
| 100 | - public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){ | 104 | + public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count) { |
| 101 | 105 | ||
| 102 | // if (logger.isDebugEnabled()) { | 106 | // if (logger.isDebugEnabled()) { |
| 103 | // logger.debug("查询所有上级设备API调用"); | 107 | // logger.debug("查询所有上级设备API调用"); |
| @@ -107,6 +111,7 @@ public class PlatformController { | @@ -107,6 +111,7 @@ public class PlatformController { | ||
| 107 | 111 | ||
| 108 | /** | 112 | /** |
| 109 | * 添加上级平台信息 | 113 | * 添加上级平台信息 |
| 114 | + * | ||
| 110 | * @param parentPlatform | 115 | * @param parentPlatform |
| 111 | * @return | 116 | * @return |
| 112 | */ | 117 | */ |
| @@ -116,28 +121,28 @@ public class PlatformController { | @@ -116,28 +121,28 @@ public class PlatformController { | ||
| 116 | }) | 121 | }) |
| 117 | @PostMapping("/add") | 122 | @PostMapping("/add") |
| 118 | @ResponseBody | 123 | @ResponseBody |
| 119 | - public ResponseEntity<WVPResult<String>> addPlatform(@RequestBody ParentPlatform parentPlatform){ | 124 | + public ResponseEntity<WVPResult<String>> addPlatform(@RequestBody ParentPlatform parentPlatform) { |
| 120 | 125 | ||
| 121 | if (logger.isDebugEnabled()) { | 126 | if (logger.isDebugEnabled()) { |
| 122 | logger.debug("保存上级平台信息API调用"); | 127 | logger.debug("保存上级平台信息API调用"); |
| 123 | } | 128 | } |
| 124 | WVPResult<String> wvpResult = new WVPResult<>(); | 129 | WVPResult<String> wvpResult = new WVPResult<>(); |
| 125 | if (StringUtils.isEmpty(parentPlatform.getName()) | 130 | if (StringUtils.isEmpty(parentPlatform.getName()) |
| 126 | - ||StringUtils.isEmpty(parentPlatform.getServerGBId()) | ||
| 127 | - ||StringUtils.isEmpty(parentPlatform.getServerGBDomain()) | ||
| 128 | - ||StringUtils.isEmpty(parentPlatform.getServerIP()) | ||
| 129 | - ||StringUtils.isEmpty(parentPlatform.getServerPort()) | ||
| 130 | - ||StringUtils.isEmpty(parentPlatform.getDeviceGBId()) | ||
| 131 | - ||StringUtils.isEmpty(parentPlatform.getExpires()) | ||
| 132 | - ||StringUtils.isEmpty(parentPlatform.getKeepTimeout()) | ||
| 133 | - ||StringUtils.isEmpty(parentPlatform.getTransport()) | ||
| 134 | - ||StringUtils.isEmpty(parentPlatform.getCharacterSet()) | ||
| 135 | - ){ | 131 | + || StringUtils.isEmpty(parentPlatform.getServerGBId()) |
| 132 | + || StringUtils.isEmpty(parentPlatform.getServerGBDomain()) | ||
| 133 | + || StringUtils.isEmpty(parentPlatform.getServerIP()) | ||
| 134 | + || StringUtils.isEmpty(parentPlatform.getServerPort()) | ||
| 135 | + || StringUtils.isEmpty(parentPlatform.getDeviceGBId()) | ||
| 136 | + || StringUtils.isEmpty(parentPlatform.getExpires()) | ||
| 137 | + || StringUtils.isEmpty(parentPlatform.getKeepTimeout()) | ||
| 138 | + || StringUtils.isEmpty(parentPlatform.getTransport()) | ||
| 139 | + || StringUtils.isEmpty(parentPlatform.getCharacterSet()) | ||
| 140 | + ) { | ||
| 136 | wvpResult.setCode(-1); | 141 | wvpResult.setCode(-1); |
| 137 | wvpResult.setMsg("missing parameters"); | 142 | wvpResult.setMsg("missing parameters"); |
| 138 | return new ResponseEntity<>(wvpResult, HttpStatus.BAD_REQUEST); | 143 | return new ResponseEntity<>(wvpResult, HttpStatus.BAD_REQUEST); |
| 139 | } | 144 | } |
| 140 | - if (parentPlatform.getServerPort()< 0 || parentPlatform.getServerPort() > 65535){ | 145 | + if (parentPlatform.getServerPort() < 0 || parentPlatform.getServerPort() > 65535) { |
| 141 | wvpResult.setCode(-1); | 146 | wvpResult.setCode(-1); |
| 142 | wvpResult.setMsg("error severPort"); | 147 | wvpResult.setMsg("error severPort"); |
| 143 | return new ResponseEntity<>(wvpResult, HttpStatus.BAD_REQUEST); | 148 | return new ResponseEntity<>(wvpResult, HttpStatus.BAD_REQUEST); |
| @@ -146,7 +151,7 @@ public class PlatformController { | @@ -146,7 +151,7 @@ public class PlatformController { | ||
| 146 | ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId()); | 151 | ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId()); |
| 147 | if (parentPlatformOld != null) { | 152 | if (parentPlatformOld != null) { |
| 148 | wvpResult.setCode(-1); | 153 | wvpResult.setCode(-1); |
| 149 | - wvpResult.setMsg("平台 "+parentPlatform.getServerGBId()+" 已存在"); | 154 | + wvpResult.setMsg("平台 " + parentPlatform.getServerGBId() + " 已存在"); |
| 150 | return new ResponseEntity<>(wvpResult, HttpStatus.OK); | 155 | return new ResponseEntity<>(wvpResult, HttpStatus.OK); |
| 151 | } | 156 | } |
| 152 | boolean updateResult = storager.updateParentPlatform(parentPlatform); | 157 | boolean updateResult = storager.updateParentPlatform(parentPlatform); |
| @@ -154,17 +159,17 @@ public class PlatformController { | @@ -154,17 +159,17 @@ public class PlatformController { | ||
| 154 | if (updateResult) { | 159 | if (updateResult) { |
| 155 | // 保存时启用就发送注册 | 160 | // 保存时启用就发送注册 |
| 156 | if (parentPlatform.isEnable()) { | 161 | if (parentPlatform.isEnable()) { |
| 157 | - if (parentPlatformOld.isStatus()) { | 162 | + if (parentPlatformOld != null && parentPlatformOld.isStatus()) { |
| 158 | commanderForPlatform.unregister(parentPlatformOld, null, eventResult -> { | 163 | commanderForPlatform.unregister(parentPlatformOld, null, eventResult -> { |
| 159 | // 只要保存就发送注册 | 164 | // 只要保存就发送注册 |
| 160 | commanderForPlatform.register(parentPlatform, null, null); | 165 | commanderForPlatform.register(parentPlatform, null, null); |
| 161 | }); | 166 | }); |
| 162 | - }else { | 167 | + } else { |
| 163 | // 只要保存就发送注册 | 168 | // 只要保存就发送注册 |
| 164 | commanderForPlatform.register(parentPlatform, null, null); | 169 | commanderForPlatform.register(parentPlatform, null, null); |
| 165 | } | 170 | } |
| 166 | 171 | ||
| 167 | - } else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()){ // 关闭启用时注销 | 172 | + } else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()) { // 关闭启用时注销 |
| 168 | commanderForPlatform.unregister(parentPlatform, null, null); | 173 | commanderForPlatform.unregister(parentPlatform, null, null); |
| 169 | } | 174 | } |
| 170 | wvpResult.setCode(0); | 175 | wvpResult.setCode(0); |
| @@ -179,6 +184,7 @@ public class PlatformController { | @@ -179,6 +184,7 @@ public class PlatformController { | ||
| 179 | 184 | ||
| 180 | /** | 185 | /** |
| 181 | * 保存上级平台信息 | 186 | * 保存上级平台信息 |
| 187 | + * | ||
| 182 | * @param parentPlatform | 188 | * @param parentPlatform |
| 183 | * @return | 189 | * @return |
| 184 | */ | 190 | */ |
| @@ -188,23 +194,23 @@ public class PlatformController { | @@ -188,23 +194,23 @@ public class PlatformController { | ||
| 188 | }) | 194 | }) |
| 189 | @PostMapping("/save") | 195 | @PostMapping("/save") |
| 190 | @ResponseBody | 196 | @ResponseBody |
| 191 | - public ResponseEntity<WVPResult<String>> savePlatform(@RequestBody ParentPlatform parentPlatform){ | 197 | + public ResponseEntity<WVPResult<String>> savePlatform(@RequestBody ParentPlatform parentPlatform) { |
| 192 | 198 | ||
| 193 | if (logger.isDebugEnabled()) { | 199 | if (logger.isDebugEnabled()) { |
| 194 | logger.debug("保存上级平台信息API调用"); | 200 | logger.debug("保存上级平台信息API调用"); |
| 195 | } | 201 | } |
| 196 | WVPResult<String> wvpResult = new WVPResult<>(); | 202 | WVPResult<String> wvpResult = new WVPResult<>(); |
| 197 | if (StringUtils.isEmpty(parentPlatform.getName()) | 203 | if (StringUtils.isEmpty(parentPlatform.getName()) |
| 198 | - ||StringUtils.isEmpty(parentPlatform.getServerGBId()) | ||
| 199 | - ||StringUtils.isEmpty(parentPlatform.getServerGBDomain()) | ||
| 200 | - ||StringUtils.isEmpty(parentPlatform.getServerIP()) | ||
| 201 | - ||StringUtils.isEmpty(parentPlatform.getServerPort()) | ||
| 202 | - ||StringUtils.isEmpty(parentPlatform.getDeviceGBId()) | ||
| 203 | - ||StringUtils.isEmpty(parentPlatform.getExpires()) | ||
| 204 | - ||StringUtils.isEmpty(parentPlatform.getKeepTimeout()) | ||
| 205 | - ||StringUtils.isEmpty(parentPlatform.getTransport()) | ||
| 206 | - ||StringUtils.isEmpty(parentPlatform.getCharacterSet()) | ||
| 207 | - ){ | 204 | + || StringUtils.isEmpty(parentPlatform.getServerGBId()) |
| 205 | + || StringUtils.isEmpty(parentPlatform.getServerGBDomain()) | ||
| 206 | + || StringUtils.isEmpty(parentPlatform.getServerIP()) | ||
| 207 | + || StringUtils.isEmpty(parentPlatform.getServerPort()) | ||
| 208 | + || StringUtils.isEmpty(parentPlatform.getDeviceGBId()) | ||
| 209 | + || StringUtils.isEmpty(parentPlatform.getExpires()) | ||
| 210 | + || StringUtils.isEmpty(parentPlatform.getKeepTimeout()) | ||
| 211 | + || StringUtils.isEmpty(parentPlatform.getTransport()) | ||
| 212 | + || StringUtils.isEmpty(parentPlatform.getCharacterSet()) | ||
| 213 | + ) { | ||
| 208 | wvpResult.setCode(-1); | 214 | wvpResult.setCode(-1); |
| 209 | wvpResult.setMsg("missing parameters"); | 215 | wvpResult.setMsg("missing parameters"); |
| 210 | return new ResponseEntity<>(wvpResult, HttpStatus.BAD_REQUEST); | 216 | return new ResponseEntity<>(wvpResult, HttpStatus.BAD_REQUEST); |
| @@ -225,11 +231,11 @@ public class PlatformController { | @@ -225,11 +231,11 @@ public class PlatformController { | ||
| 225 | } | 231 | } |
| 226 | // 只要保存就发送注册 | 232 | // 只要保存就发送注册 |
| 227 | commanderForPlatform.register(parentPlatform, null, null); | 233 | commanderForPlatform.register(parentPlatform, null, null); |
| 228 | - }else { | 234 | + } else { |
| 229 | // 只要保存就发送注册 | 235 | // 只要保存就发送注册 |
| 230 | commanderForPlatform.register(parentPlatform, null, null); | 236 | commanderForPlatform.register(parentPlatform, null, null); |
| 231 | } | 237 | } |
| 232 | - } else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()){ // 关闭启用时注销 | 238 | + } else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()) { // 关闭启用时注销 |
| 233 | commanderForPlatform.unregister(parentPlatformOld, null, null); | 239 | commanderForPlatform.unregister(parentPlatformOld, null, null); |
| 234 | } | 240 | } |
| 235 | wvpResult.setCode(0); | 241 | wvpResult.setCode(0); |
| @@ -244,7 +250,8 @@ public class PlatformController { | @@ -244,7 +250,8 @@ public class PlatformController { | ||
| 244 | 250 | ||
| 245 | /** | 251 | /** |
| 246 | * 删除上级平台 | 252 | * 删除上级平台 |
| 247 | - * @param serverGBId 上级平台国标ID | 253 | + * |
| 254 | + * @param serverGBId 上级平台国标ID | ||
| 248 | * @return | 255 | * @return |
| 249 | */ | 256 | */ |
| 250 | @ApiOperation("删除上级平台") | 257 | @ApiOperation("删除上级平台") |
| @@ -253,13 +260,13 @@ public class PlatformController { | @@ -253,13 +260,13 @@ public class PlatformController { | ||
| 253 | }) | 260 | }) |
| 254 | @DeleteMapping("/delete/{serverGBId}") | 261 | @DeleteMapping("/delete/{serverGBId}") |
| 255 | @ResponseBody | 262 | @ResponseBody |
| 256 | - public ResponseEntity<String> deletePlatform(@PathVariable String serverGBId){ | 263 | + public ResponseEntity<String> deletePlatform(@PathVariable String serverGBId) { |
| 257 | 264 | ||
| 258 | if (logger.isDebugEnabled()) { | 265 | if (logger.isDebugEnabled()) { |
| 259 | logger.debug("删除上级平台API调用"); | 266 | logger.debug("删除上级平台API调用"); |
| 260 | } | 267 | } |
| 261 | if (StringUtils.isEmpty(serverGBId) | 268 | if (StringUtils.isEmpty(serverGBId) |
| 262 | - ){ | 269 | + ) { |
| 263 | return new ResponseEntity<>("missing parameters", HttpStatus.BAD_REQUEST); | 270 | return new ResponseEntity<>("missing parameters", HttpStatus.BAD_REQUEST); |
| 264 | } | 271 | } |
| 265 | ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId); | 272 | ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId); |
| @@ -284,13 +291,14 @@ public class PlatformController { | @@ -284,13 +291,14 @@ public class PlatformController { | ||
| 284 | 291 | ||
| 285 | if (deleteResult) { | 292 | if (deleteResult) { |
| 286 | return new ResponseEntity<>("success", HttpStatus.OK); | 293 | return new ResponseEntity<>("success", HttpStatus.OK); |
| 287 | - }else { | 294 | + } else { |
| 288 | return new ResponseEntity<>("fail", HttpStatus.OK); | 295 | return new ResponseEntity<>("fail", HttpStatus.OK); |
| 289 | } | 296 | } |
| 290 | } | 297 | } |
| 291 | 298 | ||
| 292 | /** | 299 | /** |
| 293 | * 查询上级平台是否存在 | 300 | * 查询上级平台是否存在 |
| 301 | + * | ||
| 294 | * @param serverGBId 上级平台国标ID | 302 | * @param serverGBId 上级平台国标ID |
| 295 | * @return | 303 | * @return |
| 296 | */ | 304 | */ |
| @@ -300,7 +308,7 @@ public class PlatformController { | @@ -300,7 +308,7 @@ public class PlatformController { | ||
| 300 | }) | 308 | }) |
| 301 | @GetMapping("/exit/{serverGBId}") | 309 | @GetMapping("/exit/{serverGBId}") |
| 302 | @ResponseBody | 310 | @ResponseBody |
| 303 | - public ResponseEntity<String> exitPlatform(@PathVariable String serverGBId){ | 311 | + public ResponseEntity<String> exitPlatform(@PathVariable String serverGBId) { |
| 304 | 312 | ||
| 305 | // if (logger.isDebugEnabled()) { | 313 | // if (logger.isDebugEnabled()) { |
| 306 | // logger.debug("查询上级平台是否存在API调用:" + serverGBId); | 314 | // logger.debug("查询上级平台是否存在API调用:" + serverGBId); |
| @@ -311,12 +319,13 @@ public class PlatformController { | @@ -311,12 +319,13 @@ public class PlatformController { | ||
| 311 | 319 | ||
| 312 | /** | 320 | /** |
| 313 | * 分页查询级联平台的所有所有通道 | 321 | * 分页查询级联平台的所有所有通道 |
| 314 | - * @param page 当前页 | ||
| 315 | - * @param count 每页条数 | ||
| 316 | - * @param platformId 上级平台ID | ||
| 317 | - * @param query 查询内容 | ||
| 318 | - * @param online 是否在线 | ||
| 319 | - * @param choosed 是否已选中 | 322 | + * |
| 323 | + * @param page 当前页 | ||
| 324 | + * @param count 每页条数 | ||
| 325 | + * @param platformId 上级平台ID | ||
| 326 | + * @param query 查询内容 | ||
| 327 | + * @param online 是否在线 | ||
| 328 | + * @param choosed 是否已选中 | ||
| 320 | * @param channelType 通道类型 | 329 | * @param channelType 通道类型 |
| 321 | * @return | 330 | * @return |
| 322 | */ | 331 | */ |
| @@ -333,22 +342,22 @@ public class PlatformController { | @@ -333,22 +342,22 @@ public class PlatformController { | ||
| 333 | @GetMapping("/channel_list") | 342 | @GetMapping("/channel_list") |
| 334 | @ResponseBody | 343 | @ResponseBody |
| 335 | public PageInfo<ChannelReduce> channelList(int page, int count, | 344 | public PageInfo<ChannelReduce> channelList(int page, int count, |
| 336 | - @RequestParam(required = false) String platformId, | ||
| 337 | - @RequestParam(required = false) String catalogId, | ||
| 338 | - @RequestParam(required = false) String query, | ||
| 339 | - @RequestParam(required = false) Boolean online, | ||
| 340 | - @RequestParam(required = false) Boolean channelType){ | 345 | + @RequestParam(required = false) String platformId, |
| 346 | + @RequestParam(required = false) String catalogId, | ||
| 347 | + @RequestParam(required = false) String query, | ||
| 348 | + @RequestParam(required = false) Boolean online, | ||
| 349 | + @RequestParam(required = false) Boolean channelType) { | ||
| 341 | 350 | ||
| 342 | // if (logger.isDebugEnabled()) { | 351 | // if (logger.isDebugEnabled()) { |
| 343 | // logger.debug("查询所有所有通道API调用"); | 352 | // logger.debug("查询所有所有通道API调用"); |
| 344 | // } | 353 | // } |
| 345 | - if(StringUtils.isEmpty(platformId)) { | 354 | + if (StringUtils.isEmpty(platformId)) { |
| 346 | platformId = null; | 355 | platformId = null; |
| 347 | } | 356 | } |
| 348 | - if(StringUtils.isEmpty(query)) { | 357 | + if (StringUtils.isEmpty(query)) { |
| 349 | query = null; | 358 | query = null; |
| 350 | } | 359 | } |
| 351 | - if(StringUtils.isEmpty(platformId) || StringUtils.isEmpty(catalogId)) { | 360 | + if (StringUtils.isEmpty(platformId) || StringUtils.isEmpty(catalogId)) { |
| 352 | catalogId = null; | 361 | catalogId = null; |
| 353 | } | 362 | } |
| 354 | PageInfo<ChannelReduce> channelReduces = storager.queryAllChannelList(page, count, query, online, channelType, platformId, catalogId); | 363 | PageInfo<ChannelReduce> channelReduces = storager.queryAllChannelList(page, count, query, online, channelType, platformId, catalogId); |
| @@ -358,6 +367,7 @@ public class PlatformController { | @@ -358,6 +367,7 @@ public class PlatformController { | ||
| 358 | 367 | ||
| 359 | /** | 368 | /** |
| 360 | * 向上级平台添加国标通道 | 369 | * 向上级平台添加国标通道 |
| 370 | + * | ||
| 361 | * @param param 通道关联参数 | 371 | * @param param 通道关联参数 |
| 362 | * @return | 372 | * @return |
| 363 | */ | 373 | */ |
| @@ -367,7 +377,7 @@ public class PlatformController { | @@ -367,7 +377,7 @@ public class PlatformController { | ||
| 367 | }) | 377 | }) |
| 368 | @PostMapping("/update_channel_for_gb") | 378 | @PostMapping("/update_channel_for_gb") |
| 369 | @ResponseBody | 379 | @ResponseBody |
| 370 | - public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){ | 380 | + public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param) { |
| 371 | 381 | ||
| 372 | if (logger.isDebugEnabled()) { | 382 | if (logger.isDebugEnabled()) { |
| 373 | logger.debug("给上级平台添加国标通道API调用"); | 383 | logger.debug("给上级平台添加国标通道API调用"); |
| @@ -379,6 +389,7 @@ public class PlatformController { | @@ -379,6 +389,7 @@ public class PlatformController { | ||
| 379 | 389 | ||
| 380 | /** | 390 | /** |
| 381 | * 从上级平台移除国标通道 | 391 | * 从上级平台移除国标通道 |
| 392 | + * | ||
| 382 | * @param param 通道关联参数 | 393 | * @param param 通道关联参数 |
| 383 | * @return | 394 | * @return |
| 384 | */ | 395 | */ |
| @@ -388,7 +399,7 @@ public class PlatformController { | @@ -388,7 +399,7 @@ public class PlatformController { | ||
| 388 | }) | 399 | }) |
| 389 | @DeleteMapping("/del_channel_for_gb") | 400 | @DeleteMapping("/del_channel_for_gb") |
| 390 | @ResponseBody | 401 | @ResponseBody |
| 391 | - public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){ | 402 | + public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param) { |
| 392 | 403 | ||
| 393 | if (logger.isDebugEnabled()) { | 404 | if (logger.isDebugEnabled()) { |
| 394 | logger.debug("给上级平台删除国标通道API调用"); | 405 | logger.debug("给上级平台删除国标通道API调用"); |
| @@ -400,8 +411,9 @@ public class PlatformController { | @@ -400,8 +411,9 @@ public class PlatformController { | ||
| 400 | 411 | ||
| 401 | /** | 412 | /** |
| 402 | * 获取目录 | 413 | * 获取目录 |
| 414 | + * | ||
| 403 | * @param platformId 平台ID | 415 | * @param platformId 平台ID |
| 404 | - * @param parentId 目录父ID | 416 | + * @param parentId 目录父ID |
| 405 | * @return | 417 | * @return |
| 406 | */ | 418 | */ |
| 407 | @ApiOperation("获取目录") | 419 | @ApiOperation("获取目录") |
| @@ -411,7 +423,7 @@ public class PlatformController { | @@ -411,7 +423,7 @@ public class PlatformController { | ||
| 411 | }) | 423 | }) |
| 412 | @GetMapping("/catalog") | 424 | @GetMapping("/catalog") |
| 413 | @ResponseBody | 425 | @ResponseBody |
| 414 | - public ResponseEntity<WVPResult<List<PlatformCatalog>>> getCatalogByPlatform(String platformId, String parentId){ | 426 | + public ResponseEntity<WVPResult<List<PlatformCatalog>>> getCatalogByPlatform(String platformId, String parentId) { |
| 415 | 427 | ||
| 416 | if (logger.isDebugEnabled()) { | 428 | if (logger.isDebugEnabled()) { |
| 417 | logger.debug("查询目录,platformId: {}, parentId: {}", platformId, parentId); | 429 | logger.debug("查询目录,platformId: {}, parentId: {}", platformId, parentId); |
| @@ -432,6 +444,7 @@ public class PlatformController { | @@ -432,6 +444,7 @@ public class PlatformController { | ||
| 432 | 444 | ||
| 433 | /** | 445 | /** |
| 434 | * 添加目录 | 446 | * 添加目录 |
| 447 | + * | ||
| 435 | * @param platformCatalog 目录 | 448 | * @param platformCatalog 目录 |
| 436 | * @return | 449 | * @return |
| 437 | */ | 450 | */ |
| @@ -441,7 +454,7 @@ public class PlatformController { | @@ -441,7 +454,7 @@ public class PlatformController { | ||
| 441 | }) | 454 | }) |
| 442 | @PostMapping("/catalog/add") | 455 | @PostMapping("/catalog/add") |
| 443 | @ResponseBody | 456 | @ResponseBody |
| 444 | - public ResponseEntity<WVPResult<List<PlatformCatalog>>> addCatalog(@RequestBody PlatformCatalog platformCatalog){ | 457 | + public ResponseEntity<WVPResult<List<PlatformCatalog>>> addCatalog(@RequestBody PlatformCatalog platformCatalog) { |
| 445 | 458 | ||
| 446 | if (logger.isDebugEnabled()) { | 459 | if (logger.isDebugEnabled()) { |
| 447 | logger.debug("添加目录,{}", JSON.toJSONString(platformCatalog)); | 460 | logger.debug("添加目录,{}", JSON.toJSONString(platformCatalog)); |
| @@ -452,7 +465,7 @@ public class PlatformController { | @@ -452,7 +465,7 @@ public class PlatformController { | ||
| 452 | 465 | ||
| 453 | if (platformCatalogInStore != null) { | 466 | if (platformCatalogInStore != null) { |
| 454 | result.setCode(-1); | 467 | result.setCode(-1); |
| 455 | - result.setMsg( platformCatalog.getId() + " already exists"); | 468 | + result.setMsg(platformCatalog.getId() + " already exists"); |
| 456 | return new ResponseEntity<>(result, HttpStatus.OK); | 469 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 457 | } | 470 | } |
| 458 | int addResult = storager.addCatalog(platformCatalog); | 471 | int addResult = storager.addCatalog(platformCatalog); |
| @@ -460,7 +473,7 @@ public class PlatformController { | @@ -460,7 +473,7 @@ public class PlatformController { | ||
| 460 | result.setCode(0); | 473 | result.setCode(0); |
| 461 | result.setMsg("success"); | 474 | result.setMsg("success"); |
| 462 | return new ResponseEntity<>(result, HttpStatus.OK); | 475 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 463 | - }else { | 476 | + } else { |
| 464 | result.setCode(-500); | 477 | result.setCode(-500); |
| 465 | result.setMsg("save error"); | 478 | result.setMsg("save error"); |
| 466 | return new ResponseEntity<>(result, HttpStatus.OK); | 479 | return new ResponseEntity<>(result, HttpStatus.OK); |
| @@ -469,6 +482,7 @@ public class PlatformController { | @@ -469,6 +482,7 @@ public class PlatformController { | ||
| 469 | 482 | ||
| 470 | /** | 483 | /** |
| 471 | * 编辑目录 | 484 | * 编辑目录 |
| 485 | + * | ||
| 472 | * @param platformCatalog 目录 | 486 | * @param platformCatalog 目录 |
| 473 | * @return | 487 | * @return |
| 474 | */ | 488 | */ |
| @@ -478,7 +492,7 @@ public class PlatformController { | @@ -478,7 +492,7 @@ public class PlatformController { | ||
| 478 | }) | 492 | }) |
| 479 | @PostMapping("/catalog/edit") | 493 | @PostMapping("/catalog/edit") |
| 480 | @ResponseBody | 494 | @ResponseBody |
| 481 | - public ResponseEntity<WVPResult<List<PlatformCatalog>>> editCatalog(@RequestBody PlatformCatalog platformCatalog){ | 495 | + public ResponseEntity<WVPResult<List<PlatformCatalog>>> editCatalog(@RequestBody PlatformCatalog platformCatalog) { |
| 482 | 496 | ||
| 483 | if (logger.isDebugEnabled()) { | 497 | if (logger.isDebugEnabled()) { |
| 484 | logger.debug("编辑目录,{}", JSON.toJSONString(platformCatalog)); | 498 | logger.debug("编辑目录,{}", JSON.toJSONString(platformCatalog)); |
| @@ -488,14 +502,14 @@ public class PlatformController { | @@ -488,14 +502,14 @@ public class PlatformController { | ||
| 488 | result.setCode(0); | 502 | result.setCode(0); |
| 489 | 503 | ||
| 490 | if (platformCatalogInStore == null) { | 504 | if (platformCatalogInStore == null) { |
| 491 | - result.setMsg( platformCatalog.getId() + " not exists"); | 505 | + result.setMsg(platformCatalog.getId() + " not exists"); |
| 492 | return new ResponseEntity<>(result, HttpStatus.OK); | 506 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 493 | } | 507 | } |
| 494 | int addResult = storager.updateCatalog(platformCatalog); | 508 | int addResult = storager.updateCatalog(platformCatalog); |
| 495 | if (addResult > 0) { | 509 | if (addResult > 0) { |
| 496 | result.setMsg("success"); | 510 | result.setMsg("success"); |
| 497 | return new ResponseEntity<>(result, HttpStatus.OK); | 511 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 498 | - }else { | 512 | + } else { |
| 499 | result.setMsg("save error"); | 513 | result.setMsg("save error"); |
| 500 | return new ResponseEntity<>(result, HttpStatus.OK); | 514 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 501 | } | 515 | } |
| @@ -503,6 +517,7 @@ public class PlatformController { | @@ -503,6 +517,7 @@ public class PlatformController { | ||
| 503 | 517 | ||
| 504 | /** | 518 | /** |
| 505 | * 删除目录 | 519 | * 删除目录 |
| 520 | + * | ||
| 506 | * @param id 目录Id | 521 | * @param id 目录Id |
| 507 | * @return | 522 | * @return |
| 508 | */ | 523 | */ |
| @@ -512,7 +527,7 @@ public class PlatformController { | @@ -512,7 +527,7 @@ public class PlatformController { | ||
| 512 | }) | 527 | }) |
| 513 | @DeleteMapping("/catalog/del") | 528 | @DeleteMapping("/catalog/del") |
| 514 | @ResponseBody | 529 | @ResponseBody |
| 515 | - public ResponseEntity<WVPResult<String>> delCatalog(String id, String platformId){ | 530 | + public ResponseEntity<WVPResult<String>> delCatalog(String id, String platformId) { |
| 516 | 531 | ||
| 517 | if (logger.isDebugEnabled()) { | 532 | if (logger.isDebugEnabled()) { |
| 518 | logger.debug("删除目录,{}", id); | 533 | logger.debug("删除目录,{}", id); |
| @@ -540,7 +555,7 @@ public class PlatformController { | @@ -540,7 +555,7 @@ public class PlatformController { | ||
| 540 | if (delResult > 0) { | 555 | if (delResult > 0) { |
| 541 | result.setMsg("success"); | 556 | result.setMsg("success"); |
| 542 | return new ResponseEntity<>(result, HttpStatus.OK); | 557 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 543 | - }else { | 558 | + } else { |
| 544 | result.setMsg("save error"); | 559 | result.setMsg("save error"); |
| 545 | return new ResponseEntity<>(result, HttpStatus.OK); | 560 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 546 | } | 561 | } |
| @@ -548,6 +563,7 @@ public class PlatformController { | @@ -548,6 +563,7 @@ public class PlatformController { | ||
| 548 | 563 | ||
| 549 | /** | 564 | /** |
| 550 | * 删除关联 | 565 | * 删除关联 |
| 566 | + * | ||
| 551 | * @param platformCatalog 关联的信息 | 567 | * @param platformCatalog 关联的信息 |
| 552 | * @return | 568 | * @return |
| 553 | */ | 569 | */ |
| @@ -557,7 +573,7 @@ public class PlatformController { | @@ -557,7 +573,7 @@ public class PlatformController { | ||
| 557 | }) | 573 | }) |
| 558 | @DeleteMapping("/catalog/relation/del") | 574 | @DeleteMapping("/catalog/relation/del") |
| 559 | @ResponseBody | 575 | @ResponseBody |
| 560 | - public ResponseEntity<WVPResult<List<PlatformCatalog>>> delRelation(@RequestBody PlatformCatalog platformCatalog){ | 576 | + public ResponseEntity<WVPResult<List<PlatformCatalog>>> delRelation(@RequestBody PlatformCatalog platformCatalog) { |
| 561 | 577 | ||
| 562 | if (logger.isDebugEnabled()) { | 578 | if (logger.isDebugEnabled()) { |
| 563 | logger.debug("删除关联,{}", JSON.toJSONString(platformCatalog)); | 579 | logger.debug("删除关联,{}", JSON.toJSONString(platformCatalog)); |
| @@ -569,7 +585,7 @@ public class PlatformController { | @@ -569,7 +585,7 @@ public class PlatformController { | ||
| 569 | if (delResult > 0) { | 585 | if (delResult > 0) { |
| 570 | result.setMsg("success"); | 586 | result.setMsg("success"); |
| 571 | return new ResponseEntity<>(result, HttpStatus.OK); | 587 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 572 | - }else { | 588 | + } else { |
| 573 | result.setMsg("save error"); | 589 | result.setMsg("save error"); |
| 574 | return new ResponseEntity<>(result, HttpStatus.OK); | 590 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 575 | } | 591 | } |
| @@ -578,8 +594,9 @@ public class PlatformController { | @@ -578,8 +594,9 @@ public class PlatformController { | ||
| 578 | 594 | ||
| 579 | /** | 595 | /** |
| 580 | * 修改默认目录 | 596 | * 修改默认目录 |
| 597 | + * | ||
| 581 | * @param platformId 平台Id | 598 | * @param platformId 平台Id |
| 582 | - * @param catalogId 目录Id | 599 | + * @param catalogId 目录Id |
| 583 | * @return | 600 | * @return |
| 584 | */ | 601 | */ |
| 585 | @ApiOperation("修改默认目录") | 602 | @ApiOperation("修改默认目录") |
| @@ -589,7 +606,7 @@ public class PlatformController { | @@ -589,7 +606,7 @@ public class PlatformController { | ||
| 589 | }) | 606 | }) |
| 590 | @PostMapping("/catalog/default/update") | 607 | @PostMapping("/catalog/default/update") |
| 591 | @ResponseBody | 608 | @ResponseBody |
| 592 | - public ResponseEntity<WVPResult<String>> setDefaultCatalog(String platformId, String catalogId){ | 609 | + public ResponseEntity<WVPResult<String>> setDefaultCatalog(String platformId, String catalogId) { |
| 593 | 610 | ||
| 594 | if (logger.isDebugEnabled()) { | 611 | if (logger.isDebugEnabled()) { |
| 595 | logger.debug("修改默认目录,{},{}", platformId, catalogId); | 612 | logger.debug("修改默认目录,{},{}", platformId, catalogId); |
| @@ -601,7 +618,7 @@ public class PlatformController { | @@ -601,7 +618,7 @@ public class PlatformController { | ||
| 601 | if (updateResult > 0) { | 618 | if (updateResult > 0) { |
| 602 | result.setMsg("success"); | 619 | result.setMsg("success"); |
| 603 | return new ResponseEntity<>(result, HttpStatus.OK); | 620 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 604 | - }else { | 621 | + } else { |
| 605 | result.setMsg("save error"); | 622 | result.setMsg("save error"); |
| 606 | return new ResponseEntity<>(result, HttpStatus.OK); | 623 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 607 | } | 624 | } |
src/main/resources/application-dev.yml
| @@ -13,7 +13,7 @@ spring: | @@ -13,7 +13,7 @@ spring: | ||
| 13 | # [可选] 数据库 DB | 13 | # [可选] 数据库 DB |
| 14 | database: 6 | 14 | database: 6 |
| 15 | # [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接 | 15 | # [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接 |
| 16 | - password: | 16 | + password: face2020 |
| 17 | # [可选] 超时时间 | 17 | # [可选] 超时时间 |
| 18 | timeout: 10000 | 18 | timeout: 10000 |
| 19 | # [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置 | 19 | # [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置 |
| @@ -23,7 +23,7 @@ spring: | @@ -23,7 +23,7 @@ spring: | ||
| 23 | driver-class-name: com.mysql.cj.jdbc.Driver | 23 | driver-class-name: com.mysql.cj.jdbc.Driver |
| 24 | url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false | 24 | url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false |
| 25 | username: root | 25 | username: root |
| 26 | - password: root123 | 26 | + password: 123456 |
| 27 | druid: | 27 | druid: |
| 28 | initialSize: 10 # 连接池初始化连接数 | 28 | initialSize: 10 # 连接池初始化连接数 |
| 29 | maxActive: 200 # 连接池最大连接数 | 29 | maxActive: 200 # 连接池最大连接数 |
| @@ -50,7 +50,7 @@ server: | @@ -50,7 +50,7 @@ server: | ||
| 50 | # 作为28181服务器的配置 | 50 | # 作为28181服务器的配置 |
| 51 | sip: | 51 | sip: |
| 52 | # [必须修改] 本机的IP | 52 | # [必须修改] 本机的IP |
| 53 | - ip: 192.168.118.70 | 53 | + ip: 192.168.41.16 |
| 54 | # [可选] 28181服务监听的端口 | 54 | # [可选] 28181服务监听的端口 |
| 55 | port: 5060 | 55 | port: 5060 |
| 56 | # 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007) | 56 | # 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007) |
| @@ -67,9 +67,9 @@ sip: | @@ -67,9 +67,9 @@ sip: | ||
| 67 | media: | 67 | media: |
| 68 | id: FQ3TF8yT83wh5Wvz | 68 | id: FQ3TF8yT83wh5Wvz |
| 69 | # [必须修改] zlm服务器的内网IP | 69 | # [必须修改] zlm服务器的内网IP |
| 70 | - ip: 192.168.118.70 | 70 | + ip: 192.168.41.16 |
| 71 | # [必须修改] zlm服务器的http.port | 71 | # [必须修改] zlm服务器的http.port |
| 72 | - http-port: 80 | 72 | + http-port: 8091 |
| 73 | # [可选] zlm服务器的hook.admin_params=secret | 73 | # [可选] zlm服务器的hook.admin_params=secret |
| 74 | secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc | 74 | secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc |
| 75 | # 启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试 | 75 | # 启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试 |