VodDictController.java 2.75 KB
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));
    }


}