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

weixin.popular.bean.message.massmessage.MassWxcardMessage Maven / Gradle / Ivy

Go to download

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.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;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy