import request from '@/utils/request'

// 查询提现列表
export function listWithdraw(query) {
  return request({
    url: '/bst/withdraw/list',
    method: 'get',
    params: query
  })
}

// 查询提现详细
export function getWithdraw(id) {
  return request({
    url: '/bst/withdraw/' + id,
    method: 'get'
  })
}

// 新增提现
export function addWithdraw(data) {
  return request({
    url: '/bst/withdraw',
    method: 'post',
    data: data
  })
}

// 修改提现
export function updateWithdraw(data) {
  return request({
    url: '/bst/withdraw',
    method: 'put',
    data: data
  })
}

// 删除提现
export function delWithdraw(id) {
  return request({
    url: '/bst/withdraw/' + id,
    method: 'delete'
  })
}

// 提现审核
export function verifyWithdraw(data) {
  return request({
    url: '/bst/withdraw/verify',
    method: 'put',
    data: data
  })
}

// 查询提现服务费
export function calcWithdrawAmount(amount, userId) {
  return request({
    url: '/bst/withdraw/calcAmount',
    method: 'get',
    params: {
      amount,
      userId
    }
  })
}
