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.BaseApiweixinExecutor
 
- 
 - 
Constructor SummaryConstructors Constructor Description TemplateApi(TokenManager tokenManager)TemplateApi(TokenManager tokenManager, Properties properties)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddTemplate(String id, int[] keywordIds)组合模板并添加至帐号下的个人模板库voiddeleteTemplate(String id)删除帐号下的某个模板protected StringgetRequestUri(String key)TemplategetTemplateInLibrary(String id)获取模板库某个模板标题下关键词库List<Template>getTemplates(Pageable pageable)获取帐号下已存在的模板列表Pagedata<Template>getTemplatesInLibrary(Pageable pageable)获取小程序模板库标题列表protected ResourceBundleweixinBundle()
 
- 
- 
- 
Constructor Detail- 
TemplateApipublic TemplateApi(TokenManager tokenManager) 
 - 
TemplateApipublic TemplateApi(TokenManager tokenManager, Properties properties) 
 
- 
 - 
Method Detail- 
getTemplatesInLibrarypublic 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:
- 获取小程序模板库标题列表
 
 - 
getTemplateInLibrarypublic 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:
- 获取模板库某个模板标题下关键词库
 
 - 
addTemplatepublic 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:
- 组合模板并添加至帐号下的个人模板库
 
 - 
getTemplatespublic 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:
- 获取帐号下已存在的模板列表
 
 - 
deleteTemplatepublic void deleteTemplate(String id) throws WeixinException 删除帐号下的某个模板- Parameters:
- id- 要删除的模板id
- Throws:
- WeixinException- indicates getting access token failed or deleting template failed.
- See Also:
- 删除帐号下的某个模板
 
 - 
weixinBundleprotected ResourceBundle weixinBundle() - Specified by:
- weixinBundlein class- BaseApi
 
 - 
getRequestUriprotected String getRequestUri(String key) - Overrides:
- getRequestUriin class- BaseApi
 
 
- 
 
-