// @ts-ignore

/* eslint-disable */
import { request } from 'umi';

/** 获取商品类型  sdsa GET /kitchen/api/rule */
export async function goodsType(data) {
  return request(`/saasbase/api/goodstype/page`, {
    method: 'POST',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}
/** 新建商品类型 POST /kitchen/api/rule */
export async function GetDicList(TypeCode) {
  return request(`/saasbase/api/dict-data/dic-list/${TypeCode}`, {
    method: 'Get',
  });
}

export async function addGoodsType(data) {
  // http://localhost:5001
  return request('/saasbase/api/goodstype/add', {
    method: 'POST',
    // type:'json',
    data: data,
    // ...(options || {}),
  });
}

/** 更新商品类型 PUT /kitchen/api/rule */

export async function updateGoodsType(data) {
  return request('/saasbase/api/goodstype/update', {
    method: 'POST',
    data: data,
    // ...(options || {}),
  });
}

/** 删除商品类型 DELETE /kitchen/api/rule */

export async function removeGoodsTypes(data) {
  return request(`/saasbase/api/goodstype/delete`, {
    method: 'GET',
    data: data,
    // ...(options || {}),
  });
}
export async function DeleteGoodsType(data) {
  return request(`/saasbase/api/goodstype/delete?id=${data}`, {
    method: 'Get'
  });
}
export async function DeleteGoodsTypes(data) {
  return request(`/saasbase/api/goodstype/deletebyids`, {
    method: 'post',
    data: data,
  });
}
export async function gettree(params) {
  return request('​/saasbase/api​/goodstype/tree', {
    method: 'GET',
    data: {
      ...params,
    },
  });
}

