From 4ba348b700fd7f461f754a283eaeeba3fc9ff36c Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期六, 25 二月 2023 16:16:33 +0800 Subject: [PATCH] 新增加司机端接口 --- driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/util/ChinaMobileUtil.java | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/util/ChinaMobileUtil.java b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/util/ChinaMobileUtil.java index dfb0c5b..b3e65d1 100644 --- a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/util/ChinaMobileUtil.java +++ b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/util/ChinaMobileUtil.java @@ -2,6 +2,8 @@ import com.alibaba.fastjson.JSONObject; import com.supersavedriving.driver.core.util.MD5Util; +import com.supersavedriving.driver.modular.system.util.httpClinet.HttpClientUtil; +import com.supersavedriving.driver.modular.system.util.httpClinet.HttpResult; import org.apache.commons.codec.binary.Base64; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -18,9 +20,6 @@ private String APIKey = "zj42494b1bdd416b9762229af6b5cbbd"; private String SecretKey = "30323561316534653735613230316339"; - - @Autowired - private HttpClientUtil httpClientUtil; /** @@ -52,7 +51,8 @@ Map<String, String> header = new HashMap<String, String>(3); header.put("Authorization", "Basic " + new String(Base64.encodeBase64((APIKey + ":" + SecretKey).getBytes()))); header.put("Content-Type", "application/json;charset=utf-8"); - String post = httpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/binding", request, header, "json"); + HttpResult httpResult = HttpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/binding", request, header, "json"); + String post = httpResult.getData(); Map<String, String> map1 = new HashMap<>(); if(post.indexOf("0000") != -1){ JSONObject jsonObject = JSONObject.parseObject(post); @@ -90,7 +90,8 @@ Map<String, String> header = new HashMap<String, String>(3); header.put("Authorization", "Basic " + new String(Base64.encodeBase64((APIKey + ":" + SecretKey).getBytes()))); header.put("Content-Type", "application/json;charset=utf-8"); - String post = httpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/unbinding", request, header, "json"); + HttpResult httpResult = HttpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/unbinding", request, header, "json"); + String post = httpResult.getData(); JSONObject jsonObject = JSONObject.parseObject(post); Map<String, String> map1 = new HashMap<>(); if(jsonObject.getString("code").equals("0000")){ -- Gitblit v1.7.1