import service from '@/utils/request'
const api = {
  // 积分
  getIntegralList : data => {
    return service({
      url: '/point',
      method: 'get',
      params:data
    })
  },
  // 竞拍
  getAuctionList : data => { // 竞拍列表
    return service({
      url: '/auction',
      method: 'get',
      params:data
    })
  },
  addAucitonData: data => { // 创建竞拍
    return service({
      url: '/auction',
      method: 'post',
      data
    })
  },
  editAucitonData: data => { // 编辑竞拍
    return service({
      url: '/auction',
      method: 'put',
      data
    })
  },
  delAucitonData: data => { // 删除竞拍
    return service({
      url: '/auction',
      method: 'delete',
      data
    })
  },
  getDrawList: data => {
    return service({
      url: '/lottery',
      method: 'get',
      params:data
    })
  },
  addDrawData: data => { // 创建竞拍
    return service({
      url: '/lottery',
      method: 'post',
      data
    })
  },
  editDrawData: data => { // 编辑竞拍
    return service({
      url: '/lottery',
      method: 'put',
      data
    })
  },
  delDrawData: data => { // 删除竞拍
    return service({
      url: '/lottery',
      method: 'delete',
      data
    })
  },
  auctionStateFunc: data => { // 竞拍 上级、下架
    return service({
      url: '/auction/push',
      method: 'put',
      data
    })
  },
  drawStateFunc: data => { // 抽奖 上级、下架
    return service({
      url: '/lottery/push',
      method: 'put',
      data
    })
  },
  viewAutionDetail: data => { // 竞拍明细
    return service({
      url: '/auction/record',
      method: 'get',
      params:data
    })
  },
  freeze: data => { // 冻结积分
    return service({
      url: '/point/freeze/'+data.id,
      method: 'put'
    })
  },
  unfreeze:data => { // 解冻积分
    return service({
      url: '/point/unfreeze/'+data.id,
      method: 'put'
    })
  },
}
export default api
