WxMpCommentService.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package me.chanjar.weixin.mp.api;
  2. import me.chanjar.weixin.common.error.WxErrorException;
  3. import me.chanjar.weixin.mp.bean.comment.WxMpCommentListVo;
  4. /**
  5. * 图文消息留言管理接口.
  6. * https://developers.weixin.qq.com/doc/offiaccount/Comments_management/Image_Comments_Management_Interface.html
  7. *
  8. * @author <a href="https://github.com/binarywang">Binary Wang</a>
  9. * @date 2019-06-16
  10. */
  11. public interface WxMpCommentService {
  12. /**
  13. * 打开已群发文章评论.
  14. * https://api.weixin.qq.com/cgi-bin/comment/open?access_token=ACCESS_TOKEN
  15. *
  16. * @param msgDataId 群发返回的msg_data_id
  17. * @param index 多图文时,用来指定第几篇图文,从0开始,不带默认操作该msg_data_id的第一篇图文
  18. * @throws WxErrorException 异常
  19. */
  20. void open(String msgDataId, Integer index) throws WxErrorException;
  21. /**
  22. * 关闭已群发文章评论.
  23. * https://api.weixin.qq.com/cgi-bin/comment/close?access_token=ACCESS_TOKEN
  24. *
  25. * @param msgDataId 群发返回的msg_data_id
  26. * @param index 多图文时,用来指定第几篇图文,从0开始,不带默认操作该msg_data_id的第一篇图文
  27. * @throws WxErrorException 异常
  28. */
  29. void close(String msgDataId, Integer index) throws WxErrorException;
  30. /**
  31. * 查看指定文章的评论数据.
  32. * https://api.weixin.qq.com/cgi-bin/comment/list?access_token=ACCESS_TOKEN
  33. *
  34. * @param msgDataId 群发返回的msg_data_id
  35. * @param index 多图文时,用来指定第几篇图文,从0开始,不带默认操作该msg_data_id的第一篇图文
  36. * @param begin 起始位置
  37. * @param count 获取数目(>=50会被拒绝)
  38. * @param type type=0 普通评论&精选评论 type=1 普通评论 type=2 精选评论
  39. * @return 评论列表数据
  40. * @throws WxErrorException 异常
  41. */
  42. WxMpCommentListVo list(String msgDataId, Integer index, int begin, int count, int type) throws WxErrorException;
  43. }