zhibing.pu
2024-05-27 f9b9131367d9ba6fe852130b12083c0f5ea68bbb
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/SMSUtil.java
@@ -277,13 +277,13 @@
    /**
     * Cellulant短信
     * 短信 : https://www.nalosolutions.com/
     * @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/clientapi/Cell_resl/send-message/";
        HttpRequest post = HttpUtil.createPost(url);
        post.contentType(ContentType.JSON.toString());
        JSONObject params = new JSONObject();
@@ -291,11 +291,13 @@
        params.put("msisdn", toPhone);
        params.put("message", msg);
        params.put("sender_id", "I-GO");
        System.err.println(params.toJSONString());
        post.body(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(null != status && 1701 == status){
            return true;
@@ -304,6 +306,9 @@
            return false;
        }
    }
    public static void main(String[] ages){
        SMSUtil smsUtil = new SMSUtil();
        smsUtil.sendCellulantMessage("233244915521", "Votre code de validation est 123456 et il est valide pendant 5 minutes. Veuillez ne pas le révéler à d’autres personnes.");
    }
}