VodPlayHistoryController.java 2.17 KB
package com.subsidy.controller;


import com.alibaba.fastjson.JSON;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.vod.SignDatePlaysDTO;
import com.subsidy.dto.vod.FixDataTwoDTO;
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.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 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 位点")
    public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
        return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistory(vodPlayHistoryDO));
    }

    @RequestMapping("insertHistoryNew")
    @ApiOperation("记录学生看视频位置  classId班级id vodId 视频id  memberId 成员id  playLength 播放时长 playRecord 位点")
    public ResponseVO insertHistoryNew(@RequestBody String param){
        VodPlayHistoryDO vodPlayHistoryDO = JSON.parseObject(param,VodPlayHistoryDO.class);
        return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(vodPlayHistoryDO));
    }

    @PostMapping("dataFix")
    public void dadaFix(@RequestBody SignDatePlaysDTO dataFixDTO){
       vodPlayHistoryService.dataFix(dataFixDTO);
    }

    @PostMapping("signDatePlays")
    public void signDatePlays(@RequestBody SignDatePlaysDTO signDatePlaysDTO ){
        vodPlayHistoryService.signDatePlays(signDatePlaysDTO);
    }
}