|
|
@@ -49,6 +49,28 @@ public class PayPush {
|
|
|
JSONObject jsonObject = JSON.parseObject(res);
|
|
|
System.out.println("=========================用户推送"+res);
|
|
|
}
|
|
|
+
|
|
|
+ //用户端批量推送
|
|
|
+ public void qsPushBatch(List<String> cid, String title, String content, String body){
|
|
|
+ String url = "https://fc-mp-20ccbe79-10f8-41d7-a06c-c42581f351c1.next.bspapp.com/msdrider";
|
|
|
+
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ // cid 是数组/列表,不能直接字符串拼接,否则会得到 [Ljava.lang.String;@xxxx
|
|
|
+ json.put("cid", cid);
|
|
|
+ json.put("title", title);
|
|
|
+ json.put("content", content);
|
|
|
+ // payload 建议作为 JSON 对象传递,避免双引号转义问题
|
|
|
+ json.put("payload", body == null ? null : JSON.parse(body));
|
|
|
+
|
|
|
+ String jsonBody = json.toJSONString();
|
|
|
+ String res = HttpRequest.post(url)
|
|
|
+ .header("Content-Type", "application/json")
|
|
|
+ .body(jsonBody)
|
|
|
+ .execute()
|
|
|
+ .body();
|
|
|
+ System.out.println("-------用户批量推送");
|
|
|
+ }
|
|
|
+
|
|
|
//商家端推送
|
|
|
public void shpush(String cid,String title, String content, String body){
|
|
|
System.out.println("商家cid:"+cid);
|