package com.zhgd.xmgl.modules.basicdata.api.camera;

import com.alibaba.fastjson.JSONObject;
import lombok.experimental.UtilityClass;

import java.util.List;

/**
 * 监控外部接口
 */
@UtilityClass
public class MonitorApi {

    /**
     * 根据监控点编号获取监控点状态
     * @return
     */
    public JSONObject getMonitorOnline(List<String> monitorCode) {
        String path = "/api/nms/v1/online/camera/get";
        JSONObject jsonBody = new JSONObject();
        String [] array = (String[]) monitorCode.toArray();
        jsonBody.put("indexCodes", array);
        return CameraPreview.GetCameraPreviewURL(path, jsonBody.toJSONString());
    }


    /**
     * 监控点图片抓拍
     * @return
     */
    public JSONObject manualCapture(String monitorCode) {
        String path = "/api/video/v1/manualCapture";
        JSONObject jsonBody = new JSONObject();
        jsonBody.put("cameraIndexCode", monitorCode);
        return CameraPreview.GetCameraPreviewURL(path, jsonBody.toJSONString());
    }
}
