Package com.foxinmy.weixin4j.mp.message
Class TemplateMessage
- java.lang.Object
-
- com.foxinmy.weixin4j.mp.message.TemplateMessage
-
- All Implemented Interfaces:
Serializable
public class TemplateMessage extends Object implements Serializable
模板消息- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
- See Also:
- 模板消息, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TemplateMessage(String toUser, String templateId, String url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,NameValue>
getContent()
NameValue
getHead()
com.foxinmy.weixin4j.mp.message.TemplateMessage.Miniprogram
getMiniprogram()
NameValue
getTail()
String
getTemplateId()
String
getToUser()
String
getUrl()
TemplateMessage
pushHead(String text)
新增头部字段(默认颜色为#FF0000)TemplateMessage
pushHead(String color, String text)
新增头部字段TemplateMessage
pushItem(String key, String text)
新增字段项(默认颜色为#173177)TemplateMessage
pushItem(String key, String color, String text)
新增字段项TemplateMessage
pushTail(String text)
新增尾部字段(默认颜色为#173177)TemplateMessage
pushTail(String color, String text)
新增尾部字段void
setItems(Map<String,NameValue> items)
设置所有字段项void
setMiniprogram(String appid, String pagepath)
String
toString()
-
-
-
Method Detail
-
getToUser
public String getToUser()
-
getTemplateId
public String getTemplateId()
-
getUrl
public String getUrl()
-
getHead
public NameValue getHead()
-
getTail
public NameValue getTail()
-
pushHead
public TemplateMessage pushHead(String text)
新增头部字段(默认颜色为#FF0000)- Parameters:
text
- 字段文本- Returns:
-
pushHead
public TemplateMessage pushHead(String color, String text)
新增头部字段- Parameters:
color
- 文字颜色text
- 字段文本- Returns:
-
pushTail
public TemplateMessage pushTail(String text)
新增尾部字段(默认颜色为#173177)- Parameters:
text
- 字段文本- Returns:
-
pushTail
public TemplateMessage pushTail(String color, String text)
新增尾部字段- Parameters:
color
- 文字颜色text
- 字段文本- Returns:
-
pushItem
public TemplateMessage pushItem(String key, String text)
新增字段项(默认颜色为#173177)- Parameters:
key
- 预留的字段名text
- 字段文本- Returns:
-
pushItem
public TemplateMessage pushItem(String key, String color, String text)
新增字段项- Parameters:
key
- 预留的字段名color
- 文字颜色text
- 字段文本- Returns:
-
getMiniprogram
public com.foxinmy.weixin4j.mp.message.TemplateMessage.Miniprogram getMiniprogram()
-
-