diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpCommentService.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpCommentService.java index 423f61a7..1d96c968 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpCommentService.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpCommentService.java @@ -5,7 +5,7 @@ import me.chanjar.weixin.mp.bean.comment.WxMpCommentListVo; /** * 图文消息留言管理接口. - * https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1494572718_WzHIY + * https://developers.weixin.qq.com/doc/offiaccount/Comments_management/Image_Comments_Management_Interface.html * * @author Binary Wang * @date 2019-06-16 @@ -19,7 +19,7 @@ public interface WxMpCommentService { * @param index 多图文时,用来指定第几篇图文,从0开始,不带默认操作该msg_data_id的第一篇图文 * @throws WxErrorException 异常 */ - void open(Integer msgDataId, Integer index) throws WxErrorException; + void open(String msgDataId, Integer index) throws WxErrorException; /** * 关闭已群发文章评论. @@ -29,7 +29,7 @@ public interface WxMpCommentService { * @param index 多图文时,用来指定第几篇图文,从0开始,不带默认操作该msg_data_id的第一篇图文 * @throws WxErrorException 异常 */ - void close(Integer msgDataId, Integer index) throws WxErrorException; + void close(String msgDataId, Integer index) throws WxErrorException; /** * 查看指定文章的评论数据. @@ -43,5 +43,5 @@ public interface WxMpCommentService { * @return 评论列表数据 * @throws WxErrorException 异常 */ - WxMpCommentListVo list(Integer msgDataId, Integer index, int begin, int count, int type) throws WxErrorException; + WxMpCommentListVo list(String msgDataId, Integer index, int begin, int count, int type) throws WxErrorException; } diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpCommentServiceImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpCommentServiceImpl.java index 8d97af36..02315cc2 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpCommentServiceImpl.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpCommentServiceImpl.java @@ -18,7 +18,7 @@ public class WxMpCommentServiceImpl implements WxMpCommentService { private final WxMpService wxMpService; @Override - public void open(Integer msgDataId, Integer index) throws WxErrorException { + public void open(String msgDataId, Integer index) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("msg_data_id", msgDataId); if (index != null) { @@ -29,7 +29,7 @@ public class WxMpCommentServiceImpl implements WxMpCommentService { } @Override - public void close(Integer msgDataId, Integer index) throws WxErrorException { + public void close(String msgDataId, Integer index) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("msg_data_id", msgDataId); if (index != null) { @@ -40,7 +40,7 @@ public class WxMpCommentServiceImpl implements WxMpCommentService { } @Override - public WxMpCommentListVo list(Integer msgDataId, Integer index, int begin, int count, int type) throws WxErrorException { + public WxMpCommentListVo list(String msgDataId, Integer index, int begin, int count, int type) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("msg_data_id", msgDataId); json.addProperty("begin", begin); diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpCommentServiceImplTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpCommentServiceImplTest.java index efbf6e18..5f4bdecf 100644 --- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpCommentServiceImplTest.java +++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpCommentServiceImplTest.java @@ -31,14 +31,14 @@ public class WxMpCommentServiceImplTest { @Test public void testOpen() throws WxErrorException { - this.wxService.getCommentService().open(1, null); - this.wxService.getCommentService().open(1, 0); + this.wxService.getCommentService().open("1", null); + this.wxService.getCommentService().open("1", 0); } @Test public void testClose() throws WxErrorException { - this.wxService.getCommentService().close(1000000001, null); - this.wxService.getCommentService().close(1, 0); + this.wxService.getCommentService().close("1000000001", null); + this.wxService.getCommentService().close("1", 0); } @Test @@ -66,7 +66,7 @@ public class WxMpCommentServiceImplTest { WxMpCommentService commentService = new WxMpCommentServiceImpl(wxService); doReturn(expectedResponse).when(wxService).post(anyString(), anyString()); - final WxMpCommentListVo commentListVo = commentService.list(1, 1, 1, 1, 1); + final WxMpCommentListVo commentListVo = commentService.list("1", 1, 1, 1, 1); assertThat(commentListVo).isNotNull(); System.out.println(commentListVo); assertThat(commentListVo.getTotal()).isEqualTo(1);