/*
 * @Description:
 * @Author: leizhe
 * @Date: 2022-04-06 17:28:30
 * @LastEditTime: 2022-05-19 19:31:58
 * @LastEditors: leizhe
 */
import { get, post, postForm, PUBLISH_SERVICE, WebSERVICE, CoreSERVICE } from '@/services/index';

export const typeList = param => get(`${PUBLISH_SERVICE}/ModelType/GetModelType`, param);
// export const typeList = param => get(`${CoreSERVICE}/ModelType/List`, param);

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

export const modelManageListAll = param => post(`${PUBLISH_SERVICE}/ModelType/GetModelInfo`, param);
// export const modelManageList = param => get(`${CoreSERVICE}/Model/ModelList`, param);

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

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

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

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

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

export const Import = query =>
  post(`${PUBLISH_SERVICE}/ModelType/UpLoadModel`, query, {
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8',
    },
  });
// export const Import = query =>
//   post(`${CoreSERVICE}/Model/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}`;

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