import request from "@/utils/request";

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

  // 获取监控列表数组
  VIDEOLIST_URL = "/av_ja/videoSpot/list",

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

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

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

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