All Downloads are FREE. Search and download functionalities are using the official Maven repository.

weixin.popular.bean.xmlmessage.XMLNewsMessage Maven / Gradle / Ivy

Go to download

The weixin-popular is a JAVA SDK for weixin. Weixin web url is https://mp.weixin.qq.com.

There is a newer version: 2.8.32
Show newest version
package weixin.popular.bean.xmlmessage;

import java.util.List;

public class XMLNewsMessage extends XMLMessage {

	private List
articles; /** * @param toUserName toUserName * @param fromUserName fromUserName * @param articles articles */ public XMLNewsMessage(String toUserName, String fromUserName, List
articles) { super(toUserName, fromUserName, "news"); this.articles = articles; } @Override public String subXML() { StringBuilder sb = new StringBuilder(); sb.append(""+articles.size()+""); sb.append(""); for(Article a : articles){ sb.append(""); sb.append("<![CDATA["+(a.title==null?"":a.title)+"]]>"); sb.append(""); sb.append(""); sb.append(""); sb.append(""); } sb.append(""); return sb.toString(); } public static class Article { private String title; private String description; private String url; private String picurl; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getPicurl() { return picurl; } public void setPicurl(String picurl) { this.picurl = picurl; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy