import request from '@/utils/request'

// 分页查询换购商品列表
export function pageListGoods(query) {
  return request({
    url: '/exchange/goods/pageList',
    method: 'get',
    params: query
  })
}

// 查询换购商品列表
export function listGoods(query) {
  return request({
    url: '/exchange/goods/list',
    method: 'get',
    params: query
  })
}

// 查询换购商品详细
export function getGoods(id) {
  return request({
    url: '/exchange/goods/' + id,
    method: 'get'
  })
}

// 新增换购商品
export function addGoods(data) {
  return request({
    url: '/exchange/goods',
    method: 'post',
    data: data
  })
}

// 修改换购商品
export function updateGoods(data) {
  return request({
    url: '/exchange/goods',
    method: 'put',
    data: data
  })
}

// 删除换购商品
export function delGoods(id) {
  return request({
    url: '/exchange/goods/' + id,
    method: 'delete'
  })
}

// 导出换购商品
export function exportGoods(query) {
  return request({
    url: '/exchange/goods/' + 'export',
    method: 'post',
    params: query
  })
}
