VodPlayHistoryController.java
3.53 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package com.subsidy.controller;
import com.alibaba.fastjson.JSON;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.vod.InsertHistoryNewDTO;
import com.subsidy.dto.vod.RemainSecondsDTO;
import com.subsidy.dto.vod.SignDatePlaysDTO;
import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.service.VodPlayHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 视频播放历史记录表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@RestController
@Api(tags = "视频播放历史记录表")
@RequestMapping("/vodPlayHistory")
public class VodPlayHistoryController {
@Autowired
private VodPlayHistoryService vodPlayHistoryService;
@PostMapping("insertHistory")
@ApiOperation("记录学生看视频位置 ajax请求 classId班级id vodId 视频id " +
"memberId 成员id playLength 播放时长 playRecord 位点 suspendLength暂停时长 ")
@LoginRequired
@TimeRequired
public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistory(vodPlayHistoryDO));
}
@RequestMapping("insertHistoryNew")
@ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id " +
"playLength 播放时长 playRecord 位点 suspendLength")
@TimeRequired
public ResponseVO insertHistoryNew(@RequestBody String param){
InsertHistoryNewDTO insertHistoryNewDTO = JSON.parseObject(param, InsertHistoryNewDTO.class);
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(insertHistoryNewDTO));
}
@PostMapping("dataFix")
@ApiOperation("每个视频都看一次")
@LoginRequired
public void dadaFix(@RequestBody SignDatePlaysDTO dataFixDTO){
vodPlayHistoryService.dataFix(dataFixDTO);
}
@PostMapping("signDatePlays")
@ApiOperation("每天接着看几个视频 接dataFix的")
// @LoginRequired
public void signDatePlays(@RequestBody SignDatePlaysDTO signDatePlaysDTO ){
vodPlayHistoryService.signDatePlays(signDatePlaysDTO);
}
@PostMapping("remainSeconds")
@ApiOperation("每个视频先看一下,然后剩余时长分配到每天里 classId memberId")
// @LoginRequired
public void remainSeconds(@RequestBody RemainSecondsDTO remainSecondsDTO){
vodPlayHistoryService.remainSeconds(remainSecondsDTO);
}
@PostMapping("playLengthFix")
@ApiOperation("按照时长去跑脚本 {classId memberId}")
// @LoginRequired
public void playLengthFix(@RequestBody RemainSecondsDTO remainSecondsDTO){
vodPlayHistoryService.playLengthFix(remainSecondsDTO);
}
@GetMapping("testPlays")
@ApiOperation("解决有交叉时间的数据 classId")
public ResponseVO testPlays(){
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.testPlays());
}
@PostMapping("reArrangeData")
@ApiOperation("将有问题的数据按照签到时间重新排一下")
public void reArrangeData(){
vodPlayHistoryService.reArrangeData();
}
@PostMapping("warning")
@ApiOperation("短信报警")
public void warning(){
vodPlayHistoryService.warning();
}
}