-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb4e3f3
commit a4f5aa3
Showing
4 changed files
with
144 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
...p/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/MiniProgramNoticeMsgBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package me.chanjar.weixin.cp.bean.messagebuilder; | ||
|
||
import me.chanjar.weixin.common.api.WxConsts; | ||
import me.chanjar.weixin.cp.bean.WxCpMessage; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* <pre> | ||
* miniprogram_notice 类型的消息 builder | ||
* Created by Binary Wang on 2019/6/16. | ||
* </pre> | ||
* | ||
* @author <a href="https://github.com/binarywang">Binary Wang</a> | ||
*/ | ||
public class MiniProgramNoticeMsgBuilder extends BaseBuilder<MiniProgramNoticeMsgBuilder> { | ||
private String title; | ||
private String description; | ||
private String appId; | ||
private String page; | ||
private Boolean emphasisFirstItem; | ||
private Map<String, String> contentItems; | ||
|
||
public MiniProgramNoticeMsgBuilder() { | ||
this.msgType = WxConsts.KefuMsgType.MINIPROGRAM_NOTICE; | ||
} | ||
|
||
public MiniProgramNoticeMsgBuilder appId(String appId) { | ||
this.appId = appId; | ||
return this; | ||
} | ||
|
||
public MiniProgramNoticeMsgBuilder page(String page) { | ||
this.page = page; | ||
return this; | ||
} | ||
|
||
public MiniProgramNoticeMsgBuilder title(String title) { | ||
this.title = title; | ||
return this; | ||
} | ||
|
||
public MiniProgramNoticeMsgBuilder description(String description) { | ||
this.description = description; | ||
return this; | ||
} | ||
|
||
public MiniProgramNoticeMsgBuilder contentItems(Map<String, String> contentItems) { | ||
this.contentItems = contentItems; | ||
return this; | ||
} | ||
|
||
public MiniProgramNoticeMsgBuilder emphasisFirstItem(Boolean emphasisFirstItem) { | ||
this.emphasisFirstItem = emphasisFirstItem; | ||
return this; | ||
} | ||
|
||
@Override | ||
public WxCpMessage build() { | ||
WxCpMessage m = super.build(); | ||
m.setContentItems(this.contentItems); | ||
m.setAppId(this.appId); | ||
m.setDescription(this.description); | ||
m.setTitle(this.title); | ||
m.setEmphasisFirstItem(this.emphasisFirstItem); | ||
m.setPage(this.page); | ||
return m; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters