import { request } from "./request";
// /unique/code/getMaterialInfo
// 列表：物料列表
const getMaterial = (params) => {
  return request("/worn/material/list", params, 'GET');
};
// 列表：唯一码列表
const getUniqueCodeList = (params) => {
  return request("/unique/code/list", params, 'GET');
};
// 新增：唯一码
const addUniqueCode = (params) => {
  return request("/unique/code/add", params, "POST");
};
// 编辑：唯一码
const editUniqueCode = (params) => {
  return request("/unique/code", params, "PUT");
};
// 删除：唯一码
const delUniqueCode = (params) => {
  return request("/remove", params, "POST");
};
// 详情：唯一码
const detailUniqueCode = (params) => {
  return request(`/unique/code/${params.id}`, params, 'GET');
};
// 扫码：通过唯一码获取物料信息
const getMaterialUnique = (params) => {
  return request(`/unique/code/materialInfo/${params.code}`, params, 'GET');
};
// 详情：通过唯一码获取物料信息
const getMaterialByQrCodeInfo = (params) => {
  return request('/unique/code/getMaterialInfo', params, 'POST');
};

export {
  getMaterial,
  getUniqueCodeList,
  addUniqueCode,
  delUniqueCode,
  detailUniqueCode,
  editUniqueCode,
  getMaterialUnique,
  getMaterialByQrCodeInfo
};
