urls.js 1.84 KB
import baseUrl from "../baseUrl";
function gitTimer() {
  return new Date().getTime();
}
export default {
  getTask: `${baseUrl}/api/v1/devconf_fx/tasks?s=${gitTimer()}`,
  editTask: taskid => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}`;
  },
  editroi: (taskid, subtaskid) => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtasks/${subtaskid}?s=${gitTimer()}`; // 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?s=${gitTimer()}`;
  },
  getstream: (devid, vrefid) => {
    return `${baseUrl}/api/v1/stream/devs/${devid}/vchans/${vrefid}/live/is_sending?s=${gitTimer()}`;
  },
  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}?s=${gitTimer()}`; // 删除子任务
  },
  changeTask: taskid => {
    return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/start_or_stop?s=${gitTimer()}`; // 切换任务
  }
};