/*
 * @Author: 赵伟
 * @Date: 2024-11-18 10:18:27
 * @Description: 主动学习
 */

import { request } from '@umijs/max';

// 分页查询超参数自动寻优
export function getActiveLearnListReq(params, skipLoading) {
  return request(`/api/mmp/activeLearn`, {
    method: 'GET',
    params,
    skipLoading
  });
}

// 查询超参数自动寻优详情
export function getActiveLearnInfoReq(params) {
  return request(`/api/mmp/activeLearn/getActiveLearnDetail`, {
    method: 'GET',
    params,
  });
}

// 新增超参数自动寻优
export function addActiveLearnReq(data) {
  return request(`/api/mmp/activeLearn`, {
    method: 'POST',
    data,
  });
}

// 编辑超参数自动寻优
export function updateActiveLearnReq(data) {
  return request(`/api/mmp/activeLearn`, {
    method: 'PUT',
    data,
  });
}

// 删除超参数自动寻优
export function deleteActiveLearnReq(id) {
  return request(`/api/mmp/activeLearn/${id}`, {
    method: 'DELETE',
  });
}

// 运行超参数自动寻优
export function runActiveLearnReq(id) {
  return request(`/api/mmp/activeLearn/run/${id}`, {
    method: 'POST',
  });
}

// ----------------------- 实验实例 -----------------------
// 获取实验实例列表
export function getActiveLearnInsListReq(params, skipLoading) {
  return request(`/api/mmp/activeLearnIns`, {
    method: 'GET',
    params,
    skipLoading
  });
}

// 查询实验实例详情
export function getActiveLearnInsReq(id) {
  return request(`/api/mmp/activeLearnIns/${id}`, {
    method: 'GET',
  });
}

// 停止实验实例
export function stopActiveLearnInsReq(id) {
  return request(`/api/mmp/activeLearnIns/${id}`, {
    method: 'PUT',
  });
}

// 删除实验实例
export function deleteActiveLearnInsReq(id) {
  return request(`/api/mmp/activeLearnIns/${id}`, {
    method: 'DELETE',
  });
}

// 批量删除实验实例
export function batchDeleteActiveLearnInsReq(data) {
  return request(`/api/mmp/activeLearnIns/batchDelete`, {
    method: 'DELETE',
    data,
  });
}


// 获取当前实验的指标对比地址
export function getExpMetricsReq(data) {
  return request(`/api/mmp/activeLearnIns/getExpMetrics`, {
    method: 'POST',
    data,
  });
}

// 编辑实验实例
export function editActiveLearnInsReq(data) {
  return request(`/api/mmp/activeLearnIns`, {
    method: 'PUT',
    data,
    skipLoading: true,
  });
}

