import request from '@/utils/request'

export function getCategory(query) {
  return request({
    url: '/product/cmMallProductsClassify/list',
    method: 'get',
    params: query
  })
}

export function switchClassify(id) {
  return request({
    url: '/product/cmMallProductsClassify/switchClassify',
    method: 'post',
    params: id
  })
}

export function getClassify(id) {
  return request({
    url: '/product/cmMallProductsClassify/form',
    method: 'post',
    params: id
  })
}

export function saveClassify(category) {
  return request({
    url: '/product/cmMallProductsClassify/save',
    method: 'post',
    data: category
  })
}

export function saveCategorySort(newProducSorttList) {
  return request({
    url: '/product/cmMallProductsClassify/batchSaveSort',
    method: 'post',
    params: newProducSorttList
  })
}
