import request from '@/utils/request'

export function getList(query) {
  return request({
    url: '/product/cmMallOrganizeProducts/toProductList',
    method: 'get',
    params: query
  })
}

export function getModule(query) {
  return request({
    url: '/product/cmMallOrganizeProducts/module',
    method: 'get',
    params: query
  })
}

export function switchGoods(id) {
  return request({
    url: '/product/cmMallOrganizeProducts/switchLine/' + id,
    method: 'get'
  })
}

export function saveGoods(goods) {
  return request({
    url: '/product/cmMallOrganizeProducts/saveEditProductInfo',
    method: 'post',
    data: goods
  })
}

export function saveGoodsSort(sorts) {
  return request({
    url: '/product/cmMallOrganizeProducts/batchSaveSort',
    method: 'post',
    params: sorts
  })
}

export function getAddList(query) {
  return request({
    url: '/product/cmMallOrganizeProducts/toAddProduct1',
    method: 'get',
    params: query
  })
}

export function saveAddList(data) {
  return request({
    url: '/product/cmMallOrganizeProducts/saveAddProductInfo',
    method: 'post',
    data: data
  })
}

export function canncelProduct(data) {
  return request({
    url: '/product/cmMallOrganizeProducts/canncelProduct',
    method: 'post',
    data: data
  })
}
