mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-09-23 12:33:48 +08:00
32 lines
702 B
Java
32 lines
702 B
Java
package me.chanjar.weixin.bean.custombuilder;
|
|
|
|
import me.chanjar.weixin.api.WxConsts;
|
|
import me.chanjar.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 mediaId(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;
|
|
}
|
|
}
|