WxMaTemplateService.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package cn.binarywang.wx.miniapp.api;
  2. import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateAddResult;
  3. import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateLibraryGetResult;
  4. import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateLibraryListResult;
  5. import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateListResult;
  6. import me.chanjar.weixin.common.error.WxErrorException;
  7. import java.util.List;
  8. public interface WxMaTemplateService {
  9. /**
  10. * 获取小程序模板库标题列表
  11. */
  12. String TEMPLATE_LIBRARY_LIST_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/template/library/list";
  13. /**
  14. * 获取模板库某个模板标题下关键词库
  15. */
  16. String TEMPLATE_LIBRARY_KEYWORD_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/template/library/get";
  17. /**
  18. * 组合模板并添加至帐号下的个人模板库
  19. */
  20. String TEMPLATE_ADD_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/template/add";
  21. /**
  22. * 获取帐号下已存在的模板列表
  23. */
  24. String TEMPLATE_LIST_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/template/list";
  25. /**
  26. * 删除帐号下的某个模板
  27. */
  28. String TEMPLATE_DEL_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/template/del";
  29. /**
  30. * <pre>
  31. * 获取小程序模板库标题列表
  32. *
  33. * 详情请见: <a href="https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1500465446_j4CgR&token=&lang=zh_CN">获取小程序模板库标题列表</a>
  34. * 接口url格式: https://api.weixin.qq.com/cgi-bin/wxopen/template/library/list?access_token=ACCESS_TOKEN
  35. * </pre>
  36. *
  37. * @param offset
  38. * @param count
  39. * @return
  40. */
  41. WxMaTemplateLibraryListResult findTemplateLibraryList(int offset, int count) throws WxErrorException;
  42. /**
  43. * <pre>
  44. * 获取模板库某个模板标题下关键词库
  45. *
  46. * 详情请见: <a href="https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1500465446_j4CgR&token=&lang=zh_CN">获取小程序模板库标题列表</a>
  47. * 接口url格式: https://api.weixin.qq.com/cgi-bin/wxopen/template/library/get?access_token=ACCESS_TOKEN
  48. * </pre>
  49. *
  50. * @param id
  51. * @return
  52. */
  53. WxMaTemplateLibraryGetResult findTemplateLibraryKeywordList(String id) throws WxErrorException;
  54. /**
  55. * <pre>
  56. * 组合模板并添加至帐号下的个人模板库
  57. *
  58. * 详情请见: <a href="https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1500465446_j4CgR&token=&lang=zh_CN">获取小程序模板库标题列表</a>
  59. * 接口url格式: https://api.weixin.qq.com/cgi-bin/wxopen/template/add?access_token=ACCESS_TOKEN
  60. * </pre>
  61. *
  62. * @param id
  63. * @param keywordIdList
  64. * @return
  65. */
  66. WxMaTemplateAddResult addTemplate(String id, List<Integer> keywordIdList) throws WxErrorException;
  67. /**
  68. * <pre>
  69. * 获取帐号下已存在的模板列表
  70. *
  71. * 详情请见: <a href="https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1500465446_j4CgR&token=&lang=zh_CN">获取小程序模板库标题列表</a>
  72. * 接口url格式: https://api.weixin.qq.com/cgi-bin/wxopen/template/list?access_token=ACCESS_TOKEN
  73. * </pre>
  74. *
  75. * @param offset
  76. * @param count
  77. * @return
  78. */
  79. WxMaTemplateListResult findTemplateList(int offset, int count) throws WxErrorException;
  80. /**
  81. * <pre>
  82. * 删除帐号下的某个模板
  83. *
  84. * 详情请见: <a href="https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1500465446_j4CgR&token=&lang=zh_CN">获取小程序模板库标题列表</a>
  85. * 接口url格式: https://api.weixin.qq.com/cgi-bin/wxopen/template/list?access_token=ACCESS_TOKEN
  86. * </pre>
  87. *
  88. * @param templateId
  89. */
  90. boolean delTemplate(String templateId) throws WxErrorException;
  91. }