import { httpRequest } from '@/services/http'
import { HttpParams } from '@/services/http/interface'
import { tradeServerRequest } from '@/services/socket/trade'
import { TradeParams } from '@/services/socket/trade/interface'

/**
 * 账户资金信息请求
 */
export function accountFundInfoReq(params: TradeParams<Partial<Proto.AccountFundInfoReq>, Proto.AccountFundInfoRsp>) {
    return tradeServerRequest('AccountFundInfoReq', 'AccountFundInfoRsp', params);
}

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

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

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

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

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

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

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

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

/**
 * 资金流水查询（历史）
 */
export function queryHisAmountLog(params: HttpParams<{ req: Model.HisAmountLogReq, rsp: Model.HisAmountLogRsp[] }>) {
    return httpRequest('/TaAccount/QueryHisAmountLog', 'get', params);
}

/**
 * 资金流水查询（当前）
 */
 export function queryAmountLog(params: HttpParams<{ req: Model.AmountLogReq, rsp: Model.AmountLogRsp[] }>) {
    return httpRequest('/TaAccount/QueryAmountLog', 'get', params);
}

