Skip to content

Commit 0a22fcf

Browse files
committed
完善商品管理接口评审意见
1 parent a0c2daa commit 0a22fcf

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ AddProductThirdPartySourceResponse addProductThirdPartySource(AddProductThirdPar
344344
/**
345345
* 获取商品库存流水.
346346
*
347-
* @param param 商品、SKU、库存类型、时间范围和分页参数;pageSize 必填,库存类型非 0 和 1 时 stockTypeId 必填
347+
* @param param 商品、SKU、库存类型、时间范围和分页参数;pageSize 必填,stockType 为 1 时 finderId 必填,库存类型非 0 和 1 时 stockTypeId 必填
348348
* @return 库存流水及下一页标识
349349
* @throws WxErrorException 调用微信接口失败
350350
*/

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ExternalProductMappingNewResponse.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package me.chanjar.weixin.channel.bean.product;
22

33
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import java.io.Serializable;
45
import java.util.List;
56
import lombok.Data;
7+
import lombok.NoArgsConstructor;
68
import lombok.EqualsAndHashCode;
79
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
810

@@ -13,5 +15,15 @@ public class ExternalProductMappingNewResponse extends WxChannelBaseResponse {
1315
private static final long serialVersionUID = 4536547956225312823L;
1416

1517
@JsonProperty("attributes")
16-
private List<ExternalProductMappingNewParam.ExternalAttribute> attributes;
18+
private List<Attribute> attributes;
19+
20+
/** 推荐属性. */
21+
@Data
22+
@NoArgsConstructor
23+
public static class Attribute implements Serializable {
24+
private static final long serialVersionUID = -4072024462101489333L;
25+
26+
private String key;
27+
private String value;
28+
}
1729
}

weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelProductManagementServiceImplTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public void shouldMapAndRecommendExternalProductAttributes() throws WxErrorExcep
167167
ExternalProductMappingNewResponse result = productService(channelService).externalProductMappingNew(param);
168168

169169
assertRequest(channelService, "/channels/ec/product/externalproductmappingnew", "{\"cat_id\":6000,\"external_category_name\":\"母婴:童鞋\",\"head_imgs\":[\"https://example.com/head\"],\"title\":\"儿童雨鞋\",\"external_attributes\":[{\"key\":\"材质\",\"value\":\"塑胶\"}]}");
170+
assertTrue(result.getAttributes().get(0) instanceof ExternalProductMappingNewResponse.Attribute);
170171
assertEquals(result.getAttributes().get(0).getKey(), "鞋面材质");
171172
}
172173

0 commit comments

Comments
 (0)