whycxzp
2021-04-16 5361481d1056f46d9df3c02a0bdb914c97e0db15
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.Video;
import com.whyc.service.VideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
@RestController
@RequestMapping("video")
@Api(tags = "视频管理")
public class VideoController {
 
    @Autowired
    private VideoService service;
 
    @PostMapping
    @ApiOperation(value = "添加")
    public Response add(@RequestBody Video video){
        return service.add(video);
    }
 
    @GetMapping
    @ApiOperation(value = "查询设备信息-根据设备id")
    public Response getInfo(@RequestParam Integer id){
        return service.getInfo(id);
    }
 
    @PostMapping("page")
    @ApiOperation(value = "查询设备列表分页")
    public Response getPage(@RequestParam Integer pageNum,
                            @RequestParam Integer pageSize,
                            @RequestBody Video video){
        return service.getPage(pageNum,pageSize,video);
    }
 
    @GetMapping("allShow")
    @ApiOperation(value = "查询所有可显示视频的设备")
    public Response getAllShow(){
        return service.getAllShow();
    }
 
    @PutMapping("status")
    @ApiOperation(value = "设置视频设备显示状态")
    public Response updateStatus(@RequestParam Integer id,
                                 @RequestParam Integer status){
        return service.updateStatus(id,status);
    }
 
}