Пример #1
0
 /*
  * 根据分组进行群发,拼接POST群发文本消息
  */
 public static TextSpam makeSpamText(String str) {
   TextSpam ts = new TextSpam();
   Filter filter = new Filter();
   filter.setIs_to_all(true);
   Text text = new Text();
   text.setContent(str);
   ts.setFilter(filter);
   ts.setText(text);
   ts.setMsgtype(MessageUtil.MESSAGE_TEXT);
   return ts;
 }
Пример #2
0
 /*
  * 根据分组进行群发,拼接POST群发图文消息
  */
 public static NewsSpam makeSpamNews(String media_id) {
   if (media_id.length() > 5) {
     NewsSpam ns = new NewsSpam();
     Filter filter = new Filter();
     filter.setIs_to_all(true);
     Mpnews mn = new Mpnews();
     mn.setMedia_id(media_id);
     ns.setFilter(filter);
     ns.setMpnews(mn);
     ns.setMsgtype("mpnews");
     return ns;
   } else {
     return null;
   }
 }