package com.ycl.controller.resources;
|
|
|
import com.ycl.annotation.LogSave;
|
import com.ycl.api.CommonResult;
|
import com.ycl.controller.BaseController;
|
import com.ycl.entity.resources.VideoResources;
|
import com.ycl.service.resources.IVideoResourcesService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
/**
|
* <p>
|
* 前端控制器
|
* </p>
|
*
|
* @author lyq
|
* @since 2022-11-08
|
*/
|
@RestController
|
@RequestMapping("/video_resources")
|
@Api(tags = "视频资源管理")
|
public class VideoResourcesController extends BaseController {
|
|
@Autowired
|
IVideoResourcesService iVideoResourcesService;
|
|
@GetMapping("/query")
|
@ApiOperation("查询")
|
public CommonResult search(@RequestParam(required = false) Integer type,
|
@RequestParam(required = false) String startTime,
|
@RequestParam(required = false) String endTime,
|
@RequestParam Long size,
|
@RequestParam Long current) {
|
return CommonResult.success(iVideoResourcesService.selectImages(type, startTime, endTime, size, current));
|
}
|
|
@PutMapping("modification")
|
@ApiOperation("修改视频")
|
@LogSave(operationType = "视频管理", contain = "修改视频")
|
public CommonResult modify(@RequestBody VideoResources videoResources) {
|
return CommonResult.success(iVideoResourcesService.updateById(videoResources));
|
}
|
|
@DeleteMapping("deletion")
|
@ApiOperation("删除")
|
@LogSave(operationType = "视频管理", contain = "删除视频")
|
public CommonResult delete(@RequestParam Integer id) {
|
return CommonResult.success(iVideoResourcesService.removeById(id));
|
}
|
|
@PostMapping("addition")
|
@ApiOperation("添加")
|
@LogSave(operationType = "视频管理", contain = "添加视频")
|
public CommonResult add(@RequestBody VideoResources videoResources) {
|
return CommonResult.success(iVideoResourcesService.save(videoResources));
|
}
|
|
@DeleteMapping("deletion_batch")
|
@ApiOperation("批量删除")
|
@LogSave(operationType = "视频管理", contain = "批量删除视频")
|
public CommonResult delete(@RequestParam List<Integer> ids) {
|
return CommonResult.success(iVideoResourcesService.removeBatchByIds(ids));
|
}
|
}
|