SDK集成
SDK说明
SDK调用
下载SDK
引入SDK
<dependency>
<groupId>io.github.qixiangyun</groupId>
<artifactId>edf-agg-sdk</artifactId>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.4.1</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.70</version>
</dependency>
SDK调用
AggOpenAPI aggOpenAPI = new AggOpenAPI(apiHost, appKey, appSecret);
参数名称 | 参数类型 | 说明 |
---|---|---|
apiHost | String | 对接地址 |
appKey | String | 分配的账号 |
appSecret | String | 分配的秘钥 |
调用示例
AggOpenAPI aggOpenAPI = new AggOpenAPI(apiHost, appKey, appSecret);
JSONObject param = new JSONObject();
JSONObject result = new JSONObject();
JSONArray fpcyQueryList = new JSONArray();
JSONObject fpcy = new JSONObject();
fpcyQueryList.add(fpcy);
fpcy.put("fpdm", "11002121**");
fpcy.put("fphm", "092841**");
fpcy.put("kprq", "2021-09-06");
fpcy.put("je", 123.45);
param.put("cyList", fpcyQueryList);
// 通用接口调用,传入接口地址和业务参数(json 格式字符串)
result = openAPI.rest("/v2/invoice/cy", param.toJSONString());
System.out.println(JSON.toJSONString(result));