Skip to content

[WIP] Add missing gift management endpoints to WxChannelProductService#4033

Draft
Copilot wants to merge 1 commit into
developfrom
copilot/weixin-java-channel-add-missing-endpoints
Draft

[WIP] Add missing gift management endpoints to WxChannelProductService#4033
Copilot wants to merge 1 commit into
developfrom
copilot/weixin-java-channel-add-missing-endpoints

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 31, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>[weixin-java-channel] WxChannelProductService 缺失赠品/买赠活动/限时抢购/库存等完整子API(共28个端点)</issue_title>
<issue_description>## 问题描述

WxChannelProductService(视频号小店商品服务)缺少多个官方文档中已有的完整 API 子模块,涉及 28 个端点。

1. 赠品管理(Gift)- 7个端点全缺

官方文档:https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-product/gift/api_addgiftproduct.html

方法 端点
addGiftProduct(添加非卖商品) /channels/ec/product/gift/add
updateGiftProduct(更新非卖商品) /channels/ec/product/gift/update
setProductAsGift(在售商品转赠品) /channels/ec/product/gift/onsale/set
getGiftProduct(获取赠品) /channels/ec/product/gift/get
listGiftProduct(获取赠品列表) /channels/ec/product/gift/list/get
updateGiftStock(更新赠品库存) /channels/ec/product/gift/stock/update

2. 买赠活动(GiftActivity)- 3个端点全缺

方法 端点
addGiftActivity(创建赠品活动) /channels/ec/product/activity/add
deleteGiftActivity(删除赠品活动) /channels/ec/product/activity/del
stopGiftActivity(停止赠品活动) /channels/ec/product/activity/stop

3. 限时抢购(LimitedDiscountTask)- 5个端点全缺

方法 端点
addLimitedDiscountTask(添加限时抢购任务) /channels/ec/product/limiteddiscounttask/add
updateLimitedDiscountTask(更新限时抢购任务) /channels/ec/product/limiteddiscounttask/update
deleteLimitedDiscountTask(删除限时抢购任务) /channels/ec/product/limiteddiscounttask/delete
stopLimitedDiscountTask(停止限时抢购任务) /channels/ec/product/limiteddiscounttask/stop
listLimitedDiscountTask(获取限时抢购任务列表) /channels/ec/product/limiteddiscounttask/list/get

注意:SDK 中已有 addLimitTasklistLimitTaskstopLimitTaskdeleteLimitTask 方法,但缺少完整的 update 接口,且命名不一致(LimitTask vs LimitedDiscountTask 语义不完全对应)。

4. 库存管理(Stock)- 4个端点全缺

方法 端点
getStock(获取库存) /channels/ec/product/stock/get
getStockBatch(批量获取库存) /channels/ec/product/stock/batchget
getStockFlow(获取库存流水) /channels/ec/product/stock/getflow
updateStockFast(快速更新库存) /channels/ec/product/stock/update

5. 其他缺失(9个)

方法 端点 说明
categoryPreCheck /channels/ec/product/categoryprecheck 发品前校验
getProductAuditStrategy /channels/ec/product/auditstrategy/get 获取商品上架策略
setProductAuditStrategy /channels/ec/product/auditstrategy/set 设置商品上架策略
getProductAuditQuota /channels/ec/product/getauditquota 获取商品提审限额
getProductBrandRecommend /channels/ec/product/productbrandrecommend 商品品牌推荐
externalProductMapping /channels/ec/product/externalproductmapping 站内外属性映射
externalProductMappingNew /channels/ec/product/externalproductmappingnew 站内外属性映射v2
beginTimingSale /channels/ec/product/begintimingsale 商品立即开售
cancelTimingSale /channels/ec/product/canceltimingsale 取消商品开售

SDK 文件路径

  • Service接口:weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductService.java
  • ServiceImpl:weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductServiceImpl.java
  • 常量类:weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java(Spu内部接口)

建议

  1. 新增 WxChannelGiftService 处理赠品和买赠活动完整功能
  2. 新增 WxChannelLimitedDiscountService 或扩展现有 WxChannelProductService
  3. 新增 WxChannelProductStockService 处理库存相关接口
  4. 补充商品辅助接口(发品前校验、上架策略、属性映射等)</issue_description>

Comments on the Issue (you are @copilot in this section)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[weixin-java-channel] WxChannelProductService 缺失赠品/买赠活动/限时抢购/库存等完整子API(共28个端点)

2 participants