WxMpGuideService.java 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package me.chanjar.weixin.mp.api;
  2. import me.chanjar.weixin.common.error.WxErrorException;
  3. import me.chanjar.weixin.mp.bean.guide.WxMpGuideInfo;
  4. import me.chanjar.weixin.mp.bean.guide.WxMpGuideList;
  5. /**
  6. * 微信导购助手(现在叫对话能力)接口.
  7. *
  8. * @author <a href="https://github.com/binarywang">Binary Wang</a>
  9. * @date 2020 -10-06
  10. */
  11. public interface WxMpGuideService {
  12. /**
  13. * 为服务号添加顾问
  14. * <pre>
  15. * 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/addguideacct?access_token=ACCESS_TOKEN
  16. * 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/guide-account/shopping-guide.addGuideAcct.html
  17. * </pre>
  18. *
  19. * @param account 顾问微信号(guide_account和guide_openid二选一,若同时请求,默认为guide_account)
  20. * @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
  21. * @param headImgUrl 顾问头像,头像url只能用《上传图文消息内的图片获取URL》 me.chanjar.weixin.mp.api.impl.WxMpMaterialServiceImpl#mediaImgUpload(java.io.File)
  22. * @param nickName 顾问昵称
  23. * @throws WxErrorException .
  24. */
  25. void addGuide(String account, String openid, String headImgUrl, String nickName) throws WxErrorException;
  26. /**
  27. * 为服务号添加顾问
  28. * <pre>
  29. * 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/addguideacct?access_token=ACCESS_TOKEN
  30. * 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/guide-account/shopping-guide.addGuideAcct.html
  31. * </pre>
  32. *
  33. * @param guideInfo 顾问信息
  34. * @throws WxErrorException .
  35. */
  36. void addGuide(WxMpGuideInfo guideInfo) throws WxErrorException;
  37. /**
  38. * 修改顾问的昵称或头像
  39. * <pre>
  40. * 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/updateguideacct?access_token=ACCESS_TOKEN
  41. * 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/guide-account/shopping-guide.updateGuideAcct.html
  42. * </pre>
  43. *
  44. * @param guideInfo 顾问信息
  45. * @throws WxErrorException .
  46. */
  47. void updateGuide(WxMpGuideInfo guideInfo) throws WxErrorException;
  48. /**
  49. * 获取顾问信息
  50. *
  51. * <pre>
  52. * 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/getguideacct?access_token=ACCESS_TOKEN
  53. * 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/guide-account/shopping-guide.getGuideAcct.html
  54. * </pre>
  55. *
  56. * @param account 顾问微信号(guide_account和guide_openid二选一,若同时请求,默认为guide_account)
  57. * @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
  58. * @return 顾问信息
  59. * @throws WxErrorException .
  60. */
  61. WxMpGuideInfo getGuide(String account, String openid) throws WxErrorException;
  62. /**
  63. * 删除顾问
  64. *
  65. * <pre>
  66. * 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/delguideacct?access_token=ACCESS_TOKEN
  67. * 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/guide-account/shopping-guide.delGuideAcct.html
  68. * </pre>
  69. *
  70. * @param account 顾问微信号(guide_account和guide_openid二选一,若同时请求,默认为guide_account)
  71. * @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
  72. * @throws WxErrorException .
  73. */
  74. void delGuide(String account, String openid) throws WxErrorException;
  75. /**
  76. * 获取服务号顾问列表
  77. *
  78. * <pre>
  79. * 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/getguideacctlist?access_token=ACCESS_TOKEN
  80. * 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/guide-account/shopping-guide.getGuideAcctList.html
  81. * </pre>
  82. *
  83. * @param page 分页页数,从0开始
  84. * @param num 每页数量
  85. * @return 顾问信息列表
  86. * @throws WxErrorException .
  87. */
  88. WxMpGuideList listGuide(int page, int num) throws WxErrorException;
  89. }