weixin.popular.bean.message.massmessage.MassTextMessage 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.
The newest version!
package weixin.popular.bean.message.massmessage;
import java.util.HashMap;
import java.util.Map;
import weixin.popular.bean.message.preview.Preview;
import weixin.popular.bean.message.preview.TextPreview;
public class MassTextMessage extends MassMessage{
private Map text;
public MassTextMessage(String content) {
super();
text = new HashMap();
text.put("content",content);
super.msgtype = "text";
}
public Map getText() {
return text;
}
public void setText(Map text) {
this.text = text;
}
@Override
public Preview convert() {
Preview preview = new TextPreview(text.get("content"));
if(this.getTouser()!=null && this.getTouser().size()>0){
preview.setTouser(this.getTouser().iterator().next());
}
return preview;
}
}