package com.chinacreator.process;

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

import org.n3r.ecaop.client.EcAopClient;
import org.n3r.ecaop.client.EcAopMethod;
import org.n3r.ecaop.client.EcAopResult;
import org.n3r.ecaop.client.SignAlgorithm;

import com.chinacreator.process.util.JsonUtil;

public class MainGetCount {

	public static void main(String[] args) {
		String url = "http://211.94.67.94:8001/openservlet";//调用开放平台地址
        String appkey = "com.aop.app.unicomonline";//渠道编码
        String signSecurity ="swUiuzms+bAqgNOhTaJAyaTFVdAhGaG2aPCUJ0o72P/dSFj8aRbFDOXjPTBB5oja9plfRNWgTKP1OFWBF2F85A==";//调用私钥
        EcAopClient  aopClient = new EcAopClient(url, appkey, signSecurity);
        aopClient.setSignAlgorithm(SignAlgorithm.MD5);
        aopClient.setTimeoutMillis(1000000);
        String method = "com.ssp.method.tencentvideovipinform";//接口编码
        EcAopMethod ecAopMethod = aopClient.createEcAopMethod(method, Map.class);
        Map<String,String> reqMap = new HashMap<String,String>();
        reqMap.put("apptx", "" + System.currentTimeMillis());//调用流水，要求不重复
        reqMap.put("outorder", "" + System.currentTimeMillis());//业务参数
        reqMap.put("usernumber", "18574414678");//业务参数
        reqMap.put("usertype", "1");//业务参数
        reqMap.put("userval", "306581007");//业务参数
        reqMap.put("busitime", "20180508101323");//业务参数
        reqMap.put("resultcode", "0");//业务参数
        reqMap.put("resultinfo", "");//业务参数
        EcAopResult result = ecAopMethod.exec(reqMap);
        System.out.println(JsonUtil.jsonToMap(result.getResponse()));

	}
}
