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

cn.binarywang.wx.miniapp.builder.MaPageMessageBuilder Maven / Gradle / Ivy

There is a newer version: 4.6.7.B
Show newest version
package cn.binarywang.wx.miniapp.builder;

import cn.binarywang.wx.miniapp.bean.WxMaKefuMessage;

import static cn.binarywang.wx.miniapp.constant.WxMaConstants.KefuMsgType;

/**
 * 小程序卡片消息builder
 *
 * @author Binary Wang
 */
public class MaPageMessageBuilder extends BaseBuilder {
  private String title;
  private String pagePath;
  private String thumbMediaId;

  public MaPageMessageBuilder() {
    this.msgType = KefuMsgType.MA_PAGE;
  }

  public MaPageMessageBuilder title(String title) {
    this.title = title;
    return this;
  }

  public MaPageMessageBuilder pagePath(String pagePath) {
    this.pagePath = pagePath;
    return this;
  }

  public MaPageMessageBuilder thumbMediaId(String thumbMediaId) {
    this.thumbMediaId = thumbMediaId;
    return this;
  }

  @Override
  public WxMaKefuMessage build() {
    WxMaKefuMessage m = super.build();
    m.setMaPage(WxMaKefuMessage.KfMaPage.builder()
      .title(this.title)
      .pagePath(this.pagePath)
      .thumbMediaId(this.thumbMediaId)
      .build()
    );
    return m;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy