import request from '@/config/axios'

// 提现申请记录 VO
export interface ApplicationForWithdrawalVO {
  // 申请id
  id: number
  // 用户ID
  userId: number
  // 提现渠道类型
  withdrawalType: number
  // 提现金额,单位:元
  amount: number
  // 支付宝账号
  withdrawalAccount: string
  // 提现状态,已完成是1，未完成为0
  status: boolean
  // 提现渠道记录id
  applicationForWithdrawalChannelId: number
}

// 提现申请记录 API
export const ApplicationForWithdrawalApi = {
  // 查询提现申请记录分页
  getApplicationForWithdrawalPage: async (params: any) => {
    return await request.get({ url: `/distri/application-for-withdrawal/page`, params })
  },

  // 查询提现申请记录详情
  getApplicationForWithdrawal: async (id: number) => {
    return await request.get({ url: `/distri/application-for-withdrawal/get?id=` + id })
  },

  // 新增提现申请记录
  createApplicationForWithdrawal: async (data: ApplicationForWithdrawalVO) => {
    return await request.post({ url: `/distri/application-for-withdrawal/create`, data })
  },

  // 修改提现申请记录
  updateApplicationForWithdrawal: async (data: ApplicationForWithdrawalVO) => {
    return await request.put({ url: `/distri/application-for-withdrawal/update`, data })
  },

  // 删除提现申请记录
  deleteApplicationForWithdrawal: async (id: number) => {
    return await request.delete({ url: `/distri/application-for-withdrawal/delete?id=` + id })
  },

  // 导出提现申请记录 Excel
  exportApplicationForWithdrawal: async (params) => {
    return await request.download({ url: `/distri/application-for-withdrawal/export-excel`, params })
  }
}