import request from '@/utils/request'

// 查询拼团送券活动列表
export function listGroupInfo(query) {
  return request({
    url: '/mapi/activity/groupInfo/list',
    method: 'get',
    params: query
  })
}

// 查询拼团送券活动详细
export function getGroupInfo(id) {
  return request({
    url: '/mapi/activity/groupInfo/getInfo',
    method: 'get',
    params:{id:id}
  })
}

// 新增拼团送券活动
export function addGroupInfo(data) {
  return request({
    url: '/mapi/activity/groupInfo',
    method: 'post',
    data: data
  })
}

// 修改拼团送券活动
export function updateGroupInfo(data) {
  return request({
    url: '/mapi/activity/groupInfo',
    method: 'put',
    data: data
  })
}

// 删除拼团送券活动
export function delGroupInfo(id) {
  return request({
    url: '/mapi/activity/groupInfo/' + id,
    method: 'delete'
  })
}


// 修改拼团送券活动状态
export function updateGroupInfoStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/activity/groupInfo/updateStatus',
    method: 'post',
    data: data
  })
}
