VodDictController.java 2.5 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.content.GetContendVodsDTO;
import com.subsidy.model.VodDictDO;
import com.subsidy.service.VodDictService;
import com.subsidy.util.ConstantUtils;
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;
import io.swagger.annotations.Api;

/**
 * <p>
 * 视频表 前端控制器
 * </p>
 *
 * @author DengMin
 * @since 2021-10-11
 */
@RestController
@Api(tags = "视频表")
@RequestMapping("/vodDict")
public class VodDictController {

    @Autowired
    private VodDictService vodDictService;

    @PostMapping("/signature")
    @ApiOperation("获取签名")
    public ResponseVO signature()throws Exception{
        return ResponseData.generateCreatedResponse(0,vodDictService.signature());
    }

    @PostMapping("getContendVods")
    @ApiOperation("获取目录下的视频 {contentId  vodName}")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO getContendVods(@RequestBody GetContendVodsDTO getContendVodsDTO){
        return ResponseData.generateCreatedResponse(0,vodDictService.getContendVods(getContendVodsDTO));
    }

    @PostMapping("deleteVod")
    @ApiOperation("删除视频 id ")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO){
        return ResponseData.generateCreatedResponse(0,vodDictService.deleteVod(vodDictDO));
    }

    @PostMapping("addVod")
    @ApiOperation("新增视频 contentId vodName vodLength vodType vodSize  vodUrl vodCode")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO addVod(@RequestBody VodDictDO vodDictDO){
        return ResponseData.generateCreatedResponse(0,vodDictService.addVod(vodDictDO));
    }

    @PostMapping("updateVod")
    @ApiOperation("新增视频 id contentId vodName vodLength vodType vodSize  vodUrl vodCode")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO){
        return ResponseData.generateCreatedResponse(0,vodDictService.updateVod(vodDictDO));
    }


}