From 71ba078768b6544cccd3744842a2b13e393ac7bc Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Fri, 20 Dec 2019 12:54:40 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E5=9B=BE=E6=96=87?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=95=99=E8=A8=80=E7=AE=A1=E7=90=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=B8=ADmsgDataId=E7=B1=BB=E5=9E=8B=E4=B8=8E=E7=BE=A4?= =?UTF-8?q?=E5=8F=91=E6=B6=88=E6=81=AF=E6=8E=A5=E5=8F=A3=E7=9A=84=E6=B6=88?= =?UTF-8?q?=E6=81=AFid=E7=B1=BB=E5=9E=8B=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/chanjar/weixin/mp/api/WxMpCommentService.java | 8 ++++---- .../weixin/mp/api/impl/WxMpCommentServiceImpl.java | 6 +++--- .../weixin/mp/api/impl/WxMpCommentServiceImplTest.java | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) 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);