import { AxiosPromise } from "axios";
import request from "../request";

export interface CashoutRes extends Common.Res {
	data: {};
}

class CashOut {
	/**
	 * 查询收益列表
	 * @returns
	 */
	extensionIncomeList(): AxiosPromise<CashOutType.extensionIncomeListRes> {
		return request("/student/extension/income/extensionIncomeList");
	}

	extensionIncomePrice(): AxiosPromise<CashOutType.extensionIncomePriceRes> {
		return request("/student/extension/income/extensionIncomePrice");
	}

	/**查询提现记录 */
	extractList(): AxiosPromise<CashOutType.ExtractList> {
		return request("/wx/extract/list");
	}

	/**微信提现 */
	cashout(params: { amount: number }): AxiosPromise<CashoutRes> {
		return request("wx/extract/withdraw", {
			params,
			method: "post",
		});
	}
}

export const cashOut = new CashOut();
