weixin.popular.bean.message.massmessage.MassWxcardMessage Maven / Gradle / Ivy
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;
}
}