Browse Source

更新API调用

koul 4 years ago
parent
commit
304dd7efdf
1 changed files with 10 additions and 9 deletions
  1. 10 9
      src/com/uas/main/HttpClient.java

+ 10 - 9
src/com/uas/main/HttpClient.java

@@ -23,7 +23,6 @@ import java.io.InputStreamReader;
 import java.io.PrintWriter;
 import java.net.URI;
 import java.net.URL;
-import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -32,16 +31,14 @@ import java.sql.Statement;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
-import static javax.xml.transform.OutputKeys.ENCODING;
-
 /**
  * @author kl
  * @email koul@usoftchina.com
  * @date 2020-01-02 8:53
  */
 public class HttpClient {
-    private static final String testUrl = "prm-sit.goodix.com";
-    private static final String url = "prm.goodix.com";
+    private static final String testUrl = "https://api-uat.goodix.com/prm-uat/goodix/agent/aDelivery/agentAutoDelivery";
+    private static final String url = "https://api.goodix.com/prm-api/goodix/agent/aDelivery/agentAutoDelivery";
     private static final String serviceUrl = "/goodix/agent/aDelivery/agentAutoDelivery";
     //private static final String username = "SZhuaxinke";
     //private static final String password = "test";
@@ -54,9 +51,13 @@ public class HttpClient {
        // httpclientPost("HXK_SU_P", "SZhuaxinke", "SZhuaxinke");    //华信科苏州
        // httpclientPost("LHWX_HK_P", "XGlianheWX", "XGlianheWX");    //联合无线香港
         //HTTPS
-        sendPost("HUAXK_P", "SZhuaxinke", "HXK1234");   //华信科深圳
-        sendPost("HXK_SU_P", "SZhuaxinke", "HXK1234");    //华信科苏州
-        sendPost("LHWX_HK_P", "XGlianheWX", "HXK1234");    //联合无线香港
+        //sendPost("HUAXK_P", "SZhuaxinke", "HXK1234");   //华信科深圳
+        //sendPost("HXK_SU_P", "SZhuaxinke", "HXK1234");    //华信科苏州
+        //sendPost("LHWX_HK_P", "XGlianheWX", "HXK1234");    //联合无线香港
+
+        sendPost("HUAXK_P", "SZHuaXK_I", "SZHuaXK_I*");   //华信科深圳
+        sendPost("HXK_SU_P", "SZHuaXK_I", "SZHuaXK_I*");    //华信科苏州
+        sendPost("LHWX_HK_P", "XGlhwx_I", "XGlhwx_I**");    //联合无线香港
     }
 
     private static List<Map<String, String>> getDate(Statement statement, String sob) {
@@ -308,7 +309,7 @@ public class HttpClient {
                 for (NameValuePair nv:params) {
                     s = s +nv.getName()+"="+URLEncoder.encode(nv.getValue(), "UTF-8") + "&" ;
                 }
-                String ss = ur + "?" +s.substring(0,s.length()-1);
+                String ss = url + "?" +s.substring(0,s.length()-1);
                 URL realUrl = new URL(ss);
                 HttpsURLConnection conn = (HttpsURLConnection) realUrl.openConnection();
                 conn.setSSLSocketFactory(ssf);