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);
|
}
|
|
@PutMapping
|
@ApiOperation(value = "修改视频设备参数")
|
public Response update(@RequestBody Video video){
|
return service.update(video);
|
}
|
|
}
|