import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/redenvelopemall/goodsspec/list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/redenvelopemall/goodsspec/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/redenvelopemall/goodsspec/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/redenvelopemall/goodsspec/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/redenvelopemall/goodsspec/submit',
    method: 'post',
    data: row
  })
}

export const batchOnSale = (ids) => {
  return request({
    url: '/api/redenvelopemall/goodsspec/batchOnSale',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const batchShelves = (ids) => {
  return request({
    url: '/api/redenvelopemall/goodsspec/batchShelves',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const batchModifyPrice = (ids, salePrice) => {
  return request({
    url: '/api/redenvelopemall/goodsspec/batchModifyPrice',
    method: 'post',
    params: {
      ids,
      salePrice
    }
  })
}

