|
|
@@ -150,4 +150,52 @@ public class LiveVideoController extends BaseController
|
|
|
int result = liveVideoService.batchUpdateCategory(videoIds, category);
|
|
|
return toAjax(result);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新视频URL并重置转码状态
|
|
|
+ */
|
|
|
+ @Log(title = "更新视频URL", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping("/updateVideoUrl")
|
|
|
+ public AjaxResult updateVideoUrl(@RequestBody Map<String, Object> params)
|
|
|
+ {
|
|
|
+ Object videoIdObj = params.get("videoId");
|
|
|
+ Object videoUrlObj = params.get("videoUrl");
|
|
|
+
|
|
|
+ if (videoIdObj == null) {
|
|
|
+ return AjaxResult.error("视频编号不能为空");
|
|
|
+ }
|
|
|
+ if (videoUrlObj == null || videoUrlObj.toString().trim().isEmpty()) {
|
|
|
+ return AjaxResult.error("视频URL不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ Long videoId;
|
|
|
+ if (videoIdObj instanceof Number) {
|
|
|
+ videoId = ((Number) videoIdObj).longValue();
|
|
|
+ } else {
|
|
|
+ try {
|
|
|
+ videoId = Long.parseLong(videoIdObj.toString());
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ return AjaxResult.error("视频编号格式错误");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ String videoUrl = videoUrlObj.toString().trim();
|
|
|
+
|
|
|
+ int result = liveVideoService.updateVideoUrl(videoId, videoUrl);
|
|
|
+ return toAjax(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量新增直播视频
|
|
|
+ */
|
|
|
+ @Log(title = "批量新增直播视频", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping("/batchAdd")
|
|
|
+ public AjaxResult batchAdd(@RequestBody List<LiveVideo> liveVideoList)
|
|
|
+ {
|
|
|
+ if (liveVideoList == null || liveVideoList.isEmpty()) {
|
|
|
+ return AjaxResult.error("视频列表不能为空");
|
|
|
+ }
|
|
|
+ int result = liveVideoService.batchInsertLiveVideo(liveVideoList);
|
|
|
+ return toAjax(result);
|
|
|
+ }
|
|
|
}
|