Package com.foxinmy.weixin4j.wxa.api
Class TemplateApi
- java.lang.Object
-
- com.foxinmy.weixin4j.api.BaseApi
-
- com.foxinmy.weixin4j.wxa.api.TemplateApi
-
-
Field Summary
-
Fields inherited from class com.foxinmy.weixin4j.api.BaseApi
weixinExecutor
-
-
Constructor Summary
Constructors Constructor Description TemplateApi(TokenManager tokenManager)
TemplateApi(TokenManager tokenManager, Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
addTemplate(String id, int[] keywordIds)
组合模板并添加至帐号下的个人模板库void
deleteTemplate(String id)
删除帐号下的某个模板protected String
getRequestUri(String key)
Template
getTemplateInLibrary(String id)
获取模板库某个模板标题下关键词库List<Template>
getTemplates(Pageable pageable)
获取帐号下已存在的模板列表Pagedata<Template>
getTemplatesInLibrary(Pageable pageable)
获取小程序模板库标题列表protected ResourceBundle
weixinBundle()
-
-
-
Constructor Detail
-
TemplateApi
public TemplateApi(TokenManager tokenManager)
-
TemplateApi
public TemplateApi(TokenManager tokenManager, Properties properties)
-
-
Method Detail
-
getTemplatesInLibrary
public Pagedata<Template> getTemplatesInLibrary(Pageable pageable) throws WeixinException
获取小程序模板库标题列表- Parameters:
pageable
- the pagination information.- Returns:
- templates in library.
- Throws:
WeixinException
- indicates getting access token failed or getting templates failed.- See Also:
- 获取小程序模板库标题列表
-
getTemplateInLibrary
public Template getTemplateInLibrary(String id) throws WeixinException
获取模板库某个模板标题下关键词库- Parameters:
id
- 模板标题id,可通过接口获取,也可登录小程序后台查看获取- Returns:
- the template in library with specified ID.
- Throws:
WeixinException
- indicates getting access token failed or getting template failed.- See Also:
- 获取模板库某个模板标题下关键词库
-
addTemplate
public String addTemplate(String id, int[] keywordIds) throws WeixinException
组合模板并添加至帐号下的个人模板库- Parameters:
id
- 模板标题id,可通过接口获取,也可登录小程序后台查看获取keywordIds
- 开发者自行组合好的模板关键词列表,关键词顺序可以自由搭配(例如[3,5,4]或[4,5,3]),最多支持10个关键词组合- Returns:
- the added template ID.
- Throws:
WeixinException
- indicates getting access token failed or adding template failed.- See Also:
- 组合模板并添加至帐号下的个人模板库
-
getTemplates
public List<Template> getTemplates(Pageable pageable) throws WeixinException
获取帐号下已存在的模板列表- Parameters:
pageable
- the pagination information.- Returns:
- the templates.
- Throws:
WeixinException
- indicates getting access token failed or getting template failed.- See Also:
- 获取帐号下已存在的模板列表
-
deleteTemplate
public void deleteTemplate(String id) throws WeixinException
删除帐号下的某个模板- Parameters:
id
- 要删除的模板id- Throws:
WeixinException
- indicates getting access token failed or deleting template failed.- See Also:
- 删除帐号下的某个模板
-
weixinBundle
protected ResourceBundle weixinBundle()
- Specified by:
weixinBundle
in classBaseApi
-
getRequestUri
protected String getRequestUri(String key)
- Overrides:
getRequestUri
in classBaseApi
-
-