Newer
Older
huludao / src / main / java / com / newfiber / api / pc / camera / Controller / CameraController.java
package com.newfiber.api.pc.camera.Controller;


import com.beust.jcommander.internal.Lists;
import com.newfiber.api.core.commons.ResultCode;
import com.newfiber.api.core.commons.ResultObj;
import com.newfiber.api.pc.camera.service.CameraService;
import io.swagger.annotations.Api;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: newfiber_baishigang_main
 * @description: 视频播放,云台控制
 * @author: djt
 * @create: 2020-12-11 17:59
 **/
@RestController
@RequestMapping("camera")
@Api(tags = "视频播放,云台播放相关")
public class CameraController {
    @Autowired
    private CameraService cameraService;

    @PostMapping("/play")
//    @RequiresPermissions("abarbeitungissue:info")
//    @SysLog(value = "播放视频", actionType = "4")
    @ApiOperation(value = "播放视频")
    public ResultObj<String> info(@RequestParam("deviceId") String deviceId,@RequestParam("channelId")String channelId) {
        return new ResultObj<>(ResultCode.OK,cameraService.checkCameraPlaying(deviceId,channelId));
    }

    @PostMapping("/ptzContr")
//    @RequiresPermissions("abarbeitungissue:info")
//    @SysLog(value = "云台", actionType = "4")
    @ApiOperation(value = "云台控制")
    public ResultObj<Boolean> info(@RequestParam("deviceId") String deviceId, @RequestParam("instruct") String instruct,@RequestParam("channelId")String channelId) {
        return  new ResultObj<>(ResultCode.OK,cameraService.ptz(deviceId, instruct,channelId));
    }
    @PostMapping("queryList")
//    @RequiresPermissions("abarbeitungissue:info")
//    @SysLog(value = "云台", actionType = "4")
    @ApiOperation(value = "查询设备列表")
    @Deprecated
    public ResultObj<String> list() {
        return new ResultObj<>(ResultCode.OK,cameraService.list(Lists.newArrayList("6F00BA1PAZ57D9C")));
    }
    @PostMapping("/bindDevice")
    @ApiOperation(value = "绑定设备")
//    @RequiresPermissions("abarbeitungissue:info")
//    @SysLog(value = "云台", actionType = "4")
    public ResultObj<Boolean> bindDevice(@RequestParam("deviceId")String deviceId,@RequestParam("code")String code) {
        return new ResultObj<>(ResultCode.OK,cameraService.bindDevice(deviceId,code));
    }
    @PostMapping("/unBindDevice")
    @ApiOperation(value = "解绑设备")
//    @RequiresPermissions("abarbeitungissue:info")
//    @SysLog(value = "云台", actionType = "4")
    public ResultObj<Boolean> unBindDevice(@RequestParam("deviceId")String deviceId) {
        return new ResultObj<>(ResultCode.OK,cameraService.unBindDevice(deviceId));
    }

}