import request from "@/utils/request";

enum API {
  // 登录获取监控权限
  VIDEOLOGIN_URL = "/av_ja/videoAdmin/login",

  // 获取监控列表数组
  VIDEOLIST_URL = "/av_ja/camera/queryCameraRelationship",

  // 监控拉流
  VIDEOPULL_URL = "/av_ja/stream/addStreamSource",

  // 监控关流
  VIDEOSTOP_URL = "/av_ja/stream/delStreamSource",
}

//登录获取监控权限
export const reqVideoLogin = (data: any) =>
  request.post(API.VIDEOLOGIN_URL, data, { headers: { type: "video" } });

//获取监控列表数组
export const reqVideoList = () =>
  request.get(API.VIDEOLIST_URL, {
    headers: {
      type: "video",
      admin_token: localStorage.getItem("admin_token"),
    },
  });

//监控拉流
export const reqVideoPull = (data: any) =>
  request.post(API.VIDEOPULL_URL, data, {
    headers: {
      type: "video",
      admin_token: localStorage.getItem("admin_token"),
    },
  });

//监控关流
export const reqVideoStop = (data: any) =>
  request.post(API.VIDEOSTOP_URL, data, {
    headers: {
      type: "video",
      admin_token: localStorage.getItem("admin_token"),
    },
  });
