import request from '@/utils/request'

export function getGoodsList(urlParams, data) {
  return request({
    url: '/api/v1/mp/admin/goods/list',
    method: 'post',
    data,
    urlParams
  })
}

export function getGoodsDetail(goodsId) {
  return request({
    url: '/api/v1/mp/admin/goods/detail',
    method: 'post',
    data: {
      goodsId
    }
  })
}

export function addGoods(data) {
  return request({
    url: `/api/v1/mp/admin/goods/${data.goodsId ? 'update' : 'create'}`,
    method: 'post',
    data
  })
}

export function delGoods(goodsId) {
  return request({
    url: '/api/v1/mp/admin/goods/remove',
    method: 'post',
    data: { goodsId }
  })
}

export function setGoodsStatus(data) {
  return request({
    url: '/api/v1/mp/admin/goods/status',
    method: 'post',
    data
  })
}
export function setTableData(data) {
  return request({
    url: '/api/v1/mp/admin/goods/update/sortWeight',
    method: 'post',
    data,
  })
}

