package com.sooka.sponest.monitor.tvwall.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.sooka.sponest.monitor.LabelManagement.domain.CentermonitorSetLabel;
import com.sooka.sponest.monitor.tvwall.domain.TVWallVO;
import com.sooka.sponest.monitor.tvwall.service.TVWallService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "电视墙控制器")
@RequestMapping("TVWallController")
@RestController
public class TVWallController {
    final TVWallService tvWallService;

    public TVWallController(TVWallService tvWallService) {
        this.tvWallService = tvWallService;
    }

    @ApiOperation(value = "初始化电视墙方法", notes = "初始化电视墙方法")
    @GetMapping("/init")
    public AjaxResult init() {
        return tvWallService.init();
    }

    @ApiOperation(value = "根据重点工程的ID获取绑定的摄像头", notes = "根据重点工程的ID获取绑定的摄像头")
    @GetMapping("/initByProject")
    public AjaxResult initByProject(TVWallVO vo) {
        return tvWallService.initByProject(vo);
    }

    @ApiOperation(value = "根据重点区域的ID获取绑定的摄像头", notes = "根据重点区域的ID获取绑定的摄像头")
    @GetMapping("/initByArea")
    public AjaxResult initByArea(TVWallVO vo) {
        return tvWallService.initByArea(vo);
    }

    @ApiOperation(value = "根据部门ID获取具有查看权限的摄像头", notes = "根据部门ID获取具有查看权限的摄像头")
    @GetMapping("/getCamerasByDeptId")
    public AjaxResult getCamerasByDeptId(TVWallVO vo) {
        return tvWallService.getCamerasByDeptId(vo);
    }

    @ApiOperation(value = "根据部门ID获取具有查看权限的摄像头", notes = "根据部门ID获取具有查看权限的摄像头")
    @GetMapping("/getCamerasByLabelId")
    public AjaxResult getCamerasByDeptId(CentermonitorSetLabel centermonitorSetLabel) {
        return tvWallService.getCamerasByLabelId(centermonitorSetLabel);
    }

    @ApiOperation(value = "根据摄像头集合构建电视墙可用的数据", notes = "根据摄像头集合构建电视墙可用的数据")
    @GetMapping("/initByCameras")
    public AjaxResult initByCameras(TVWallVO vo) {
        return tvWallService.initByCameras(vo);
    }
}
