package com.tofly.xrtygis.controller.hk;


import com.tofly.common.core.entity.ResultRespone;

import com.tofly.xrtygis.entity.vo.HkParmDto;
import com.tofly.xrtygis.service.HkService;
import com.tofly.xrtygis.service.NoiseJobService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@AllArgsConstructor
@RequestMapping("/hk")
@Api(tags = "海康接口调用")
public class HkController {
    private final HkService hkService;

    private final NoiseJobService noiseJobService;

    @PostMapping("/getPreviewURLs")
    @ApiOperation(value = "获取监控点预览取流URLv2")
    public ResultRespone getPreviewURLs(@RequestBody HkParmDto dto) {
       return ResultRespone.success(hkService.GetCameraPreviewURL(dto));
    }

    @GetMapping("/testNoiseFile")
    @ApiOperation(value = "测试噪音文件")
    public ResultRespone testNoiseFile() {
        noiseJobService.sendNoiseInfo();
        return ResultRespone.success();
    }

}
