package com.friday.custody.service.trustService.haitong.common;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description
 * @Author wulifeng
 * @Date: 2022/3/22
 */
@Slf4j
public class HaiTongConstants {
    public static final String TEST_PRE_URL = "https://testgateway.htsec.com:8443"; //产品信息查询
    public static final String PRO_PRE_URL = "https://institutional-apihub.haitong.com:8443"; //产品信息查询

    // 产品信息查询
    public static final String FUND_INFO_API = "/jjtgb/ta/queryProductInfo";
    // 投资者信息查询
    public static final String CUST_INFO_API = "/jjtgb/ta/queryCustInfo";
    // 份额持有人查询
    public static final String CUST_SHARE_INFO_API = "/jjtgb/ta/queryCustShareInfo";
    // 交易确认查询
    public static final String FUND_TRADE_INFO_API = "/jjtgb/ta/queryConfirmInfo";
    // 业绩报酬数据查询
    public static final String FUND_PROFIT_INFO_API = "/jjtgb/ta/queryProfitCurrents";
    // 份额明细查询
    public static final String CUST_SHARE_DETAIL_INFO =  "/jjtgb/ta/queryShareDetail";
    // 产品费用计提余额查询
    public static final String FUND_FEE_DATA_INFO = "/jjtgb/wbgz/queryDeductionDetailBal";
    // 净值查询
    public static final String FUND_NET_VALUE_INFO = "/jjtgb/wbgz/queryFundNetValue";
    // 查询募集户当日余额信息
    public static final String MJ_ACCOUNT_BALANCE_INFO = "/jjtgb/zjqs/queryBankAccBal";
    // 银行账户余额本地查询
    public static final String ACCOUNT_INFO = "/jjtgb/tgqs/queryAccountBal";
    // 银行账户余额实时联机查询
    public static final String TGACCOUNT_BALANCE_INFO = "/jjtgb/tgqs/queryOnlineAccountBal";
    // 查询募集户银行流水
    public static final String RAISING_ACCOUNT_FLOW = "/jjtgb/zjqs/queryRaisingAccountFlow";
    // 银行账户流水本地查询
    public static final String QUERY_ACCOUNT_JOURNAL = "/jjtgb/tgqs/queryAccountJournal";
    // 银行账户流水实时联机查询
    public static final String QUERY_ACCOUNT_JOURNAL_ONLINE = "/jjtgb/tgqs/queryAccountJournalOnline";
    // 基金开放日查询
    public static final String FUND_OPEN_INFO = "/jjtgb/ta/queryFundOpenInfo";

    public static final String T0201 = "/jjtgb/zx/queryAccoapply";
    public static final String T0202 = "/jjtgb/zx/queryTransApply";
    public static final String T0206 = "/jjtgb/ta/queryFundOpenInfo";
    public static final String T0208 = "/jjtgb/ta/queryConfirmDetail";
    public static final String T0209 = "/jjtgb/ta/queryAccoConfirmInfo";
    public static final String T0211 = "/jjtgb/ta/queryBonusDetail";



    //测试
    public static final String TEST_1 =  "/jjtgb/zx/queryTransApply";
    public static final String TEST_2 =  "/jjtgb/ta/queryFundOpenInfo";
    public static final String TEST_3 =  "/jjtgb/ta/queryConfirmDetail";
    public static final String TEST_4 =  "/jjtgb/ta/queryAccoConfirmInfo";
    public static final String TEST_5 =  "/jjtgb/ta/queryProfitCurrents";
    public static final String TEST_6 =  "/jjtgb/zx/queryAccoapply";
    public static final String TEST_7 =  "/jjtgb/ta/queryBonusDetail";

    //测试
    public static final String TEST_CLIENTID = "e7QEroOn" ;
    public static final String TEST_LICENSE = "91310120332386472R" ;
    public static final String TEST_APPSECRET = "4fd06f5d5bf2836c50603d369ca05670a46ad4fdd8b658c7e9da4568c3409c84" ;
    public static final String TEST_PUBLICKEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCKJlOlGagKYjRxt+bDiFT2ReFIetJT9lGWjvokqUh7mnrKHRvJL39Bdy9FBiCkSHDuqg1lja5o69ZY4IQf3CSTbrMYcUsiOWad/tfoHLPjH4steGsPX+0agYagMriQF7O01mIhD80ynhmmp9pTVTxj+A12c0636pMVIFKdxIRLwwIDAQAB";
    public static final String TEST_PRIVATEKEY = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAIomU6UZqApiNHG35sOIVPZF4Uh60lP2UZaO+iSpSHuaesodG8kvf0F3L0UGIKRIcO6qDWWNrmjr1ljghB/cJJNusxhxSyI5Zp3+1+gcs+Mfiy14aw9f7RqBhqAyuJAXs7TWYiEPzTKeGaan2lNVPGP4DXZzTrfqkxUgUp3EhEvDAgMBAAECgYAH4KGaY3kihnEJHvxon+iAVoG/GUnPAderJyH6XzDD444m4jwIX8341Kv8WpoX5A2UflvfM5IDZ5dEYCEIlAv9yiO8mfZrJOpuiioPACKdKBEk2VlcUd7PcGQ/GLbvVCiODaKV8dzMvRgksMBTRDAAJT+1XjfvOBMWP2uoX5L0GQJBAO2ijAhMbrLO9P9qfK5LhVFYwGRJ2LyHLAzIHH5wcwuIe3k85/+RBccalD9CHkY9LNQNFgbMmc1GdyWyFKyA3ccCQQCU04duEBgRIwjuZbxj0OI+7ykoQW7dRneE3T1I3XMVFRUuPqquXDGkcspH6sDor1EWLHN5F6HY6UOWV+9sUdIlAkATVlfY0QdtC4RKSIsOz9xway10u8GkTcea3qna7CGgfaG2kus6E74JnrMTlrjJ9G5ybwIs2XdmieZmLeCazP2/AkEAhy2nGoKFybL/3sILnsJRbgZ/ZLAiSdxCnSzzCGcUq7aNmYaUM3FMKemV8EK7W946EaDodbnQaRxfJoTS1Jlw/QJBALYWFpmErv/WFKuSvt0zhHREtAmzvVgAR6AEEWAcQZ7QSRppyURrmwYlbxRvvOzh6WuGravI0BtsP4dyspusB88=";

    //通怡
    public static final String TY_CLIENTID = "6MJePzWn";
    public static final String TY_LICENSE = "91310120332386472R" ;
    public static final String TY_APPSECRET = "4fd06f5d5bf2836c50603d369ca05670a46ad4fdd8b658c7e9da4568c3409c84" ;
    public static final String TY_PUBLICKEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCF4wY4pHnUvAh0M0tByN2QA5yz4iHHo961JEi1YwdVkneEFracTDRXxCC8uQmeRoFONMBlvw+th81Z2e1ReV4eGzaSwLSnOPCddwud4FdszguW2TC2j0ig3CRND1K9m/bzgdIdrw/3xIGVpcrf8lVOBc0EoGVU34W9emXrFKF1tQIDAQAB";
    public static final String TY_PRIVATEKEY = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAIXjBjikedS8CHQzS0HI3ZADnLPiIcej3rUkSLVjB1WSd4QWtpxMNFfEILy5CZ5GgU40wGW/D62HzVnZ7VF5Xh4bNpLAtKc48J13C53gV2zOC5bZMLaPSKDcJE0PUr2b9vOB0h2vD/fEgZWlyt/yVU4FzQSgZVTfhb16ZesUoXW1AgMBAAECgYB8YpwnB3dAUqiv+++Q4GInJ5Pv8shbRzzioSEDk0r/DyIGD2v77Tg7ybR4YJg0+V+sHooYfNa96wq2zSYTqWPry9bbKv7R7vG4ueVpmRGnPNSKSBZpPqIIPZrN5/GLVif62WpEfFX79e5KL13Lot5OHgdATYW9x942m6lI9zBpQQJBANn+rWDN8VlOQX/CgAHDlG2Jy159mTWME6JtQyvohzos/hDld/U2EVu/szH0rd7wYpyoatQPU10TNj3o0OJH8u0CQQCdOoYZd1XtEtD4+9JjBmBtPUoGrPQbjcjfhbq4rGdonJH/OC/vtbj7uSFSH90w4IE8O3joHqBI1hUQz9zVQ0zpAkEAswmQ2d2qZ992ufhDa692uxQdvAhJiYn3IkK8lVZPob8MF1JvWCxEy2bBRLkhB+XEB8fmnS3NGLdLqEMLM51F7QJAKBkm3hPLPD0SQo2mqE6WBQYefPlbADP2yNrINhTyAoH70gU4ZIAJ/1jFoLYzqSV4kC3ytfApnKnMkY8RmOojEQJBAKp1zCveIFfTqdKWJmJSamxPJ97/CdwBklu1w7YDnbgjMCYcnOA4GGNue6MX/nv0PxQpxtx5wV48arcgesc7tp8=";

    public String clientId;
    public String license;
    public String appSecret;
    public String publicKey;
    public String privateKey;
    public String url;

    public void setPropertyFromJsonHaiTong(String mapJson) {
        Map map = JSON.parseObject(mapJson, Map.class);
        log.info("setPropertyFromJsonGTJA设置托管信息为{}",JSON.toJSONString(map));

        clientId =(String) map.get("clientId");
        license =(String) map.get("license");
        appSecret =(String) map.get("appSecret");
        publicKey =(String) map.get("publicKey");
        privateKey =(String) map.get("privateKey");
        url =(String) map.get("url");
    }

    public static void main(String[] args) {
        Map map = new HashMap();

//        //test
//        map.put("clientId","e7QEroOn");
//        map.put("license","91310120332386472R");
//        map.put("appSecret","4fd06f5d5bf2836c50603d369ca05670a46ad4fdd8b658c7e9da4568c3409c84");
//        map.put("publicKey","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCKJlOlGagKYjRxt+bDiFT2ReFIetJT9lGWjvokqUh7mnrKHRvJL39Bdy9FBiCkSHDuqg1lja5o69ZY4IQf3CSTbrMYcUsiOWad/tfoHLPjH4steGsPX+0agYagMriQF7O01mIhD80ynhmmp9pTVTxj+A12c0636pMVIFKdxIRLwwIDAQAB");
//        map.put("privateKey","MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAIomU6UZqApiNHG35sOIVPZF4Uh60lP2UZaO+iSpSHuaesodG8kvf0F3L0UGIKRIcO6qDWWNrmjr1ljghB/cJJNusxhxSyI5Zp3+1+gcs+Mfiy14aw9f7RqBhqAyuJAXs7TWYiEPzTKeGaan2lNVPGP4DXZzTrfqkxUgUp3EhEvDAgMBAAECgYAH4KGaY3kihnEJHvxon+iAVoG/GUnPAderJyH6XzDD444m4jwIX8341Kv8WpoX5A2UflvfM5IDZ5dEYCEIlAv9yiO8mfZrJOpuiioPACKdKBEk2VlcUd7PcGQ/GLbvVCiODaKV8dzMvRgksMBTRDAAJT+1XjfvOBMWP2uoX5L0GQJBAO2ijAhMbrLO9P9qfK5LhVFYwGRJ2LyHLAzIHH5wcwuIe3k85/+RBccalD9CHkY9LNQNFgbMmc1GdyWyFKyA3ccCQQCU04duEBgRIwjuZbxj0OI+7ykoQW7dRneE3T1I3XMVFRUuPqquXDGkcspH6sDor1EWLHN5F6HY6UOWV+9sUdIlAkATVlfY0QdtC4RKSIsOz9xway10u8GkTcea3qna7CGgfaG2kus6E74JnrMTlrjJ9G5ybwIs2XdmieZmLeCazP2/AkEAhy2nGoKFybL/3sILnsJRbgZ/ZLAiSdxCnSzzCGcUq7aNmYaUM3FMKemV8EK7W946EaDodbnQaRxfJoTS1Jlw/QJBALYWFpmErv/WFKuSvt0zhHREtAmzvVgAR6AEEWAcQZ7QSRppyURrmwYlbxRvvOzh6WuGravI0BtsP4dyspusB88=");
//        map.put("url","https://testgateway.htsec.com:8443");

        //通怡
        map.put("clientId","6MJePzWn");
        map.put("license","91310120332386472R");
        map.put("appSecret","4fd06f5d5bf2836c50603d369ca05670a46ad4fdd8b658c7e9da4568c3409c84");
        map.put("publicKey","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCF4wY4pHnUvAh0M0tByN2QA5yz4iHHo961JEi1YwdVkneEFracTDRXxCC8uQmeRoFONMBlvw+th81Z2e1ReV4eGzaSwLSnOPCddwud4FdszguW2TC2j0ig3CRND1K9m/bzgdIdrw/3xIGVpcrf8lVOBc0EoGVU34W9emXrFKF1tQIDAQAB");
        map.put("privateKey","MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAIXjBjikedS8CHQzS0HI3ZADnLPiIcej3rUkSLVjB1WSd4QWtpxMNFfEILy5CZ5GgU40wGW/D62HzVnZ7VF5Xh4bNpLAtKc48J13C53gV2zOC5bZMLaPSKDcJE0PUr2b9vOB0h2vD/fEgZWlyt/yVU4FzQSgZVTfhb16ZesUoXW1AgMBAAECgYB8YpwnB3dAUqiv+++Q4GInJ5Pv8shbRzzioSEDk0r/DyIGD2v77Tg7ybR4YJg0+V+sHooYfNa96wq2zSYTqWPry9bbKv7R7vG4ueVpmRGnPNSKSBZpPqIIPZrN5/GLVif62WpEfFX79e5KL13Lot5OHgdATYW9x942m6lI9zBpQQJBANn+rWDN8VlOQX/CgAHDlG2Jy159mTWME6JtQyvohzos/hDld/U2EVu/szH0rd7wYpyoatQPU10TNj3o0OJH8u0CQQCdOoYZd1XtEtD4+9JjBmBtPUoGrPQbjcjfhbq4rGdonJH/OC/vtbj7uSFSH90w4IE8O3joHqBI1hUQz9zVQ0zpAkEAswmQ2d2qZ992ufhDa692uxQdvAhJiYn3IkK8lVZPob8MF1JvWCxEy2bBRLkhB+XEB8fmnS3NGLdLqEMLM51F7QJAKBkm3hPLPD0SQo2mqE6WBQYefPlbADP2yNrINhTyAoH70gU4ZIAJ/1jFoLYzqSV4kC3ytfApnKnMkY8RmOojEQJBAKp1zCveIFfTqdKWJmJSamxPJ97/CdwBklu1w7YDnbgjMCYcnOA4GGNue6MX/nv0PxQpxtx5wV48arcgesc7tp8=");
        map.put("url","https://institutional-apihub.haitong.com:8443");

        System.out.println(JSON.toJSONString(map));
    }
}
