import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { WithdrawQuery, WithdrawVO } from './types';

/**
 * 查询余额提现列表
 */
export function listWithdraw(query: WithdrawQuery): AxiosPromise<WithdrawVO[]> {
  return request({
    url: '/system/withdraw/list',
    method: 'get',
    params: query
  });
}

/**
 * 审核通过
 */
export function auditPassWithdraw(id: string | number, remark?: string, fileUrl?: string) {
  return request({
    url: '/system/withdraw/audit/pass/' + id,
    method: 'post',
    params: {
      remark: remark || '',
      fileUrl: fileUrl || ''
    }
  });
}

/**
 * 审核驳回
 */
export function auditRejectWithdraw(id: string | number, remark: string, fileUrl?: string) {
  return request({
    url: '/system/withdraw/audit/reject/' + id,
    method: 'post',
    params: {
      remark,
      fileUrl: fileUrl || ''
    }
  });
}
