import request from '@/config/axios'

// 提现渠道记录 VO
export interface ApplicationForWithdrawalChannelVO {
  // 提现渠道id
  id: number
  // 提现渠道类型
  withdrawalType: number
  // 提现渠道名称
  withdrawalName: string
  // 提现金额,单位:元
  amount: number
  // 提现笔数
  count: number
  // 提现状态,已完成是1，未完成为0
  status: boolean
  // 提现渠道记录id
  ptDailyWithdrawalId: number
}

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

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

  // 新增提现渠道记录
  createApplicationForWithdrawalChannel: async (data: ApplicationForWithdrawalChannelVO) => {
    return await request.post({ url: `/distri/application-for-withdrawal-channel/create`, data })
  },

  // 修改提现渠道记录
  updateApplicationForWithdrawalChannel: async (data: ApplicationForWithdrawalChannelVO) => {
    return await request.put({ url: `/distri/application-for-withdrawal-channel/update`, data })
  },

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

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