VodDictController.java
2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package com.zhongzhi.controller;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.course.ChangeOrdersDTO;
import com.zhongzhi.dto.course.VodsDTO;
import com.zhongzhi.model.CourseDictDO;
import com.zhongzhi.model.VodDictDO;
import com.zhongzhi.service.VodDictService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
@RestController
@RequestMapping("/vodDict")
@Api(tags = "视频字典表")
public class VodDictController {
@Autowired
private VodDictService vodDictService;
@PostMapping("/signature")
@ApiOperation("获取签名")
public ResponseVO signature()throws Exception{
return ResponseData.generateCreatedResponse(0,vodDictService.signature());
}
@PostMapping("deleteVod")
@ApiOperation("删除视频 id")
public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO){
vodDictService.deleteVod(vodDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("addVod")
@ApiOperation("新增视频 courseId vodName vodUrl vodCode vodLength vodSize vodFormat coverPage")
public ResponseVO orderNo(@RequestBody VodDictDO vodDictDO){
vodDictService.addVod(vodDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("updateVod")
@ApiOperation("修改视频 id vodName vodName vodUrl vodCode vodLength vodSize vodFormat coverPage ")
public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO){
vodDictService.updateVod(vodDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("changeOrders")
@ApiOperation("排序 ids[]")
public ResponseVO changeOrders(@RequestBody ChangeOrdersDTO changeOrdersDTO){
vodDictService.changeOrders(changeOrdersDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("vods")
@ApiOperation("查询课程下的视频 courseId vodName")
public ResponseVO vods(@RequestBody VodsDTO vodsDTO){
return ResponseData.generateCreatedResponse(0, vodDictService.vods(vodsDTO));
}
@PostMapping("fourVods")
@ApiOperation("首页只查询4个视频 yearId ")
public ResponseVO fourVods(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.fourVods(courseDictDO));
}
}