issue #10 提供客服消息Builder

This commit is contained in:
Daniel Qian
2014-08-28 11:30:25 +08:00
parent f6a1ec9d71
commit a6890c90de
9 changed files with 394 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package chanjarster.weixin.bean.custom;
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;
}
}