package com.jeequan.jeepay.core.interfaces;

import com.jeequan.jeepay.core.entity.MchApp;
import com.jeequan.jeepay.core.entity.MchApplyment;
import com.jeequan.jeepay.core.entity.TransferSubject;
import com.jeequan.jeepay.core.model.context.MchAppConfigContext;
import com.jeequan.jeepay.core.model.oauth2.Oauth2Params;
import com.jeequan.jeepay.core.model.params.IsvParams;
import com.jeequan.jeepay.core.model.params.IsvsubMchParams;
import com.jeequan.jeepay.core.model.params.NormalMchParams;

/**
 * 接口：  配置信息查询服务 （兼容 缓存 和 直接查询方式）
 *
 * @author terrfly
 *
 * @since 2021/11/18 14:41
 */
public interface IConfigContextQueryService {

    MchApp queryMchApp(String mchNo, String mchAppId);

    MchAppConfigContext queryMchInfoAndAppInfo(String mchAppId);

    MchAppConfigContext queryMchInfoAndAppInfo(String mchNo, String mchAppId);

    NormalMchParams queryNormalMchParams(String mchNo, String mchAppId, String ifCode);

    IsvsubMchParams queryIsvsubMchParams(String mchNo, String mchAppId, String ifCode);

    IsvsubMchParams queryNewIsvsubMchParams(String mchExtNo);

    IsvParams queryIsvParams(String isvNo, String ifCode);

    IsvParams queryTransferIsvParams(String isvNo, String ifCode);

    IsvParams queryTransferIsvParams(TransferSubject transferSubject);

    <T extends IsvParams> T queryIsvParams(MchApplyment mchApplyment);

    Oauth2Params queryIsvOauth2Params(String isvNo, String ifCode);

    Oauth2Params queryNormalOauth2Params(String mchNo, String mchAppId, String ifCode);

    <T> T queryOauth2Params(String infoType, String infoId, String ifCode, Class<T> cls);

    /**
     * 新版获取接口
     *
     * @param mchNo    商户号
     * @return
     */
    MchAppConfigContext queryMchInfoAndAppInfoV2(String mchNo, String mchAppId, String applyId);
}
