| | |
| | | |
| | | |
| | | public boolean sendCellulantMessage(String toPhone, String msg){ |
| | | String url = "https://sms.nalosolutions.com/smsbackend/clientapi/Cell_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", "http://182.160.16.251:80/driver/base/sendCellulantMessageCallback"); |
| | | post.body(params.toJSONString()); |
| | | System.err.println("短信请求:\n请求地址:" + url + "\n请求参数:" + params.toJSONString()); |
| | | HttpResponse execute = post.execute(); |
| | | String body = execute.body(); |
| | | execute.close(); |
| | | System.err.println("短信:" + body); |
| | | System.err.println("短信响应:" + body); |
| | | JSONObject jsonObject = JSON.parseObject(body); |
| | | Integer status = jsonObject.getInteger("status"); |
| | | if(null != status && 1701 == status){ |