servie
/** * 删除云端video videoId是指云端中视频的id * @param videoId */ void removeVideo(String videoId);
@Override public void removeVideo(String videoId) { //删除云端视频 try{ DefaultAcsClient client = InitVodClient.initVodClient(ConstantVodUtils.REGION_ID,ConstantVodUtils.ACCESS_KEY_ID, ConstantVodUtils.ACCESS_KEY_SECRET); DeleteVideoRequest request = new DeleteVideoRequest(); request.setVideoIds(videoId); DeleteVideoResponse response = client.getAcsResponse(request); System.out.print("RequestId = " + response.getRequestId() + "\n"); }catch (com.aliyuncs.exceptions.ClientException e){ throw new GuliException(20001, "视频删除失败"); } }
controller /** * 删除阿里云视频根据videoId */ @DeleteMapping("removeAlyVideo/{id}") public R removeAlyVideo(@PathVariable String id){ vodService.removeVideo(id); return R.ok().message("视频删除成功喽"); }