/**
 * 返回数据
 *
 * AiModelRespVO
 */
export interface AiModelRespVO {
  /**
   * 创建时间
   */
  createTime?: string;
  /**
   * 版本描述
   */
  description?: string;
  /**
   * 主键
   */
  id?: number;
  /**
   * 负载
   */
  loadPercentage?: number;
  /**
   * 模型名称
   */
  modelName?: string;
  /**
   * 状态（0-禁用 1-启用 2-测试中 3-已废弃）
   */
  status?: number;
  /**
   * 更新时间
   */
  updateTime?: string;
  /**
   * 版本号
   */
  version?: string;
}
import { request } from "@umijs/max";
export const getModelList = async (params: PageParam) => {
  return request("/ai/model/page", {
    method: "GET",
    params,
  });
};

export const createModel = async (params: AiModelRespVO) => {
  return request("/ai/model/create", {
    method: "POST",
    data: params,
  });
};

export const updateModel = async (params: AiModelRespVO) => {
  return request("/ai/model/update", {
    method: "PUT",
    data: params,
  });
};

export const delModel = async (id: number) => {
  return request("/ai/model/delete", {
    method: "DELETE",
    params: { id },
  });
};

export const updateModelStatus = async (params: AiModelRespVO) => {
  return request("/ai/model/update-status", {
    method: "PUT",
    params: params,
  });
};
