/*
 * @Author: 赵伟
 * @Date: 2024-04-16 14:29:44
 * @Description: 模型部署接口
 */
import { request } from '@umijs/max';

// 分页查询服务列表
export function getServiceListReq(data: any) {
  return request(`/api/mmp/service`, {
    method: 'GET',
    params: data,
  });
}

// 创建推理服务
export function createServiceReq(data: any) {
  return request(`/api/mmp/service`, {
    method: 'POST',
    data,
  });
}

// 编辑推理服务
export function updateServiceReq(data: any) {
  return request(`/api/mmp/service`, {
    method: 'PUT',
    data,
  });
}

// 删除推理服务
export function deleteServiceReq(id: any) {
  return request(`/api/mmp/service/${id}`, {
    method: 'DELETE',
  });
}

// 获取服务详情
export function getServiceInfoReq(id: any) {
  return request(`/api/mmp/service/serviceDetail/${id}`, {
    method: 'GET',
  });
}

// ------------------------------- 服务版本部分 ---------------------------------------------

// 获取服务版本列表
export function getServiceVersionsReq(data: any) {
  return request(`/api/mmp/service/serviceVersion`, {
    method: 'GET',
    params: data,
  });
}

// 创建服务版本
export function createServiceVersionReq(data: any) {
  return request(`/api/mmp/service/serviceVersion`, {
    method: 'POST',
    data,
  });
}

// 更新服务版本
export function updateServiceVersionReq(data: any) {
  return request(`/api/mmp/service/serviceVersion`, {
    method: 'PUT',
    data,
  });
}

// 删除服务版本
export function deleteServiceVersionReq(id: any) {
  return request(`/api/mmp/service/serviceVersion/${id}`, {
    method: 'DELETE',
  });
}

// 获取服务版本详情
export function getServiceVersionInfoReq(id: any) {
  return request(`/api/mmp/service/serviceVersionDetail/${id}`, {
    method: 'GET',
  });
}

// 停止服务版本
export function stopServiceVersionReq(id: any) {
  return request(`/api/mmp/service/stopServiceVersion/${id}`, {
    method: 'DELETE',
  });
}

// 获取服务版本操作指南
export function getServiceVersionDocsReq(id: any) {
  return request(`/api/mmp/service/getServiceVersionDocs/${id}`, {
    method: 'GET',
  });
}

// 获取服务版本日志
export function getServiceVersionLogReq(params: any) {
  return request(`/api/mmp/service/getServiceVersionLog`, {
    method: 'GET',
    params,
  });
}

// 获取服务版本对比
export function getServiceVersionCompareReq(params: any) {
  return request(`/api/mmp/service/serviceVersionCompare`, {
    method: 'GET',
    params,
  });
}
