weixin.popular.bean.xmlmessage.XMLNewsMessage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of weixin-popular Show documentation
Show all versions of weixin-popular Show documentation
The weixin-popular is a JAVA SDK for weixin. Weixin web url is https://mp.weixin.qq.com.
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("
");
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;
}
}
}