From 6a90f2d1feaf583c211d5f9fe95dff7f7c748ed3 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 06 九月 2024 17:42:20 +0800
Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/IgoTravel into 2.0

---
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/SMSUtil.java |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/SMSUtil.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/SMSUtil.java
index 5ce7185..541617e 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/SMSUtil.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/SMSUtil.java
@@ -277,32 +277,44 @@
 
 
     /**
-     * Cellulant短信
+     * 短信 : https://sms.mymailcentre.com/smsportal/cellulant
      * @param toPhone
      * @param msg
      * @return
      */
     public boolean sendCellulantMessage(String toPhone, String msg){
-        String url = "https://sms.nalosolutions.com/smsbackend/Nal_resl/send-message/";
+        String url = "https://sms.nalosolutions.com/smsbackend/Cell_resl/send-message/";
         HttpRequest post = HttpUtil.createPost(url);
         post.contentType(ContentType.JSON.toString());
         JSONObject params = new JSONObject();
-        params.put("key", "ru#0flkf3993qh!!rg!@y4)nhwi08c#tg_vasek!ja)kvfnfjyoljoz(@nai(jkf");
+        params.put("key", "c_x7x5!v_1mhg(l34p05g2b@teheq)ex9mk1jj(u@nlfx_w5(rdx)tb_ttx22b3o");
+        params.put("username", "I-GO");
+        params.put("password", "abcd1234");
         params.put("msisdn", toPhone);
         params.put("message", msg);
         params.put("sender_id", "I-GO");
+        params.put("callback_url", "https://igo.i-go.group/user/base/sendCellulantMessageCallback");
         post.body(params.toJSONString());
+        System.err.println("短信请求:\n请求地址:" + url + "\n请求参数:" + params.toJSONString());
         HttpResponse execute = post.execute();
         String body = execute.body();
         execute.close();
         JSONObject jsonObject = JSON.parseObject(body);
+        System.err.println("短信响应:" + body);
         Integer status = jsonObject.getInteger("status");
-        if(1701 == status){
+        if(null != status && 1701 == status){
             return true;
         }else{
+            System.err.println("短信发送失败:" + jsonObject.toJSONString());
             return false;
         }
+    
+        
     }
-
-
+    
+    public static void main(String[] ages){
+        //{"callback_url":"https://igo.i-go.group/user/base/sendCellulantMessageCallback","msisdn":"233244915521","message":"Your verification code is 2358,it is valid within 5 minutes, please do not reveal it to others.","key":"ru#0flkf3993qh!!rg!@y4)nhwi08c#tg_vasek!ja)kvfnfjyoljoz(@nai(jkf","sender_id":"I-GO"}
+        SMSUtil smsUtil = new SMSUtil();
+        smsUtil.sendCellulantMessage("233244915521", "Your verification code is 2358,it is valid within 5 minutes, please do not reveal it to others.");
+    }
 }

--
Gitblit v1.7.1