From b686778d97bdd83f28523ad6bec3d6128b457389 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 04:00:21 +0000 Subject: [PATCH 1/3] Initial plan From c3d45a76b82324babb97ec14ccda868d1fb1fc2c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 04:04:41 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20listRelationCategory?= =?UTF-8?q?=20=E6=96=B9=E6=B3=95=E5=AE=9E=E7=8E=B0=E5=92=8C=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com> --- .../channel/api/WxChannelCategoryService.java | 2 ++ .../impl/WxChannelCategoryServiceImpl.java | 7 +++-- .../category/RelationCategoryRequest.java | 28 +++++++++++++++++++ .../WxChannelCategoryServiceImplTest.java | 10 +++++++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCategoryService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCategoryService.java index f594dcd944..ad86697614 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCategoryService.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCategoryService.java @@ -121,6 +121,8 @@ AuditApplyResponse addCategory(String level1, String level2, String level3, List /** * 获取店铺的类目权限列表 * + * @param isFilterStatus 是否按状态筛选 + * @param status 类目状态(当 isFilterStatus 为 true 时有效) * @return 类目权限列表 * * @throws WxErrorException 异常 diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImpl.java index 9dc422971c..7070ab9298 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImpl.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImpl.java @@ -127,8 +127,11 @@ public PassCategoryResponse listPassCategory() throws WxErrorException { @Override public RelationCategoryResponse listRelationCategory(Boolean isFilterStatus, Integer status) throws WxErrorException { - String reqJson = "{\"is_filter_status\": " + (isFilterStatus != null ? isFilterStatus : false) + - ", \"status\": " + (status != null ? status : 0) + "}"; + RelationCategoryRequest request = new RelationCategoryRequest( + isFilterStatus != null ? isFilterStatus : false, + status != null ? status : 0 + ); + String reqJson = JsonUtils.encode(request); String resJson = shopService.post(LIST_RELATION_CATEGORY_URL, reqJson); return ResponseUtils.decode(resJson, RelationCategoryResponse.class); } diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java new file mode 100644 index 0000000000..05e3474dd5 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java @@ -0,0 +1,28 @@ +package me.chanjar.weixin.channel.bean.category; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 类目权限列表请求参数 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class RelationCategoryRequest implements Serializable { + + private static final long serialVersionUID = 1234567890123456789L; + + /** 是否按状态筛选 */ + @JsonProperty("is_filter_status") + private Boolean isFilterStatus; + + /** 类目状态(当 isFilterStatus 为 true 时有效) */ + @JsonProperty("status") + private Integer status; +} diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImplTest.java index 125e061cd8..06afde2993 100644 --- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImplTest.java +++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImplTest.java @@ -158,4 +158,14 @@ public void testListPassCategory() throws WxErrorException { assertTrue(response.isSuccess()); System.out.println(response); } + + @Test + public void testListRelationCategory() throws WxErrorException { + WxChannelCategoryService categoryService = channelService.getCategoryService(); + me.chanjar.weixin.channel.bean.category.RelationCategoryResponse response = + categoryService.listRelationCategory(true, 1); + assertNotNull(response); + assertTrue(response.isSuccess()); + System.out.println(response); + } } From bfd90db911d45cd582cd51a66f6a93074bf36302 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 04:05:49 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20RelationCategoryReques?= =?UTF-8?q?t=20=E7=9A=84=20serialVersionUID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com> --- .../weixin/channel/bean/category/RelationCategoryRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java index 05e3474dd5..c514e7d9ca 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java @@ -16,7 +16,7 @@ @AllArgsConstructor public class RelationCategoryRequest implements Serializable { - private static final long serialVersionUID = 1234567890123456789L; + private static final long serialVersionUID = -8765432109876543210L; /** 是否按状态筛选 */ @JsonProperty("is_filter_status")