ClassHourDictController.java 2.16 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.model.ClassHourDictDO;
import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.service.ClassHourDictService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.classdict.GetSettingVO;
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-11-26
 */
@RestController
@Api(tags = "课时")
@RequestMapping("/classHour")
public class ClassHourDictController {

    @Autowired
    private ClassHourDictService classHourDictService;

    @PostMapping("getSetting")
    @ApiOperation("查看当天设置的最大学习时长 companyId")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO getSetting(@RequestBody  ClassHourDictDO classHourDictDO){
        return ResponseData.generateCreatedResponse(0,classHourDictService.getSetting(classHourDictDO));
    }

    @PostMapping("updateSetting")
    @ApiOperation("修改当天设置时长   companyId 主键 logo classHour status  interrupt  interruptStatus repeatTime repeatStatus rotationImgDictDOS[companyId rotationImg]")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO updateSetting(@RequestBody GetSettingVO getSettingVO){
        return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(getSettingVO));
    }

    @PostMapping("pollingGet")
    @ApiOperation("轮询查询当前这个人当天有没有超过最长时长  memberId  playLength")
    public ResponseVO pollingGet(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
        return ResponseData.generateCreatedResponse(0,classHourDictService.pollingGet(vodPlayHistoryDO));
    }



}