import request from '@/utils/request'

// 查询直播商品列表
export function listLiveGoods(query) {
  return request({
    url: '/live/liveGoods/list',
    method: 'get',
    params: query
  })
}

// 查询直播商品详细
export function getLiveGoods(goodsId) {
  return request({
    url: '/live/liveGoods/' + goodsId,
    method: 'get'
  })
}

// 新增直播商品
export function addLiveGoods(data) {
  return request({
    url: '/live/liveGoods',
    method: 'post',
    data: data
  })
}

// 修改直播商品
export function updateLiveGoods(data) {
  return request({
    url: '/live/liveGoods',
    method: 'put',
    data: data
  })
}

// 删除直播商品
export function delLiveGoods(goodsId) {
  return request({
    url: '/live/liveGoods/' + goodsId,
    method: 'delete'
  })
}

// 导出直播商品
export function exportLiveGoods(query) {
  return request({
    url: '/live/liveGoods/export',
    method: 'get',
    params: query
  })
}

// 导出直播商品
export function listStoreProduct(data) {
  return request({
    url: '/live/liveGoods/liveList',
    method: 'get',
    params: data
  })
}

//上下架商品
export function handleShelfOrUn(data) {
  return request({
    url: '/live/liveGoods/handleShelfOrUn',
    method: 'post',
    data: data
  })
}


export function handleDeleteSelected(data) {
  return request({
    url: '/live/liveGoods/handleDeleteSelected',
    method: 'post',
    data: data
  })
}

export function handleIsShowChange(data) {
  return request({
    url: '/live/liveGoods/handleIsShowChange',
    method: 'post',
    data: data
  })
}
export function updateGoodsStock(data) {
  return request({
    url: '/live/liveGoods',
    method: 'put',
    data: data
  })
}

