2014-08-28 13:01:51 +08:00
|
|
|
package chanjarster.weixin.bean.custombuilder;
|
2014-08-28 11:30:25 +08:00
|
|
|
|
|
|
|
import chanjarster.weixin.api.WxConsts;
|
|
|
|
import chanjarster.weixin.bean.WxCustomMessage;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获得消息builder
|
|
|
|
* <pre>
|
|
|
|
* 用法: WxCustomMessage m = WxCustomMessage.IMAGE().media_id(...).touser(...).build();
|
|
|
|
* </pre>
|
|
|
|
* @author chanjarster
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public final class ImageBuilder extends BaseBuilder<ImageBuilder> {
|
|
|
|
private String media_id;
|
|
|
|
|
|
|
|
public ImageBuilder() {
|
|
|
|
this.msgtype = WxConsts.CUSTOM_MSG_IMAGE;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ImageBuilder media_id(String media_id) {
|
|
|
|
this.media_id = media_id;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public WxCustomMessage build() {
|
|
|
|
WxCustomMessage m = super.build();
|
|
|
|
m.setMedia_id(this.media_id);
|
|
|
|
return m;
|
|
|
|
}
|
|
|
|
}
|