合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
```/** * Created by wangweiguo on 18/12/14. */ import net.sf.json.JSONObject; import java.util.HashMap; import java.util.Map; public class App { public static void main(String[] args) { //登陆接口: String loginUrl = "https://dubbo.wellsign.cn/dandanqiantest/api/index.php/Conv/User/login"; String loginParam = "accessKey=test&accessSecret=test&clientId=zj1214&clientType=PC"; String loginSuccess = HttpRequest.sendPost(loginUrl, loginParam); JSONObject jsonLogin = JSONObject.fromObject(loginSuccess); System.out.print(jsonLogin); //登陆成功后纪录token String token = jsonLogin.getString("access_token"); //请生成签字链接 String signUrl = "https://dubbo.wellsign.cn/dandanqiantest/api/Conv/MultipartFile/http/v0.1"; //本地PDF文件地址,本地调试的话换成你自己的 String pdfPath1 = "/Users/wangweiguo/Desktop/a.pdf"; String pdfPath2 = "/Users/wangweiguo/Desktop/b.pdf"; Map<String, String> textMap = new HashMap<String, String>(); textMap.put("access_token", token); Map<String, String> fileMap = new HashMap<String, String>(); fileMap.put("multipartFile", pdfPath1); fileMap.put("multipartFile", pdfPath2); String signSuccess = HttpRequest.sendPostFile(signUrl, textMap, fileMap); JSONObject jsonSign = JSONObject.fromObject(signSuccess); System.out.print(jsonSign); String downloadUrl = jsonSign.getString("down_url"); System.out.print("合并文件地址:"+downloadUrl); System.out.print("\n"); } }```