import request from '@/utils/request'

// 查询商品分类列表
export function listCategory(query) {
  return request({
    url: '/his/storeProductCategory/list',
    method: 'get',
    params: query
  })
}
// 查询商品分类列表
export function getAllStoreProductCategory() {
  return request({
    url: '/his/storeProductCategory/getAllList',
    method: 'get',
  })
}
export function getPidList() {
  return request({
    url: '/his/storeProductCategory/getPidList' ,
    method: 'get'
  })
}
// 查询商品分类父列表
export function pidlist() {
  return request({
    url: '/his/storeProductCategory/pid/list',
    method: 'get'
  })
}
// 查询商品分类详细
export function getCategory(cateId) {
  return request({
    url: '/his/storeProductCategory/' + cateId,
    method: 'get'
  })
}

// 新增商品分类
export function addCategory(data) {
  return request({
    url: '/his/storeProductCategory',
    method: 'post',
    data: data
  })
}

// 修改商品分类
export function updateCategory(data) {
  return request({
    url: '/his/storeProductCategory',
    method: 'put',
    data: data
  })
}

// 删除商品分类
export function delCategory(cateId) {
  return request({
    url: '/his/storeProductCategory/' + cateId,
    method: 'delete'
  })
}

// 导出商品分类
export function exportCategory(query) {
  return request({
    url: '/his/storeProductCategory/export',
    method: 'get',
    params: query
  })
}
