Showing
5 changed files
with
123 additions
and
9 deletions
| 1 | package com.wondertek.controller; | 1 | package com.wondertek.controller; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import com.wondertek.dto.CrpRoomSetDto; | ||
| 4 | import com.wondertek.dto.LMRoomDto; | 5 | import com.wondertek.dto.LMRoomDto; |
| 5 | import com.wondertek.dto.LMRoomParam; | 6 | import com.wondertek.dto.LMRoomParam; |
| 6 | import com.wondertek.service.LiveMonitorRoomService; | 7 | import com.wondertek.service.LiveMonitorRoomService; |
| 8 | +import com.wondertek.util.JSONUtils; | ||
| 7 | import com.wondertek.util.PageBean; | 9 | import com.wondertek.util.PageBean; |
| 8 | import com.wondertek.util.ResultBean; | 10 | import com.wondertek.util.ResultBean; |
| 9 | import jakarta.annotation.Resource; | 11 | import jakarta.annotation.Resource; |
| @@ -48,6 +50,7 @@ public class LiveMonitorRoomController { | @@ -48,6 +50,7 @@ public class LiveMonitorRoomController { | ||
| 48 | */ | 50 | */ |
| 49 | @PostMapping("create") | 51 | @PostMapping("create") |
| 50 | ResultBean create(@RequestBody LMRoomParam lmRoomParam){ | 52 | ResultBean create(@RequestBody LMRoomParam lmRoomParam){ |
| 53 | + log.info("-->【云审片平台】新增审片间,参数:{}", JSONUtils.obj2json(lmRoomParam)); | ||
| 51 | return liveMonitorRoomService.create(lmRoomParam); | 54 | return liveMonitorRoomService.create(lmRoomParam); |
| 52 | } | 55 | } |
| 53 | 56 | ||
| @@ -59,19 +62,46 @@ public class LiveMonitorRoomController { | @@ -59,19 +62,46 @@ public class LiveMonitorRoomController { | ||
| 59 | */ | 62 | */ |
| 60 | @PostMapping("update") | 63 | @PostMapping("update") |
| 61 | ResultBean update(@RequestBody LMRoomParam lmRoomParam){ | 64 | ResultBean update(@RequestBody LMRoomParam lmRoomParam){ |
| 65 | + log.info("-->【云审片平台】更新审片间,参数:{}", JSONUtils.obj2json(lmRoomParam)); | ||
| 62 | return liveMonitorRoomService.update(lmRoomParam); | 66 | return liveMonitorRoomService.update(lmRoomParam); |
| 63 | } | 67 | } |
| 64 | 68 | ||
| 65 | 69 | ||
| 70 | + /** | ||
| 71 | + * 更新审片间 | ||
| 72 | + * @param | ||
| 73 | + * @return | ||
| 74 | + */ | ||
| 75 | + @PostMapping("setting") | ||
| 76 | + ResultBean setting(@RequestBody CrpRoomSetDto crpRoomSetDto){ | ||
| 77 | + | ||
| 78 | + log.info("-->【云审片平台】审片间配置主备,参数:{}", JSONUtils.obj2json(crpRoomSetDto)); | ||
| 79 | + return liveMonitorRoomService.setting(crpRoomSetDto); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + | ||
| 83 | + /** | ||
| 84 | + * 更新审片间状态 | ||
| 85 | + * @param | ||
| 86 | + * @return | ||
| 87 | + */ | ||
| 66 | @GetMapping("setStatus") | 88 | @GetMapping("setStatus") |
| 67 | ResultBean updateStatus(@RequestParam(value = "id",required = true)Long id, | 89 | ResultBean updateStatus(@RequestParam(value = "id",required = true)Long id, |
| 68 | @RequestParam(value = "status",required = true)String status){ | 90 | @RequestParam(value = "status",required = true)String status){ |
| 91 | + | ||
| 92 | + log.info("-->【云审片平台】更新审片间状态,参数:id:{} status:{}", id, status); | ||
| 69 | return liveMonitorRoomService.updateStatus(id, status); | 93 | return liveMonitorRoomService.updateStatus(id, status); |
| 70 | } | 94 | } |
| 71 | 95 | ||
| 72 | 96 | ||
| 97 | + /** | ||
| 98 | + * 删除审片间 | ||
| 99 | + * @param id | ||
| 100 | + * @return | ||
| 101 | + */ | ||
| 73 | @GetMapping("remove") | 102 | @GetMapping("remove") |
| 74 | ResultBean delete(@RequestParam(value = "id",required = true)Long id ){ | 103 | ResultBean delete(@RequestParam(value = "id",required = true)Long id ){ |
| 104 | + log.info("-->【云审片平台】删除审片间,参数:id:{} ", id); | ||
| 75 | return liveMonitorRoomService.delete(id); | 105 | return liveMonitorRoomService.delete(id); |
| 76 | } | 106 | } |
| 77 | 107 | ||
| @@ -82,6 +112,7 @@ public class LiveMonitorRoomController { | @@ -82,6 +112,7 @@ public class LiveMonitorRoomController { | ||
| 82 | */ | 112 | */ |
| 83 | @GetMapping("taskDetail") | 113 | @GetMapping("taskDetail") |
| 84 | ResultBean taskDetail(@RequestParam(value = "id",required = true)Long id){ | 114 | ResultBean taskDetail(@RequestParam(value = "id",required = true)Long id){ |
| 115 | + log.info("-->【云审片平台】获取任务详情,参数:id:{} ", id); | ||
| 85 | return liveMonitorRoomService.taskDetail(id); | 116 | return liveMonitorRoomService.taskDetail(id); |
| 86 | } | 117 | } |
| 87 | 118 | ||
| @@ -92,6 +123,7 @@ public class LiveMonitorRoomController { | @@ -92,6 +123,7 @@ public class LiveMonitorRoomController { | ||
| 92 | */ | 123 | */ |
| 93 | @GetMapping("getLMRoomDetail") | 124 | @GetMapping("getLMRoomDetail") |
| 94 | ResultBean getLMRoomDetail(@RequestParam(value = "id",required = true)Long id){ | 125 | ResultBean getLMRoomDetail(@RequestParam(value = "id",required = true)Long id){ |
| 126 | + log.info("-->【云审片平台】获取房间详情,参数:id:{} ", id); | ||
| 95 | return liveMonitorRoomService.getLMRoomDetail(id); | 127 | return liveMonitorRoomService.getLMRoomDetail(id); |
| 96 | } | 128 | } |
| 97 | } | 129 | } |
| 1 | +package com.wondertek.dto; | ||
| 2 | + | ||
| 3 | +import lombok.Data; | ||
| 4 | + | ||
| 5 | +@Data | ||
| 6 | +public class CrpSetDate { | ||
| 7 | + | ||
| 8 | + private Long id; | ||
| 9 | + | ||
| 10 | + | ||
| 11 | + /** 输出组序号(标识输出分组) */ | ||
| 12 | + private String outputGroup; | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 输出目录地址 | ||
| 17 | + * <p>存储转码后文件的路径(最大长度1024字符)</p> | ||
| 18 | + */ | ||
| 19 | + private String outputDir; | ||
| 20 | + | ||
| 21 | + private String mixConfig; | ||
| 22 | + | ||
| 23 | +} |
| @@ -2,6 +2,7 @@ package com.wondertek.service; | @@ -2,6 +2,7 @@ package com.wondertek.service; | ||
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.extension.service.IService; | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 4 | import com.wondertek.dto.BackupMaterialDto; | 4 | import com.wondertek.dto.BackupMaterialDto; |
| 5 | +import com.wondertek.dto.CrpRoomSetDto; | ||
| 5 | import com.wondertek.dto.LMRoomDto; | 6 | import com.wondertek.dto.LMRoomDto; |
| 6 | import com.wondertek.dto.LMRoomParam; | 7 | import com.wondertek.dto.LMRoomParam; |
| 7 | import com.wondertek.entity.LiveMonitorRoom; | 8 | import com.wondertek.entity.LiveMonitorRoom; |
| @@ -22,6 +23,9 @@ public interface LiveMonitorRoomService extends IService<LiveMonitorRoom> { | @@ -22,6 +23,9 @@ public interface LiveMonitorRoomService extends IService<LiveMonitorRoom> { | ||
| 22 | 23 | ||
| 23 | ResultBean update(LMRoomParam lmRoomParam); | 24 | ResultBean update(LMRoomParam lmRoomParam); |
| 24 | 25 | ||
| 26 | + | ||
| 27 | + ResultBean setting(CrpRoomSetDto crpRoomSetDto); | ||
| 28 | + | ||
| 25 | ResultBean updateStatus(Long id, String status); | 29 | ResultBean updateStatus(Long id, String status); |
| 26 | 30 | ||
| 27 | ResultBean delete(Long id); | 31 | ResultBean delete(Long id); |
| @@ -8,9 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | @@ -8,9 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
| 8 | import com.baomidou.mybatisplus.core.metadata.IPage; | 8 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 9 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 9 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| 11 | -import com.wondertek.dto.CrpDataVo; | ||
| 12 | -import com.wondertek.dto.LMRoomDto; | ||
| 13 | -import com.wondertek.dto.LMRoomParam; | 11 | +import com.wondertek.dto.*; |
| 12 | +import com.wondertek.entity.Admin; | ||
| 14 | import com.wondertek.entity.LiveMonitorRoom; | 13 | import com.wondertek.entity.LiveMonitorRoom; |
| 15 | import com.wondertek.entity.StreamTask; | 14 | import com.wondertek.entity.StreamTask; |
| 16 | import com.wondertek.mapper.LiveMonitorRoomMapper; | 15 | import com.wondertek.mapper.LiveMonitorRoomMapper; |
| @@ -37,6 +36,9 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | @@ -37,6 +36,9 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | ||
| 37 | @Resource | 36 | @Resource |
| 38 | private StreamTaskService monitorMarkService; | 37 | private StreamTaskService monitorMarkService; |
| 39 | 38 | ||
| 39 | + @Resource | ||
| 40 | + private Admin admin; | ||
| 41 | + | ||
| 40 | 42 | ||
| 41 | @Value("${transcode.getTaskDetail}") | 43 | @Value("${transcode.getTaskDetail}") |
| 42 | private String getTaskDetail; | 44 | private String getTaskDetail; |
| @@ -62,7 +64,7 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | @@ -62,7 +64,7 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | ||
| 62 | LiveMonitorRoom liveMonitorRoom = new LiveMonitorRoom(); | 64 | LiveMonitorRoom liveMonitorRoom = new LiveMonitorRoom(); |
| 63 | liveMonitorRoom.setName(lmRoomParam.getName()); | 65 | liveMonitorRoom.setName(lmRoomParam.getName()); |
| 64 | liveMonitorRoom.setRoomStatus("0"); | 66 | liveMonitorRoom.setRoomStatus("0"); |
| 65 | - liveMonitorRoom.setCreatedBy(""); | 67 | + liveMonitorRoom.setCreatedBy(admin.getUsername()); |
| 66 | liveMonitorRoom.setCreatedTime(LocalDateTime.now()); | 68 | liveMonitorRoom.setCreatedTime(LocalDateTime.now()); |
| 67 | liveMonitorRoom.setLiveName(lmRoomParam.getLiveName()); | 69 | liveMonitorRoom.setLiveName(lmRoomParam.getLiveName()); |
| 68 | boolean b = saveOrUpdate(liveMonitorRoom); | 70 | boolean b = saveOrUpdate(liveMonitorRoom); |
| @@ -79,7 +81,7 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | @@ -79,7 +81,7 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | ||
| 79 | streamTask.setChannelId(crpDataVo.getChannelId()); | 81 | streamTask.setChannelId(crpDataVo.getChannelId()); |
| 80 | streamTask.setRoomId(roomId); | 82 | streamTask.setRoomId(roomId); |
| 81 | streamTask.setTaskType(crpDataVo.getTaskType()); | 83 | streamTask.setTaskType(crpDataVo.getTaskType()); |
| 82 | - streamTask.setCreatedBy(""); | 84 | + streamTask.setCreatedBy(admin.getUsername()); |
| 83 | streamTask.setCreatedTime(LocalDateTime.now()); | 85 | streamTask.setCreatedTime(LocalDateTime.now()); |
| 84 | return streamTask; | 86 | return streamTask; |
| 85 | }).toList(); | 87 | }).toList(); |
| @@ -111,10 +113,14 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | @@ -111,10 +113,14 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | ||
| 111 | dataList.forEach(crpDataVo -> { | 113 | dataList.forEach(crpDataVo -> { |
| 112 | Long sId = crpDataVo.getId(); | 114 | Long sId = crpDataVo.getId(); |
| 113 | StreamTask streamTask = monitorMarkService.getById(sId); | 115 | StreamTask streamTask = monitorMarkService.getById(sId); |
| 116 | + | ||
| 117 | + if (streamTask==null){ | ||
| 118 | + return; | ||
| 119 | + } | ||
| 114 | streamTask.setTaskId(crpDataVo.getTaskId()); | 120 | streamTask.setTaskId(crpDataVo.getTaskId()); |
| 115 | streamTask.setChannelId(crpDataVo.getChannelId()); | 121 | streamTask.setChannelId(crpDataVo.getChannelId()); |
| 116 | streamTask.setTaskType(crpDataVo.getTaskType()); | 122 | streamTask.setTaskType(crpDataVo.getTaskType()); |
| 117 | - streamTask.setCreatedBy(""); | 123 | + streamTask.setCreatedBy(admin.getUsername()); |
| 118 | streamTask.setCreatedTime(LocalDateTime.now()); | 124 | streamTask.setCreatedTime(LocalDateTime.now()); |
| 119 | monitorMarkService.updateById(streamTask); | 125 | monitorMarkService.updateById(streamTask); |
| 120 | }); | 126 | }); |
| @@ -138,6 +144,7 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | @@ -138,6 +144,7 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | ||
| 138 | return ResultBean.error("播控中房间不能禁用"); | 144 | return ResultBean.error("播控中房间不能禁用"); |
| 139 | } | 145 | } |
| 140 | monitorRoom.setRoomStatus(status); | 146 | monitorRoom.setRoomStatus(status); |
| 147 | + monitorRoom.setUpdatedBy(admin.getUsername()); | ||
| 141 | monitorRoom.setUpdatedTime(LocalDateTime.now()); | 148 | monitorRoom.setUpdatedTime(LocalDateTime.now()); |
| 142 | saveOrUpdate(monitorRoom); | 149 | saveOrUpdate(monitorRoom); |
| 143 | 150 | ||
| @@ -160,11 +167,44 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | @@ -160,11 +167,44 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | ||
| 160 | } | 167 | } |
| 161 | monitorRoom.setDel("1"); | 168 | monitorRoom.setDel("1"); |
| 162 | monitorRoom.setUpdatedTime(LocalDateTime.now()); | 169 | monitorRoom.setUpdatedTime(LocalDateTime.now()); |
| 170 | + monitorRoom.setUpdatedBy(admin.getNickname()); | ||
| 163 | saveOrUpdate(monitorRoom); | 171 | saveOrUpdate(monitorRoom); |
| 164 | 172 | ||
| 165 | return ResultBean.ok("删除成功"); | 173 | return ResultBean.ok("删除成功"); |
| 166 | } | 174 | } |
| 167 | 175 | ||
| 176 | + @Override | ||
| 177 | + public ResultBean setting(CrpRoomSetDto crpRoomSetDto) { | ||
| 178 | + | ||
| 179 | + Long id = crpRoomSetDto.getId(); | ||
| 180 | + | ||
| 181 | + LiveMonitorRoom monitorRoom = getById(id); | ||
| 182 | + if(monitorRoom == null){ | ||
| 183 | + return ResultBean.error("房间不存在"); | ||
| 184 | + } | ||
| 185 | + monitorRoom.setName(crpRoomSetDto.getName()); | ||
| 186 | + monitorRoom.setUpdatedTime(LocalDateTime.now()); | ||
| 187 | + saveOrUpdate(monitorRoom); | ||
| 188 | + List<CrpSetDate> dataList = crpRoomSetDto.getSetlist(); | ||
| 189 | + //更新子任务信息 | ||
| 190 | + if(!CollectionUtils.isEmpty(dataList)){ | ||
| 191 | + dataList.forEach(setVo -> { | ||
| 192 | + Long sId = setVo.getId(); | ||
| 193 | + StreamTask streamTask = monitorMarkService.getById(sId); | ||
| 194 | + if (streamTask==null){ | ||
| 195 | + return; | ||
| 196 | + } | ||
| 197 | + streamTask.setCreatedTime(LocalDateTime.now()); | ||
| 198 | + streamTask.setUpdatedBy(admin.getUsername()); | ||
| 199 | + streamTask.setOutputGroup(setVo.getOutputGroup()); | ||
| 200 | + streamTask.setOutputDir(setVo.getOutputDir()); | ||
| 201 | + streamTask.setMixConfig(setVo.getMixConfig()); | ||
| 202 | + monitorMarkService.updateById(streamTask); | ||
| 203 | + }); | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + return ResultBean.ok("修改成功"); | ||
| 207 | + } | ||
| 168 | 208 | ||
| 169 | @Override | 209 | @Override |
| 170 | public ResultBean taskDetail(Long id) { | 210 | public ResultBean taskDetail(Long id) { |
| @@ -265,7 +305,7 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | @@ -265,7 +305,7 @@ public class LiveMonitorRoomServiceImpl extends ServiceImpl<LiveMonitorRoomMappe | ||
| 265 | return ResultBean.ok(result); | 305 | return ResultBean.ok(result); |
| 266 | } | 306 | } |
| 267 | 307 | ||
| 268 | - public static void main(String[] args) { | ||
| 269 | - System.out.println(ResultBean.ok("result")); | ||
| 270 | - } | 308 | + |
| 309 | + | ||
| 310 | + | ||
| 271 | } | 311 | } |
-
Please register or login to post a comment