Showing
6 changed files
with
95 additions
and
0 deletions
| @@ -126,4 +126,22 @@ public class LiveMonitorRoomController { | @@ -126,4 +126,22 @@ public class LiveMonitorRoomController { | ||
| 126 | log.info("-->【云审片平台】获取房间详情,参数:id:{} ", id); | 126 | log.info("-->【云审片平台】获取房间详情,参数:id:{} ", id); |
| 127 | return liveMonitorRoomService.getLMRoomDetail(id); | 127 | return liveMonitorRoomService.getLMRoomDetail(id); |
| 128 | } | 128 | } |
| 129 | + | ||
| 130 | + /* | ||
| 131 | + * 停止房间收录 | ||
| 132 | + */ | ||
| 133 | + @GetMapping("stopRecord") | ||
| 134 | + public ResultBean stopRecord(@RequestParam(value = "id",required = true)Long id){ | ||
| 135 | + log.info("-->【云审片平台】停止房间收录,参数:id:{} ", id); | ||
| 136 | + return liveMonitorRoomService.stopRecord(id); | ||
| 137 | + } | ||
| 138 | + /* | ||
| 139 | + * 启动房间收录 | ||
| 140 | + */ | ||
| 141 | + @GetMapping("startRecord") | ||
| 142 | + public ResultBean startRecord(@RequestParam(value = "id",required = true)Long id){ | ||
| 143 | + log.info("-->【云审片平台】启动房间收录,参数:id:{} ", id); | ||
| 144 | + return liveMonitorRoomService.startRecord(id); | ||
| 145 | + } | ||
| 146 | + | ||
| 129 | } | 147 | } |
| @@ -40,4 +40,15 @@ public class LiveMonitorRoom { | @@ -40,4 +40,15 @@ public class LiveMonitorRoom { | ||
| 40 | /** 直播名称 */ | 40 | /** 直播名称 */ |
| 41 | private String liveName; | 41 | private String liveName; |
| 42 | 42 | ||
| 43 | + /** | ||
| 44 | + * 收录状态 0-未收录 1-已收录 2 停止 | ||
| 45 | + */ | ||
| 46 | + private String recordStatus; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 收录操作时间 | ||
| 50 | + */ | ||
| 51 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 52 | + private LocalDateTime recordStartTime; | ||
| 53 | + | ||
| 43 | } | 54 | } |
| @@ -33,4 +33,10 @@ public interface LiveMonitorRoomService extends IService<LiveMonitorRoom> { | @@ -33,4 +33,10 @@ public interface LiveMonitorRoomService extends IService<LiveMonitorRoom> { | ||
| 33 | 33 | ||
| 34 | ResultBean taskDetail(Long id); | 34 | ResultBean taskDetail(Long id); |
| 35 | 35 | ||
| 36 | + | ||
| 37 | + ResultBean startRecord(Long id); | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + ResultBean stopRecord(Long id); | ||
| 41 | + | ||
| 36 | } | 42 | } |
| @@ -355,6 +355,52 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | @@ -355,6 +355,52 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | ||
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | 357 | ||
| 358 | + @Override | ||
| 359 | + public ResultBean startRecord(Long id) { | ||
| 360 | + | ||
| 361 | + LiveMonitorRoom monitorRoom = getById(id); | ||
| 362 | + | ||
| 363 | + if(monitorRoom == null){ | ||
| 364 | + return ResultBean.error("房间不存在"); | ||
| 365 | + } | ||
| 366 | + | ||
| 367 | + String recordStatus = monitorRoom.getRecordStatus(); | ||
| 368 | + if(recordStatus == null || Objects.equals("1",recordStatus)){ | ||
| 369 | + return ResultBean.error("房间在已在收录中"); | ||
| 370 | + } | ||
| 371 | + monitorRoom.setRoomStatus("1"); | ||
| 372 | + | ||
| 373 | + //请求收录服务 | ||
| 374 | + | ||
| 375 | + | ||
| 376 | + | ||
| 377 | + monitorRoom.setUpdatedTime(LocalDateTime.now()); | ||
| 378 | + saveOrUpdate(monitorRoom); | ||
| 379 | + | ||
| 380 | + return ResultBean.ok("操作成功"); | ||
| 381 | + } | ||
| 382 | + | ||
| 383 | + @Override | ||
| 384 | + public ResultBean stopRecord(Long id) { | ||
| 385 | + LiveMonitorRoom monitorRoom = getById(id); | ||
| 386 | + | ||
| 387 | + if(monitorRoom == null){ | ||
| 388 | + return ResultBean.error("房间不存在"); | ||
| 389 | + } | ||
| 390 | + | ||
| 391 | + String recordStatus = monitorRoom.getRecordStatus(); | ||
| 392 | + if(recordStatus == null || Objects.equals("2",recordStatus)){ | ||
| 393 | + return ResultBean.error("房间在已在停止收录"); | ||
| 394 | + } | ||
| 395 | + monitorRoom.setRoomStatus("2"); | ||
| 396 | + | ||
| 397 | + //请求收录服务 | ||
| 398 | + | ||
| 358 | 399 | ||
| 359 | 400 | ||
| 401 | + monitorRoom.setUpdatedTime(LocalDateTime.now()); | ||
| 402 | + saveOrUpdate(monitorRoom); | ||
| 403 | + | ||
| 404 | + return ResultBean.ok("操作成功"); | ||
| 405 | + } | ||
| 360 | } | 406 | } |
| @@ -39,4 +39,15 @@ public class LMRoomListVo { | @@ -39,4 +39,15 @@ public class LMRoomListVo { | ||
| 39 | private String mixOutputUrl; | 39 | private String mixOutputUrl; |
| 40 | /** 直播名称 */ | 40 | /** 直播名称 */ |
| 41 | private String liveName; | 41 | private String liveName; |
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 收录状态 0-未收录 1-已收录 2 停止 | ||
| 45 | + */ | ||
| 46 | + private String recordStatus; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 收录操作时间 | ||
| 50 | + */ | ||
| 51 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 52 | + private LocalDateTime recordStartTime; | ||
| 42 | } | 53 | } |
| @@ -13,6 +13,9 @@ | @@ -13,6 +13,9 @@ | ||
| 13 | `updated_by`, | 13 | `updated_by`, |
| 14 | `updated_time`, | 14 | `updated_time`, |
| 15 | `mix_output_url`, | 15 | `mix_output_url`, |
| 16 | + `record_status`, | ||
| 17 | + `record_time`, | ||
| 18 | + `mix_output_url`, | ||
| 16 | `live_name` | 19 | `live_name` |
| 17 | FROM | 20 | FROM |
| 18 | `crp_live_monitor_room` | 21 | `crp_live_monitor_room` |
-
Please register or login to post a comment