import { request } from 'umi';

export async function queryList(param) {
  return request(`/plant-global-info/list/${param.ProjectId}`)
}

export async function queryItem(param) {
  return request(`/plant-global-info/item/${param.id}`)
}

export async function queryUserList(param) {
  return request(`api/v1/user/project/${param.projectId}`)
}

export async function updateItem(param) {
  return request(`/plant-global-info/item`, {
    method: 'PUT',
    body: {
      ...param
    },
  })
}

export async function createItem(param) {
  return request(`/plant-global-info/item`, {
    method: 'POST',
    body: {
      ...param
    },
  })
}

export async function removeItem(Id) {
  return request(`/plant-global-info/item/${Id}`, {
    method: 'DELETE',
  })
}

export async function getInfoDetail(param) {
  return request(`/plant-global-info/item/${param.detailId}/detail`)
}

export async function removeInfoDetailList(param) {
  return request(`/plant-global-info/item/${param.detailId}/file/${param.Id}`, {
    method: 'DELETE',
  })
}

export async function changeInfoStatus(param) {
  return request(`/plant-global-info/item`, {
    method: 'PATCH',
    body: JSON.stringify(param),
  })
}

