me.chanjar.weixin.mp.builder.kefu.MpNewsBuilder Maven / Gradle / Ivy
The newest version!
package me.chanjar.weixin.mp.builder.kefu;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
/**
* 图文消息builder
*
* 用法:
* WxMpKefuMessage m = WxMpKefuMessage.NEWS().mediaId("xxxxx").toUser(...).build();
*
*
* @author Binary Wang
*/
public final class MpNewsBuilder extends BaseBuilder {
private String mediaId;
public MpNewsBuilder() {
this.msgType = WxConsts.KefuMsgType.MPNEWS;
}
public MpNewsBuilder mediaId(String mediaId) {
this.mediaId = mediaId;
return this;
}
@Override
public WxMpKefuMessage build() {
WxMpKefuMessage m = super.build();
m.setMpNewsMediaId(this.mediaId);
return m;
}
}