FileDictController.java 2.26 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.FileDictDO;
import com.subsidy.model.VodDictDO;
import com.subsidy.service.FileDictService;
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("/fileDict")
public class FileDictController {

    @Autowired
    private FileDictService fileDictService;

    @PostMapping("getContendFiles")
    @ApiOperation("获取目录下的视频 {contentId  fileName}")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO getContendFiles(@RequestBody FileDictDO fileDictDO){
        return ResponseData.generateCreatedResponse(0,fileDictService.getContendFiles(fileDictDO));
    }

    @PostMapping("deleteFile")
    @ApiOperation("删除视频 id ")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO deleteFile(@RequestBody FileDictDO fileDictDO){
        return ResponseData.generateCreatedResponse(0,fileDictService.deleteFile(fileDictDO));
    }

    @PostMapping("addFile")
    @ApiOperation("新增视频 contentId fileName fileSize fileType fileUrl")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO addFile(@RequestBody FileDictDO fileDictDO){
        return ResponseData.generateCreatedResponse(0,fileDictService.addFile(fileDictDO));
    }

    @PostMapping("updateFile")
    @ApiOperation("新增视频 id contentId fileName fileSize fileType fileUrl")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO updateFile(@RequestBody FileDictDO fileDictDO){
        return ResponseData.generateCreatedResponse(0,fileDictService.updateFile(fileDictDO));
    }

}