import { httpRequest } from '@/services/http'
import { HttpRequest } from '@/services/http/interface'
import { tradeServerRequest } from '@/services/socket/trade'
import { TradeRequest } from '@/services/socket/trade/interface'

/**
 * 银行签约
 */
export function t2bBankSign(params: TradeRequest<Partial<Proto.t2bBankSignReq>, Proto.t2bBankSignRsp>) {
    return tradeServerRequest('t2bBankSignReq', 't2bBankSignRsp', params);
}

/**
 * 银行解约
 */
export function t2bBankCancelSign(params: TradeRequest<Proto.t2bBankCancelSignReq, Proto.t2bBankCancelSignRsp>) {
    return tradeServerRequest('t2bBankCancelSignReq', 't2bBankCancelSignRsp', params);
}

/**
 * 出金申请
 */
export function t2bBankWithdraw(params: TradeRequest<Partial<Proto.t2bBankWithdrawReq>, Proto.t2bBankWithdrawRsp>) {
    return tradeServerRequest('t2bBankWithdrawReq', 't2bBankWithdrawRsp', params);
}

/**
 * 入金申请
 */
export function t2bBankDeposit(params: TradeRequest<Partial<Proto.t2bBankDepositReq>, Proto.t2bBankDepositRsp>) {
    return tradeServerRequest('t2bBankDepositReq', 't2bBankDepositRsp', params);
}

/**
 * 查询托管银行
 */
export function queryCusBankSignBank(params: HttpRequest<{ rsp: Ermcp.CusBankSignBankRsp[] }>) {
    return httpRequest('/Qhj/QueryCusBankSignBank', 'get', params);
}

/**
 * 查询开户行
 */
export function queryBankInfo(params: HttpRequest<{ rsp: Ermcp.BankInfoRsp[] }>) {
    return httpRequest('/Qhj/QueryBankInfo', 'get', params);
}

/**
 * 查询签约银行信息(提现账户管理)
 */
export function queryBankAccountSign(params: HttpRequest<{ req: Ermcp.BankAccountSignReq, rsp: Ermcp.BankAccountSignRsp[] }>) {
    return httpRequest('/Qhj/QueryBankAccountSign', 'get', params);
}

/**
 * 查询充值提现
 */
export function queryAccountInOutApply(params: HttpRequest<{ req: Ermcp.AccountInOutApplyReq, rsp: Ermcp.AccountOutInApplyRsp[] }>) {
    return httpRequest('/Qhj/QueryAccountInOutApply', 'get', params);
}