Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ AuditApplyResponse addCategory(String level1, String level2, String level3, List
/**
* 获取店铺的类目权限列表
*
* @param isFilterStatus 是否按状态筛选
* @param status 类目状态(当 isFilterStatus 为 true 时有效)
* @return 类目权限列表
*
* @throws WxErrorException 异常
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <a href="https://github.com/lixize">Zeyes</a>
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RelationCategoryRequest implements Serializable {

private static final long serialVersionUID = -8765432109876543210L;

/** 是否按状态筛选 */
@JsonProperty("is_filter_status")
private Boolean isFilterStatus;

/** 类目状态(当 isFilterStatus 为 true 时有效) */
@JsonProperty("status")
private Integer status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}