package cn.pluss.platform.ys;

import com.alibaba.fastjson.JSONObject;
import org.springframework.core.io.ByteArrayResource;

import java.util.Map;

/**
 * 银盛通用service
 */
public interface YsService {

    String TYPE_AUDIT = "1";

    String TYPE_PAY = "2";

    String TYPE_OTHER = "3";


    JSONObject requestApi(String url, JSONObject reqData, String type);

    JSONObject requestApiCommon(String url, JSONObject reqData, String type);

    /**
     * 结果验签
     * @param responseData
     * @return
     */
    boolean checkSign(JSONObject responseData) throws Exception;

    /**
     * 旧版结果签名验签
     * @param responseData
     * @return
     */
    boolean oldCheckSign(JSONObject responseData,YsEnum ysEnum,String srcMerchantNo) throws Exception;


    JSONObject requestOldApiCommon(String url, JSONObject reqData, String type,YsEnum ysEnum,String srcMerchantNo);

    JSONObject requestOldApiCommon(String url, JSONObject reqData, String type, YsEnum ysEnum, Map<String, ByteArrayResource> fileMap,String srcMerchantNo);

    /**
     * 结果验签
     * @param responseData
     * @return
     */
    boolean checkSignOld(JSONObject responseData) throws Exception;

}
