Skip to content
Draft
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 @@ -8,6 +8,25 @@
import me.chanjar.weixin.channel.bean.limit.LimitTaskParam;
import me.chanjar.weixin.channel.bean.product.SkuStockBatchResponse;
import me.chanjar.weixin.channel.bean.product.SkuStockResponse;
import me.chanjar.weixin.channel.bean.product.AddProductThirdPartySourceParam;
import me.chanjar.weixin.channel.bean.product.ExternalProductMappingNewParam;
import me.chanjar.weixin.channel.bean.product.ExternalProductMappingNewResponse;
import me.chanjar.weixin.channel.bean.product.ExternalProductMappingParam;
import me.chanjar.weixin.channel.bean.product.ExternalProductMappingResponse;
import me.chanjar.weixin.channel.bean.product.ProductAuditQuotaResponse;
import me.chanjar.weixin.channel.bean.product.ProductAuditStrategyResponse;
import me.chanjar.weixin.channel.bean.product.ProductAuditStrategySetParam;
import me.chanjar.weixin.channel.bean.product.ProductBrandRecommendParam;
import me.chanjar.weixin.channel.bean.product.ProductBrandRecommendResponse;
import me.chanjar.weixin.channel.bean.product.ProductCategoryClassifyParam;
import me.chanjar.weixin.channel.bean.product.ProductCategoryClassifyResponse;
import me.chanjar.weixin.channel.bean.product.ProductCategoryPreCheckParam;
import me.chanjar.weixin.channel.bean.product.ProductCategoryPreCheckResponse;
import me.chanjar.weixin.channel.bean.product.ProductSchemeParam;
import me.chanjar.weixin.channel.bean.product.ProductSchemeResponse;
import me.chanjar.weixin.channel.bean.product.ProductStockFlowParam;
import me.chanjar.weixin.channel.bean.product.ProductStockFlowResponse;
import me.chanjar.weixin.channel.bean.product.ProductTimingSaleParam;
import me.chanjar.weixin.channel.bean.product.SpuFastInfo;
import me.chanjar.weixin.channel.bean.product.SpuGetResponse;
import me.chanjar.weixin.channel.bean.product.SpuInfo;
Expand Down Expand Up @@ -206,6 +225,122 @@ WxChannelBaseResponse updateStock(String productId, String skuId, Integer diffTy
*/
ProductTagLinkResponse getProductTagLink(String productId) throws WxErrorException;

/**
* 获取商品的移动应用跳转scheme码
*
* @param param 请求参数
* @return 商品scheme码
* @throws WxErrorException 异常
*/
ProductSchemeResponse getProductScheme(ProductSchemeParam param) throws WxErrorException;

/**
* 商品类目推荐
*
* @param param 请求参数
* @return 推荐类目
* @throws WxErrorException 异常
*/
ProductCategoryClassifyResponse classifyProductCategory(ProductCategoryClassifyParam param) throws WxErrorException;

/**
* 商品立即开售
*
* @param param 请求参数
* @return 是否成功
* @throws WxErrorException 异常
*/
WxChannelBaseResponse beginTimingSale(ProductTimingSaleParam param) throws WxErrorException;

/**
* 取消商品开售
*
* @param productId 商品ID
* @return 是否成功
* @throws WxErrorException 异常
*/
WxChannelBaseResponse cancelTimingSale(String productId) throws WxErrorException;

/**
* 站内外商品属性映射
*
* @param param 请求参数
* @return 映射结果
* @throws WxErrorException 异常
*/
ExternalProductMappingResponse externalProductMapping(ExternalProductMappingParam param) throws WxErrorException;

/**
* 发品前校验
*
* @param param 请求参数
* @return 校验结果
* @throws WxErrorException 异常
*/
ProductCategoryPreCheckResponse categoryPreCheck(ProductCategoryPreCheckParam param) throws WxErrorException;

/**
* 获取商品上架策略
*
* @return 上架策略
* @throws WxErrorException 异常
*/
ProductAuditStrategyResponse getProductAuditStrategy() throws WxErrorException;

/**
* 设置商品上架策略
*
* @param param 请求参数
* @return 是否成功
* @throws WxErrorException 异常
*/
WxChannelBaseResponse setProductAuditStrategy(ProductAuditStrategySetParam param) throws WxErrorException;

/**
* 获取商品提审限额
*
* @return 提审限额
* @throws WxErrorException 异常
*/
ProductAuditQuotaResponse getProductAuditQuota() throws WxErrorException;

/**
* 商品属性映射及推荐
*
* @param param 请求参数
* @return 映射推荐结果
* @throws WxErrorException 异常
*/
ExternalProductMappingNewResponse externalProductMappingNew(ExternalProductMappingNewParam param)
throws WxErrorException;

/**
* 商品品牌推荐
*
* @param param 请求参数
* @return 品牌推荐结果
* @throws WxErrorException 异常
*/
ProductBrandRecommendResponse productBrandRecommend(ProductBrandRecommendParam param) throws WxErrorException;

/**
* 新增第三方货源信息
*
* @param param 请求参数
* @return 是否成功
* @throws WxErrorException 异常
*/
WxChannelBaseResponse addProductThirdPartySource(AddProductThirdPartySourceParam param) throws WxErrorException;

/**
* 获取库存流水
*
* @param param 请求参数
* @return 库存流水
* @throws WxErrorException 异常
*/
ProductStockFlowResponse getStockFlow(ProductStockFlowParam param) throws WxErrorException;

/**
* 添加限时抢购任务
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,30 @@
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.CANCEL_AUDIT_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.DELETE_LIMIT_TASK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.LIST_LIMIT_TASK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_ADD_PRODUCT_THIRD_PARTY_SOURCE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_ADD_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_AUDIT_FREE_UPDATE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_AUDIT_STRATEGY_GET_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_AUDIT_STRATEGY_SET_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_BEGIN_TIMING_SALE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_CANCEL_TIMING_SALE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_CATEGORY_CLASSIFY_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_CATEGORY_PRE_CHECK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_DELISTING_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_DEL_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_EXTERNAL_PRODUCT_MAPPING_NEW_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_EXTERNAL_PRODUCT_MAPPING_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_AUDIT_QUOTA_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_STOCK_BATCH_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_STOCK_FLOW_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_STOCK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_H5URL_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_LISTING_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_LIST_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_PRODUCT_BRAND_RECOMMEND_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_QRCODE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_SCHEME_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_TAGLINK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_UPDATE_STOCK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_UPDATE_URL;
Expand All @@ -29,6 +42,25 @@
import me.chanjar.weixin.channel.bean.limit.LimitTaskListParam;
import me.chanjar.weixin.channel.bean.limit.LimitTaskListResponse;
import me.chanjar.weixin.channel.bean.limit.LimitTaskParam;
import me.chanjar.weixin.channel.bean.product.AddProductThirdPartySourceParam;
import me.chanjar.weixin.channel.bean.product.ExternalProductMappingNewParam;
import me.chanjar.weixin.channel.bean.product.ExternalProductMappingNewResponse;
import me.chanjar.weixin.channel.bean.product.ExternalProductMappingParam;
import me.chanjar.weixin.channel.bean.product.ExternalProductMappingResponse;
import me.chanjar.weixin.channel.bean.product.ProductAuditQuotaResponse;
import me.chanjar.weixin.channel.bean.product.ProductAuditStrategyResponse;
import me.chanjar.weixin.channel.bean.product.ProductAuditStrategySetParam;
import me.chanjar.weixin.channel.bean.product.ProductBrandRecommendParam;
import me.chanjar.weixin.channel.bean.product.ProductBrandRecommendResponse;
import me.chanjar.weixin.channel.bean.product.ProductCategoryClassifyParam;
import me.chanjar.weixin.channel.bean.product.ProductCategoryClassifyResponse;
import me.chanjar.weixin.channel.bean.product.ProductCategoryPreCheckParam;
import me.chanjar.weixin.channel.bean.product.ProductCategoryPreCheckResponse;
import me.chanjar.weixin.channel.bean.product.ProductSchemeParam;
import me.chanjar.weixin.channel.bean.product.ProductSchemeResponse;
import me.chanjar.weixin.channel.bean.product.ProductStockFlowParam;
import me.chanjar.weixin.channel.bean.product.ProductStockFlowResponse;
import me.chanjar.weixin.channel.bean.product.ProductTimingSaleParam;
import me.chanjar.weixin.channel.bean.product.SkuStockBatchParam;
import me.chanjar.weixin.channel.bean.product.SkuStockBatchResponse;
import me.chanjar.weixin.channel.bean.product.SkuStockParam;
Expand Down Expand Up @@ -211,6 +243,101 @@ public ProductTagLinkResponse getProductTagLink(String productId) throws WxError
return ResponseUtils.decode(resJson, ProductTagLinkResponse.class);
}

@Override
public ProductSchemeResponse getProductScheme(ProductSchemeParam param) throws WxErrorException {
String reqJson = JsonUtils.encode(param);
String resJson = shopService.post(SPU_SCHEME_URL, reqJson);
return ResponseUtils.decode(resJson, ProductSchemeResponse.class);
}

@Override
public ProductCategoryClassifyResponse classifyProductCategory(ProductCategoryClassifyParam param)
throws WxErrorException {
String reqJson = JsonUtils.encode(param);
String resJson = shopService.post(SPU_CATEGORY_CLASSIFY_URL, reqJson);
return ResponseUtils.decode(resJson, ProductCategoryClassifyResponse.class);
}

@Override
public WxChannelBaseResponse beginTimingSale(ProductTimingSaleParam param) throws WxErrorException {
String reqJson = JsonUtils.encode(param);
String resJson = shopService.post(SPU_BEGIN_TIMING_SALE_URL, reqJson);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}

@Override
public WxChannelBaseResponse cancelTimingSale(String productId) throws WxErrorException {
String reqJson = "{\"product_id\":\"" + productId + "\"}";
String resJson = shopService.post(SPU_CANCEL_TIMING_SALE_URL, reqJson);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}

@Override
public ExternalProductMappingResponse externalProductMapping(ExternalProductMappingParam param)
throws WxErrorException {
String reqJson = JsonUtils.encode(param);
String resJson = shopService.post(SPU_EXTERNAL_PRODUCT_MAPPING_URL, reqJson);
return ResponseUtils.decode(resJson, ExternalProductMappingResponse.class);
}

@Override
public ProductCategoryPreCheckResponse categoryPreCheck(ProductCategoryPreCheckParam param)
throws WxErrorException {
String reqJson = JsonUtils.encode(param);
String resJson = shopService.post(SPU_CATEGORY_PRE_CHECK_URL, reqJson);
return ResponseUtils.decode(resJson, ProductCategoryPreCheckResponse.class);
}

@Override
public ProductAuditStrategyResponse getProductAuditStrategy() throws WxErrorException {
String resJson = shopService.post(SPU_AUDIT_STRATEGY_GET_URL, "{}");
return ResponseUtils.decode(resJson, ProductAuditStrategyResponse.class);
}

@Override
public WxChannelBaseResponse setProductAuditStrategy(ProductAuditStrategySetParam param) throws WxErrorException {
String reqJson = JsonUtils.encode(param);
String resJson = shopService.post(SPU_AUDIT_STRATEGY_SET_URL, reqJson);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}

@Override
public ProductAuditQuotaResponse getProductAuditQuota() throws WxErrorException {
String resJson = shopService.post(SPU_GET_AUDIT_QUOTA_URL, "{}");
return ResponseUtils.decode(resJson, ProductAuditQuotaResponse.class);
}

@Override
public ExternalProductMappingNewResponse externalProductMappingNew(ExternalProductMappingNewParam param)
throws WxErrorException {
String reqJson = JsonUtils.encode(param);
String resJson = shopService.post(SPU_EXTERNAL_PRODUCT_MAPPING_NEW_URL, reqJson);
return ResponseUtils.decode(resJson, ExternalProductMappingNewResponse.class);
}

@Override
public ProductBrandRecommendResponse productBrandRecommend(ProductBrandRecommendParam param)
throws WxErrorException {
String reqJson = JsonUtils.encode(param);
String resJson = shopService.post(SPU_PRODUCT_BRAND_RECOMMEND_URL, reqJson);
return ResponseUtils.decode(resJson, ProductBrandRecommendResponse.class);
}

@Override
public WxChannelBaseResponse addProductThirdPartySource(AddProductThirdPartySourceParam param)
throws WxErrorException {
String reqJson = JsonUtils.encode(param);
String resJson = shopService.post(SPU_ADD_PRODUCT_THIRD_PARTY_SOURCE_URL, reqJson);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}

@Override
public ProductStockFlowResponse getStockFlow(ProductStockFlowParam param) throws WxErrorException {
String reqJson = JsonUtils.encode(param);
String resJson = shopService.post(SPU_GET_STOCK_FLOW_URL, reqJson);
return ResponseUtils.decode(resJson, ProductStockFlowResponse.class);
}

@Override
public LimitTaskAddResponse addLimitTask(LimitTaskParam param) throws WxErrorException {
String reqJson = JsonUtils.encode(param);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package me.chanjar.weixin.channel.bean.product;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import java.io.Serializable;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* 新增第三方货源信息请求参数.
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
public class AddProductThirdPartySourceParam implements Serializable {

private static final long serialVersionUID = -5784320217481497742L;

/** 场景值. */
@JsonProperty("scene_value")
private Integer sceneValue;

/** 商品发布方式. */
@JsonProperty("publish_method")
private Integer publishMethod;

/** 货主信息. */
private JsonNode supplier;

/** 货主店铺经营表现. */
@JsonProperty("supplier_shop_performance")
private JsonNode supplierShopPerformance;

/** 商品在货源平台信息. */
@JsonProperty("product_source_info")
private JsonNode productSourceInfo;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package me.chanjar.weixin.channel.bean.product;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* 商品属性映射及推荐请求参数.
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
public class ExternalProductMappingNewParam implements Serializable {

private static final long serialVersionUID = -7982070319116550518L;

/** 叶子类目ID. */
@JsonProperty("cat_id")
private Long catId;

/** 外部商品类目名称. */
@JsonProperty("external_category_name")
private String externalCategoryName;

/** 商品主图. */
@JsonProperty("head_imgs")
private List<String> headImgs;

/** 商品详情图. */
@JsonProperty("detail_imgs")
private List<String> detailImgs;

/** 商品标题. */
private String title;

/** 外部属性列表. */
@JsonProperty("external_attributes")
private List<ExternalAttribute> externalAttributes;

@Data
@NoArgsConstructor
public static class ExternalAttribute implements Serializable {
private static final long serialVersionUID = 300805187240781417L;

private String key;
private String value;
}
}
Loading