import { request } from '@umijs/max';
// 查询开发环境url
export function getJupyterUrl() {
  return request(`/api/mmp/jupyter/getURL`, {
    method: 'GET',
  });
}

// 查询 labelStudio url
export function getLabelStudioUrl() {
  return request(`/api/mmp/labelStudio/getURL`, {
    method: 'GET',
  });
}

// 创建编辑器
export function createEditorReq(data: any) {
  return request(`/api/mmp/devEnvironment`, {
    method: 'POST',
    data,
  });
}

// 获取编辑器列表
export function getEditorListReq(params: any) {
  return request(`/api/mmp/devEnvironment`, {
    method: 'GET',
    params,
  });
}

// 获取编辑器详情
export function getEditorInfoReq(id: number) {
  return request(`/api/mmp/devEnvironment/${id}`, {
    method: 'GET',
  });
}

// 创建编辑器
export function deleteEditorReq(id: number) {
  return request(`/api/mmp/devEnvironment/${id}`, {
    method: 'DELETE',
  });
}

// 启动编辑器
export function startEditorReq(id: number) {
  return request(`/api/mmp/jupyter/run/${id}`, {
    method: 'POST',
  });
}

// 停止编辑器
export function stopEditorReq(id: number) {
  return request(`/api/mmp/jupyter/stop/${id}`, {
    method: 'DELETE',
  });
}

// 制作镜像
export function createEditorMirrorReq(data: any) {
  return request(`/api/mmp/image/saveImage`, {
    method: 'POST',
    data,
  });
}

// 获取知识图谱的url
export function getKnowledgeGraphUrl() {
  return request(`/api/mmp/knowledgeGraph/getURL`, {
    method: 'GET',
  });
}
