/*
 * @Description:
 * @Author: leizhe
 * @Date: 2022-04-06 17:28:30
 * @LastEditTime: 2022-04-15 15:08:11
 * @LastEditors: leizhe
 */
import { get, post, postForm, PUBLISH_SERVICE, WebSERVICE } from '@/services/index';

export const typeList = param => get(`${WebSERVICE}/ModelType/ModelType/TypeList`, param);

export const modelManageList = param => get(`${WebSERVICE}/Models/Models/ModelManageList`, param);

export const SaveUpload = query =>
  post(`${WebSERVICE}/Models/Models/SaveUpload`, query, {
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8',
    },
  });

export const Save = param => get(`${WebSERVICE}/ModelType/ModelType/Save`, param);

export const deleteByModel = param => get(`${WebSERVICE}/Models/Models/DeleteByModel`, param);

export const UpdateModelType = param => get(`${PUBLISH_SERVICE}/ModelType/UpdateModelType`, param);

export const DelModelType = param => get(`${PUBLISH_SERVICE}/ModelType/DelModelType`, param);

export const Import = query =>
  post(`${WebSERVICE}/Models/Models/Import`, query, {
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8',
    },
  });

export const DownLoadModelType = query =>
  `${PUBLISH_SERVICE}/ModelType/DownLoadModelType?modelList=${query.modelList}`;

export const UpdateModelInfo = param => post(`${PUBLISH_SERVICE}/ModelType/UpdateModelInfo`, param);

export const GetBasicInfo = param => get(`${PUBLISH_SERVICE}/HostManager/GetBasicInfo`, param);

export const DownLoadModelTypeSingle = query =>
  `${PUBLISH_SERVICE}/ModelType/DownLoadModelTypeSingle?modeId=${query.modeId}`;

export const Export = query => `${WebSERVICE}/Models/Models/Export?Ids=${query.Ids}`;
