weixin.popular.bean.message.massmessage.MassWxcardMessage 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.message.massmessage;
import java.util.HashMap;
import java.util.Map;
import weixin.popular.bean.message.preview.Preview;
import weixin.popular.bean.message.preview.WxcardPreview;
public class MassWxcardMessage extends MassMessage{
private Map wxcard;
public MassWxcardMessage(String card_id) {
super();
wxcard = new HashMap();
wxcard.put("card_id",card_id);
super.msgtype = "wxcard";
}
public Map getWxcard() {
return wxcard;
}
public void setWxcard(Map wxcard) {
this.wxcard = wxcard;
}
@Override
public Preview convert() {
Preview preview = new WxcardPreview(wxcard.get("card_id"),null);
if(this.getTouser()!=null && this.getTouser().size()>0){
preview.setTouser(this.getTouser().iterator().next());
}
return preview;
}
}