Browse Source

和该项目完美兼容

skyfffire 2 tháng trước cách đây
mục cha
commit
ad3ebdcbd0
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      src/main/java/common/utils/jdcloud/SMS.java

+ 6 - 2
src/main/java/common/utils/jdcloud/SMS.java

@@ -1,6 +1,6 @@
 package common.utils.jdcloud;
 
-import com.google.gson.Gson;
+import com.alibaba.fastjson.JSONObject;
 import com.jdcloud.sdk.auth.CredentialsProvider;
 import com.jdcloud.sdk.auth.StaticCredentialsProvider;
 import com.jdcloud.sdk.http.HttpRequestConfig;
@@ -51,6 +51,9 @@ public class SMS {
         params.add(verifyCode);
         request.setParams(params);
 
+        // new Gson().toJson(response)
+        // JSONObject.toJSONString(response)
+        // 以上两种方案都可以
         return smsClient.batchSend(request);
     }
 
@@ -92,7 +95,8 @@ public class SMS {
     public static void main(String[ ] args) {
         // 初始化client
         init();
-        System.out.println(sendVerifyCodeByMobileNumber("177****####", "3213"));
+        BatchSendResponse response = sendVerifyCodeByMobileNumber("177****####", "3213");
+        System.out.println(JSONObject.toJSONString(response));
         /*
         // testStatusReport();
         // testReply();