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

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.sooka.sponest.monitor.camera.domain.VisuForestCloudMapVO;
import com.sooka.sponest.monitor.camera.service.ICentermonitorTCameraService;
import com.sooka.sponest.monitor.haikang.service.HaiKangService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;

@Api(tags = "海康控制器")
@RestController
@RequestMapping("HaiKangController")
public class HaiKangController {
    @Resource
    HaiKangService haiKangService;
    private final ICentermonitorTCameraService centermonitorTCameraService;

    public HaiKangController(ICentermonitorTCameraService centermonitorTCameraService) {
        this.centermonitorTCameraService = centermonitorTCameraService;
    }

    /**
     * 获取海康视频服务
     * */
    @Log(title = "海康", businessType = BusinessType.OTHER)
    @ApiOperation(value = "获取海康视频服务", notes = "获取海康视频服务")
    @ApiImplicitParam(name = "cameraCode", value = "摄像头编码", dataType = "String", paramType = "query")
    @RequestMapping(value = "getHaiKangVideoServer",method = GET)
    public AjaxResult getHaiKangVideoServer(String cameraCode){
        return haiKangService.getHaiKangVideoServer(cameraCode);
    }

    /**
     * 根据摄像头事件类别查询海康摄像头列表高清通道
     * */
    @Log(title = "海康", businessType = BusinessType.OTHER)
    @ApiOperation(value = "根据摄像头事件类别查询海康摄像头列表高清通道", notes = "根据摄像头事件类别查询海康摄像头列表高清通道")
    @RequestMapping(value = "/cameraTVHaiKangList",method = POST)
    @ApiImplicitParam(name = "eventCode",value = "事件编码",dataType = "String",paramType = "query")
    public AjaxResult  cameraTVHaiKangList(@RequestBody VisuForestCloudMapVO visuForestCloudMapVO) {
        return centermonitorTCameraService.cameraTVHaiKangList(visuForestCloudMapVO);
    }

}
