import request from '@/utils/request'

// 查询礼物流水列表
export function listUserGift(query) {
  return request({
    url: '/cai/userGift/list',
    method: 'get',
    params: query
  })
}

// 查询礼物流水详细
export function getUserGift(id) {
  return request({
    url: '/cai/userGift/' + id,
    method: 'get'
  })
}

export function getUserGiftByTraceId(traceId) {
  return request({
    url: '/cai/userGift/trace',
    method: 'get',
    params: {traceId}
  })
}

// 新增礼物流水
export function addUserGift(data) {
  return request({
    url: '/cai/userGift',
    method: 'post',
    data: data
  })
}

// 修改礼物流水
export function updateUserGift(data) {
  return request({
    url: '/cai/userGift',
    method: 'put',
    data: data
  })
}

// 删除礼物流水
export function delUserGift(id) {
  return request({
    url: '/cai/userGift/' + id,
    method: 'delete'
  })
}
