import request from '@/utils/request'

// 查询拼团活动列表
export function listGroupBuy(query) {
  return request({
    url: '/product/groupBuy/list',
    method: 'get',
    params: query
  })
}

// 查询拼团活动详细
export function getGroupBuy(id) {
  return request({
    url: '/product/groupBuy/' + id,
    method: 'get'
  })
}

// 新增拼团活动
export function addGroupBuy(data) {
  return request({
    url: '/product/groupBuy',
    method: 'post',
    data: data
  })
}

// 修改拼团活动
export function updateGroupBuy(data) {
  return request({
    url: '/product/groupBuy/'+data.id,
    method: 'put',
    data: data
  })
}

// 删除拼团活动
export function delGroupBuy(id) {
  return request({
    url: '/product/groupBuy/' + id,
    method: 'delete'
  })
}
