import request from '@/utils/request'

export function getProductList(params) {
  return request({
    url: '/sale/manage/all-product/list',
    method: 'get',
    params
  })
}

export function addProductInfo(params) {
  return request({
    url: '/sale/manage/all-product/save',
    method: 'post',
    data: params
  })
}

export function updateProductInfo(params) {
  return request({
    url: '/sale/manage/all-product/update',
    method: 'post',
    data: params
  })
}

export function deleteProduct(id) {
  return request({
    url: `/sale/manage/all-product/${id}`,
    method: 'delete'
  })
}

export function updateProductInventory(params) {
  return request({
    url: '/sale/manage/all-product/change-inventory',
    method: 'post',
    data: params
  })
}

export function getProductDetailsList(params) {
  return request({
    url: '/sale/manage/all-product-detail/list',
    method: 'get',
    params
  })
}
