xuhy
2024-03-01 8c47a796880249d2b081d70e306c998cd3caf4b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.ruoyi.web.controller.api;
 
 
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.TVideo;
import com.ruoyi.system.query.TVideoQuery;
import com.ruoyi.system.service.TVideoService;
import com.ruoyi.system.vo.TVideoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * <p>
 * 短视频管理 前端控制器
 * </p>
 *
 * @author xiaochen
 * @since 2024-02-29
 */
@Api(tags = "短视频管理")
@RestController
@RequestMapping("/tVideo")
public class TVideoController {
 
    private final TVideoService videoService;
 
    @Autowired
    public TVideoController(TVideoService videoService) {
        this.videoService = videoService;
    }
 
    /**
     * 获取短视频管理分页列表
     */
    @ApiOperation(value = "获取短视频管理分页列表")
    @PostMapping(value = "/pageList")
    public AjaxResult<PageInfo<TVideoVO>> pageList(@RequestBody TVideoQuery query) {
        return AjaxResult.success(videoService.pageList(query));
    }
 
    /**
     * 获取短视频管理详情
     */
    @ApiOperation(value = "获取短视频管理详情")
    @GetMapping(value = "/getDetailById")
    public AjaxResult<TVideo> getDetailById(@RequestParam Long id) {
        return AjaxResult.success(videoService.getById(id));
    }
 
    /**
     * 通过id删除短视频
     */
    @ApiOperation(value = "通过id删除短视频")
    @DeleteMapping(value = "/deleteById")
    public AjaxResult<TVideo> deleteById(@RequestParam Long id) {
        return AjaxResult.success(videoService.removeById(id));
    }
 
    /**
     * 短视频上下架
     */
    @ApiOperation(value = "短视频上下架")
    @GetMapping(value = "/upAndDown")
    public AjaxResult upAndDown(@RequestParam Long id,
                                @RequestParam Integer status) {
        return AjaxResult.success(videoService.upAndDown(id,status));
    }
 
}