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

weixin.popular.bean.message.massmessage.MassImageMessage 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.ImagePreview;
import weixin.popular.bean.message.preview.Preview;

public class MassImageMessage extends MassMessage{

	private Map image;

	public MassImageMessage(String media_id) {
		super();
		image = new HashMap();
		image.put("media_id",media_id);
		super.msgtype = "image";
	}

	public Map getImage() {
		return image;
	}

	public void setImage(Map image) {
		this.image = image;
	}

	@Override
	public Preview convert() {
		Preview preview = new ImagePreview(image.get("media_id"));
		if(this.getTouser()!=null && this.getTouser().size()>0){
			preview.setTouser(this.getTouser().iterator().next());
		}
		return preview;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy