urls.js 2.44 KB
import baseUrl from "../baseUrl";
function gitTimer() {
  return new Date().getTime();
}
export default {
  getTask: `${baseUrl}/api/v1/devconf_fx/tasks`,
  editTask: taskid => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}`;
  },
  editroi: (taskid, subtaskid) => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtasks/${subtaskid}`; // ROI设置
  },
  alternatestate: (taskid, subtaskid) => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}/suspend_alternate_task?s=${gitTimer()}`;
  },
  algostate: (taskid, subtaskid) => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}/suspend_algorithm?s=${gitTimer()}`;
  },
  getSubTask: id => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtasks`;
  },
  setSubTask: id => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtask`;
  },
  setSubTaskList: id => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtask/batch`;
  },
  getstream: (devid, vrefid) => {
    return `${baseUrl}/api/v1/devconf_fx/devs/${devid}/vchans/${vrefid}/live`;
  },
  getPlayUrl: subid => {
    return `${baseUrl}/api/v1/devconf_fx/analyse/live/play_url?subtask_id=${subid}`; // 获取播放地址
  },
  getTaskParams: (taskid, subtaskid) => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtasks/${subtaskid}?s=${gitTimer()}`; // 推流信息
  },
  cutpic: (devid, vchanid, subtaskid) => {
    return `${baseUrl}/api/v1/devconf_fx/devs/${devid}/vchans/${vchanid}/cut_pic?subtask_id=${subtaskid}&s=${gitTimer()}`; // 截图
  },
  deleteTask: taskid => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}?s=${gitTimer()}`; // 删除子任务
  },
  deleteSubTask: (taskid, subtaskid) => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}`; // 删除子任务
  },
  changeTask: taskid => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/start_or_stop?s=${gitTimer()}`; // 切换任务
  },
  movetask: taskid => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/mount`; // 迁移任务
  },
  switchScene: (taskid, subtaskid, scene_unid) => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}/switch_scene?scene_unid=${scene_unid}`; // 切换预置位
  },
  suspendAlternate: (taskid, subtaskid, suspend) => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}/suspend_alternate_task?suspend=${suspend}`; // 开启关闭轮询
  }
};