package com.hxzk;
|
|
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSONObject;
|
import com.hxzk.pojo.TbHeartRecord;
|
import com.hxzk.util.ChuangLanSmsUtil;
|
import com.hxzk.util.SmsSendRequest;
|
import com.hxzk.util.SmsSendResponse;
|
|
import java.awt.geom.Point2D;
|
import java.util.ArrayList;
|
import java.util.List;
|
|
public class Main {
|
|
public static void main(String[] args) {
|
final String charset = "utf-8";
|
String account = "N0372377";
|
String password = "ERMHxL4yQx9a50";
|
|
String smsSingleRequestServerUrl = "http://smssh1.253.com/msg/send/json";
|
String msg = "车辆安全报警,车牌:鲁AN9F09,时间:2023-09-09 20:56,位置:北纬39.809272,东经116.92023,触发报警:熄火制动,司机:张三,手机号:13952677195,请及时处理。";
|
String phone = "17531353238";
|
String report= "true";
|
JSONObject json=new JSONObject();
|
json.put("account",account);
|
json.put("password",password);
|
json.put("msg",msg);
|
json.put("phone",phone);
|
json.put("report",report);
|
|
SmsSendRequest smsSingleRequest = new SmsSendRequest(account, password, msg, phone,report);
|
String requestJson = JSON.toJSONString(smsSingleRequest);
|
System.out.println("before request string is: " + requestJson);
|
String response = ChuangLanSmsUtil.sendSmsByPost(smsSingleRequestServerUrl, json.toString());
|
System.out.println("response after request result is :" + response);
|
SmsSendResponse smsSingleResponse = JSON.parseObject(response, SmsSendResponse.class);
|
System.out.println("response toString is :" + smsSingleResponse);
|
}
|
}
|