mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
🎨 #3426【视频号】更新视频号小店/微信小店类目、订单、商品、主页管理等相关接口
This commit is contained in:
@@ -11,10 +11,10 @@
|
||||
|
||||
<artifactId>weixin-java-channel</artifactId>
|
||||
<name>WxJava - Channel Java SDK</name>
|
||||
<description>微信视频号 Java SDK</description>
|
||||
<description>微信视频号/微信小店 Java SDK</description>
|
||||
|
||||
<properties>
|
||||
<jackson.version>2.15.0</jackson.version>
|
||||
<jackson.version>2.18.1</jackson.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -20,6 +20,8 @@ import me.chanjar.weixin.channel.bean.message.order.OrderStatusMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.product.BrandMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.product.CategoryAuditMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.product.SpuAuditMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.store.CloseStoreMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.store.NicknameUpdateMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.supplier.SupplierItemMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.vip.ExchangeInfoMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.vip.UserInfoMessage;
|
||||
@@ -55,6 +57,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 订单下单
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -66,6 +69,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 订单取消
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -77,6 +81,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 订单支付成功
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -88,6 +93,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 订单发货
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -99,6 +105,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 订单确认收货
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -110,6 +117,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 订单结算成功
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -121,6 +129,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 订单其他信息更新
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -132,6 +141,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 订单状态更新
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -143,6 +153,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 商品审核结果
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -154,6 +165,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 商品系统下架通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -165,6 +177,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 商品更新通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -176,6 +189,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 类目审核结果
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -187,6 +201,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 品牌更新
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -198,6 +213,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 售后单状态更新
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -209,6 +225,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 纠纷回调
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -220,6 +237,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 用户领券通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -231,6 +249,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 创建优惠券通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -242,6 +261,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 优惠券删除通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -253,6 +273,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 优惠券过期通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -264,6 +285,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 更新优惠券信息通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -275,6 +297,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 优惠券作废通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -286,6 +309,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 用户优惠券过期通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -297,6 +321,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 用户优惠券使用通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -308,6 +333,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 用户优惠券返还通知
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -319,6 +345,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 结算账户变更回调
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -330,6 +357,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 提现回调
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -341,6 +369,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 提现二维码回调
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -352,6 +381,7 @@ public interface BaseWxChannelMessageService {
|
||||
* 团长商品变更
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
@@ -420,12 +450,36 @@ public interface BaseWxChannelMessageService {
|
||||
void vipScoreExchange(ExchangeInfoMessage message, final String content, final String appId,
|
||||
final Map<String, Object> context, final WxSessionManager sessionManager);
|
||||
|
||||
/**
|
||||
* 小店注销
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
*/
|
||||
void closeStore(CloseStoreMessage message, final String content, final String appId,
|
||||
final Map<String, Object> context, final WxSessionManager sessionManager);
|
||||
|
||||
|
||||
/**
|
||||
* 小店修改名称
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
*/
|
||||
void updateNickname(NicknameUpdateMessage message, final String content, final String appId,
|
||||
final Map<String, Object> context, final WxSessionManager sessionManager);
|
||||
|
||||
/**
|
||||
* 默认消息处理
|
||||
*
|
||||
* @param message 消息
|
||||
* @param content 内容
|
||||
* @param content 消息原始内容
|
||||
* @param appId appId
|
||||
* @param context 上下文
|
||||
* @param sessionManager session管理器
|
||||
|
||||
@@ -41,8 +41,7 @@ public interface BaseWxChannelService extends WxService {
|
||||
* <pre>
|
||||
* 获取access_token,本方法线程安全.
|
||||
* 且在多线程同时刷新时只刷新一次,避免超出2000次/日的调用次数上限
|
||||
*
|
||||
* 另:本service的所有方法都会在access_token过期是调用此方法
|
||||
* 使用【稳定版接口】获取access_token时,限制【20次/日】,连续使用该模式时,请保证调用时间隔至少为30s,否则不会刷新
|
||||
*
|
||||
* 程序员在非必要情况下尽量不要主动调用此方法
|
||||
*
|
||||
|
||||
@@ -4,17 +4,20 @@ import java.io.File;
|
||||
import java.util.List;
|
||||
import me.chanjar.weixin.channel.bean.audit.AuditApplyResponse;
|
||||
import me.chanjar.weixin.channel.bean.audit.AuditResponse;
|
||||
import me.chanjar.weixin.channel.bean.audit.CategoryAuditInfo;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
import me.chanjar.weixin.channel.bean.category.CategoryDetailResult;
|
||||
import me.chanjar.weixin.channel.bean.category.CategoryQualificationResponse;
|
||||
import me.chanjar.weixin.channel.bean.category.PassCategoryResponse;
|
||||
import me.chanjar.weixin.channel.bean.category.ShopCategory;
|
||||
import me.chanjar.weixin.channel.bean.category.ShopCategoryResponse;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
/**
|
||||
* 视频号小店 商品类目相关接口
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
* @see <a href="https://developers.weixin.qq.com/doc/store/API/category/new_old_diff.html">新旧类目树差异</a>
|
||||
*/
|
||||
public interface WxChannelCategoryService {
|
||||
|
||||
@@ -30,12 +33,27 @@ public interface WxChannelCategoryService {
|
||||
/**
|
||||
* 获取商品类目列表(全量) 有频率限制
|
||||
*
|
||||
* @param parentId 类目父id
|
||||
* @param fCatId 类目父id
|
||||
* @return 类目列表
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
* @deprecated 接口返回更新,请使用 {@link #listAvailableCategories(String)}
|
||||
*/
|
||||
List<ShopCategory> listAvailableCategory(String parentId) throws WxErrorException;
|
||||
@Deprecated
|
||||
List<ShopCategory> listAvailableCategory(String fCatId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取可用的子类目详情
|
||||
*
|
||||
* 1.f_cat_id 为旧类目树中的非叶子类目,仅设置 cat_list 字段。
|
||||
* 2.f_cat_id 为新类目树中的非叶子类目,仅设置 cat_list_v2 字段。
|
||||
* 3.f_cat_id 为0,同时设置 cat_list 和 cat_list_v2 字段
|
||||
*
|
||||
* @param fCatId 父类目ID,可先填0获取根部类目
|
||||
* @return 类目列表
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
ShopCategoryResponse listAvailableCategories(String fCatId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取类目信息
|
||||
@@ -58,10 +76,23 @@ public interface WxChannelCategoryService {
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
* @see WxChannelBasicService#uploadQualificationFile(File)
|
||||
* @deprecated 请使用 {@link #addCategory(CategoryAuditInfo)}
|
||||
*/
|
||||
@Deprecated
|
||||
AuditApplyResponse addCategory(String level1, String level2, String level3, List<String> certificate)
|
||||
throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 上传类目资质
|
||||
*
|
||||
* @param info 类目资质信息
|
||||
* @return 审核id
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
* @see WxChannelBasicService#uploadQualificationFile(File)
|
||||
*/
|
||||
AuditApplyResponse addCategory(CategoryAuditInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 取消类目提审
|
||||
*
|
||||
|
||||
@@ -3,14 +3,17 @@ package me.chanjar.weixin.channel.api;
|
||||
import java.util.List;
|
||||
import me.chanjar.weixin.channel.bean.base.AddressInfo;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
import me.chanjar.weixin.channel.bean.delivery.PackageAuditInfo;
|
||||
import me.chanjar.weixin.channel.bean.delivery.DeliveryCompanyResponse;
|
||||
import me.chanjar.weixin.channel.bean.delivery.DeliveryInfo;
|
||||
import me.chanjar.weixin.channel.bean.order.ChangeOrderInfo;
|
||||
import me.chanjar.weixin.channel.bean.order.DecodeSensitiveInfoResponse;
|
||||
import me.chanjar.weixin.channel.bean.order.DeliveryUpdateParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderInfoResponse;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderListParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderListResponse;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderSearchParam;
|
||||
import me.chanjar.weixin.channel.bean.order.VirtualTelNumberResponse;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
/**
|
||||
@@ -143,4 +146,37 @@ public interface WxChannelOrderService {
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse deliveryOrder(String orderId, List<DeliveryInfo> deliveryList) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 上传生鲜质检信息<br />
|
||||
*
|
||||
* 注意事项:<br />
|
||||
* 1. 非生鲜质检的订单不能进行上传 <br />
|
||||
* 2. 图片url必须用图片上传接口获取 {@link WxChannelBasicService#uploadImg(int, String)}<br />
|
||||
*
|
||||
* @param orderId 订单id
|
||||
* @param items 商品打包信息
|
||||
* @return BaseResponse
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse uploadFreshInspect(String orderId, List<PackageAuditInfo> items) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 兑换虚拟号
|
||||
*
|
||||
* @param orderId 订单id
|
||||
* @return 虚拟号信息
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
VirtualTelNumberResponse getVirtualTelNumber(String orderId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 解码订单包含的敏感数据
|
||||
*
|
||||
* @param orderId 订单id
|
||||
* @return 解码结果
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
DecodeSensitiveInfoResponse decodeSensitiveInfo(String orderId) throws WxErrorException;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
package me.chanjar.weixin.channel.api;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
import me.chanjar.weixin.channel.bean.limit.LimitTaskAddResponse;
|
||||
import me.chanjar.weixin.channel.bean.limit.LimitTaskListResponse;
|
||||
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.SpuFastInfo;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuGetResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuInfo;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuListResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuUpdateInfo;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuUpdateResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.link.ProductH5UrlResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.link.ProductQrCodeResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.link.ProductTagLinkResponse;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
/**
|
||||
* 视频号小店 商品服务接口
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
* @see <a href="https://developers.weixin.qq.com/doc/store/API/product/product_status.html">商品状态流转图</a>
|
||||
*/
|
||||
public interface WxChannelProductService {
|
||||
|
||||
@@ -27,7 +35,7 @@ public interface WxChannelProductService {
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
SpuUpdateResponse addProduct(SpuInfo info) throws WxErrorException;
|
||||
SpuUpdateResponse addProduct(SpuUpdateInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 更新商品
|
||||
@@ -37,14 +45,49 @@ public interface WxChannelProductService {
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
SpuUpdateResponse updateProduct(SpuUpdateInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 添加商品
|
||||
*
|
||||
* @param info 商品信息
|
||||
* @return 返回商品的状态和id
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
* @deprecated 请使用 {@link #addProduct(SpuUpdateInfo)}
|
||||
*/
|
||||
@Deprecated
|
||||
SpuUpdateResponse addProduct(SpuInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 更新商品
|
||||
*
|
||||
* @param info 商品信息
|
||||
* @return 返回商品的状态和id
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
* @deprecated 请使用 {@link #updateProduct(SpuUpdateInfo)}
|
||||
*/
|
||||
@Deprecated
|
||||
SpuUpdateResponse updateProduct(SpuInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 免审更新商品
|
||||
*
|
||||
* @param info 商品信息
|
||||
* @return 返回商品的状态和id
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse updateProductAuditFree(SpuFastInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 更新商品库存 (仅对edit_status != 2 的商品适用,其他状态的商品无法通过该接口修改库存)
|
||||
*
|
||||
* @param productId 内部商品ID
|
||||
* @param skuId 内部sku_id
|
||||
* @param diffType 修改类型 1增加 2减少 3设置
|
||||
* 建议使用1或2,不建议使用3,因为使用3在高并发场景可能会出现预期外表现
|
||||
* @param num 增加、减少或者设置的库存值
|
||||
* @return WxChannelBaseResponse
|
||||
*
|
||||
@@ -127,6 +170,42 @@ public interface WxChannelProductService {
|
||||
*/
|
||||
SkuStockResponse getSkuStock(String productId, String skuId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 批量获取库存信息 (单次请求不能超过50个商品ID)
|
||||
*
|
||||
* @param productIds 商品ID列表
|
||||
* @return 库存信息
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
SkuStockBatchResponse getSkuStockBatch(List<String> productIds) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取商品H5链接
|
||||
*
|
||||
* @param productId 商品ID
|
||||
* @return 商品H5链接
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
ProductH5UrlResponse getProductH5Url(String productId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取商品二维码
|
||||
*
|
||||
* @param productId 商品ID
|
||||
* @return 商品二维码
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
ProductQrCodeResponse getProductQrCode(String productId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取商品口令
|
||||
*
|
||||
* @param productId 商品ID
|
||||
* @return 商品口令
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
ProductTagLinkResponse getProductTagLink(String productId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 添加限时抢购任务
|
||||
*
|
||||
|
||||
@@ -91,6 +91,13 @@ public interface WxChannelService extends BaseWxChannelService {
|
||||
*/
|
||||
WxChannelFundService getFundService();
|
||||
|
||||
/**
|
||||
* 主页管理服务
|
||||
*
|
||||
* @return 主页管理服务
|
||||
*/
|
||||
WxStoreHomePageService getHomePageService();
|
||||
|
||||
/**
|
||||
* 优选联盟-团长合作达人管理服务
|
||||
*
|
||||
@@ -140,7 +147,6 @@ public interface WxChannelService extends BaseWxChannelService {
|
||||
*/
|
||||
WxAssistantService getAssistantService();
|
||||
|
||||
|
||||
/**
|
||||
* 会员功能
|
||||
*
|
||||
|
||||
@@ -45,11 +45,11 @@ public interface WxChannelVipService {
|
||||
*
|
||||
* @param needPhoneNumber the need phone number
|
||||
* @param pageNum the page num
|
||||
* @param PageSize the page size
|
||||
* @param pageSize the page size
|
||||
* @return the vip list
|
||||
* @throws WxErrorException the wx error exception
|
||||
*/
|
||||
VipListResponse getVipList(Boolean needPhoneNumber, Integer pageNum, Integer PageSize) throws WxErrorException;
|
||||
VipListResponse getVipList(Boolean needPhoneNumber, Integer pageNum, Integer pageSize) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取用户积分
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
package me.chanjar.weixin.channel.api;
|
||||
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.background.BackgroundApplyResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.background.BackgroundGetResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.banner.BannerApplyResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.banner.BannerGetResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.banner.BannerInfo;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeProductEditInfo;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeProductListInfo;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeProductListResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeShowGetResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeShowInfo;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeShowSetResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.window.WindowProductSettingResponse;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
/**
|
||||
* 微信小店 主页管理相关接口
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
public interface WxStoreHomePageService {
|
||||
|
||||
/**
|
||||
* 添加分类关联的商品
|
||||
*
|
||||
* @param info 商品分类以及商品id
|
||||
* @return BaseResponse
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse addTreeProduct(TreeProductEditInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 删除分类关联的商品
|
||||
*
|
||||
* @param info 商品分类以及商品id
|
||||
* @return BaseResponse
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse delTreeProduct(TreeProductEditInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取分类关联的商品ID列表
|
||||
*
|
||||
* @param info 分类id、分页大小、分页上下文
|
||||
* @return 商品id、分页上下文
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
TreeProductListResponse getTreeProductList(TreeProductListInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 设置展示在店铺主页的商品分类
|
||||
*
|
||||
* @param info 分类id
|
||||
* @return 商品分类审核结果
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
TreeShowSetResponse setShowTree(TreeShowInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取展示在店铺主页的商品分类
|
||||
*
|
||||
* @return 商品分类信息
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
TreeShowGetResponse getShowTree() throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取主页展示商品列表
|
||||
*
|
||||
* @param pageSize 分页大小
|
||||
* @param nextKey 分页上下文
|
||||
* @return WindowProductSettingResponse
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WindowProductSettingResponse listWindowProduct(Integer pageSize, String nextKey) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 删除主页展示商品
|
||||
*
|
||||
* @param productId 商品id
|
||||
* @param indexNum 商品重新排序后的新序号,最大移动步长为500(即新序号与当前序号的距离小于500)
|
||||
* @return BaseResponse
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse reorderWindowProduct(String productId, Integer indexNum) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 隐藏小店主页商品
|
||||
*
|
||||
* @param productId 商品id
|
||||
* @param setHide 是否隐藏。1-隐藏,0-取消隐藏
|
||||
* @return BaseResponse
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse hideWindowProduct(String productId, Integer setHide) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 置顶小店主页商品
|
||||
*
|
||||
* @param productId 商品id
|
||||
* @param setTop 是否顶置。1-置顶,0-取消置顶
|
||||
* @return BaseResponse
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse topWindowProduct(String productId, Integer setTop) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 提交背景图申请
|
||||
*
|
||||
* @param imgUrl 图片链接。请务必使用接口上传图片(参数resp_type=1),并将返回的img_url填入此处,不接受其他任何格式的图片url。
|
||||
* 若url曾经做过转换(url前缀为mmecimage.cn/p/),则可以直接提交。
|
||||
* @return 申请编号
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
* @see WxChannelBasicService#uploadImg(int, String)
|
||||
*/
|
||||
BackgroundApplyResponse applyBackground(String imgUrl) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 查询背景图
|
||||
*
|
||||
* @return 背景图信息
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
BackgroundGetResponse getBackground() throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 撤销主页背景图申请
|
||||
*
|
||||
* @param applyId 申请编号
|
||||
* @return BaseResponse
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse cancelBackground(Integer applyId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 清空主页背景图并撤销流程中的申请
|
||||
*
|
||||
* @return BaseResponse
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse removeBackground() throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 提交精选展示位申请
|
||||
*
|
||||
* @param info 展示位信息
|
||||
* @return 申请编号
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
BannerApplyResponse applyBanner(BannerInfo info) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 查询精选展示位
|
||||
*
|
||||
* @return 展示位信息
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
BannerGetResponse getBanner() throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 撤销精选展示位申请
|
||||
*
|
||||
* @param applyId 申请编号
|
||||
* @return BaseResponse
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse cancelBanner(Integer applyId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 清空精选展示位并撤销流程中的申请
|
||||
*
|
||||
* @return BaseResponse
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse removeBanner() throws WxErrorException;
|
||||
}
|
||||
@@ -24,6 +24,8 @@ import me.chanjar.weixin.channel.bean.message.product.BrandMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.product.CategoryAuditMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.product.SpuAuditMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.sharer.SharerChangeMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.store.CloseStoreMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.store.NicknameUpdateMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.supplier.SupplierItemMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.vip.ExchangeInfoMessage;
|
||||
import me.chanjar.weixin.channel.bean.message.vip.UserInfoMessage;
|
||||
@@ -111,7 +113,6 @@ public abstract class BaseWxChannelMessageServiceImpl implements BaseWxChannelMe
|
||||
/* 团长 */
|
||||
this.addRule(SupplierItemMessage.class, SUPPLIER_ITEM_UPDATE, this::supplierItemUpdate);
|
||||
|
||||
|
||||
/* 用户加入会员 */
|
||||
this.addRule(UserInfoMessage.class, USER_VIP_JOIN, false, this::vipJoin);
|
||||
/* 用户注销会员 */
|
||||
@@ -123,9 +124,13 @@ public abstract class BaseWxChannelMessageServiceImpl implements BaseWxChannelMe
|
||||
/* 用户积分兑换 */
|
||||
this.addRule(ExchangeInfoMessage.class, USER_VIP_SCORE_EXCHANGE, false, this::vipScoreExchange);
|
||||
|
||||
|
||||
/* 分享员变更 */
|
||||
this.addRule(SharerChangeMessage.class,SHARER_CHANGE,false,this::sharerChange);
|
||||
|
||||
/* 小店注销 */
|
||||
this.addRule(CloseStoreMessage.class, CLOSE_STORE, this::closeStore);
|
||||
/* 小店修改名称 */
|
||||
this.addRule(NicknameUpdateMessage.class, SET_SHOP_NICKNAME, this::updateNickname);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,22 +349,44 @@ public abstract class BaseWxChannelMessageServiceImpl implements BaseWxChannelMe
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void vipJoin(UserInfoMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager);
|
||||
public void vipJoin(UserInfoMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager) {
|
||||
log.info("用户加入会员:{}", JsonUtils.encode(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void vipClose(UserInfoMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager);
|
||||
public void vipClose(UserInfoMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager) {
|
||||
log.info("用户注销会员:{}", JsonUtils.encode(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void vipGradeUpdate(UserInfoMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager);
|
||||
public void vipGradeUpdate(UserInfoMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager) {
|
||||
log.info("用户等级信息更新:{}", JsonUtils.encode(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void vipScoreUpdate(UserInfoMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager);
|
||||
public void vipScoreUpdate(UserInfoMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager) {
|
||||
log.info("用户积分更新:{}", JsonUtils.encode(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void vipScoreExchange(ExchangeInfoMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager);
|
||||
public void vipScoreExchange(ExchangeInfoMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager) {
|
||||
log.info("用户积分兑换:{}", JsonUtils.encode(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeStore(CloseStoreMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager) {
|
||||
log.info("小店注销:{}", JsonUtils.encode(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateNickname(NicknameUpdateMessage message, String content, String appId,
|
||||
Map<String, Object> context, WxSessionManager sessionManager) {
|
||||
log.info("小店修改名称:{}", JsonUtils.encode(message));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
private final WxChannelCouponService couponService = new WxChannelCouponServiceImpl(this);
|
||||
private final WxChannelSharerService sharerService = new WxChannelSharerServiceImpl(this);
|
||||
private final WxChannelFundService fundService = new WxChannelFundServiceImpl(this);
|
||||
private WxStoreHomePageService homePageService = null;
|
||||
private WxLeagueWindowService leagueWindowService = null;
|
||||
private WxLeagueSupplierService leagueSupplierService = null;
|
||||
private WxLeaguePromoterService leaguePromoterService = null;
|
||||
@@ -54,7 +55,7 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
private WxLeadComponentService leadComponentService = null;
|
||||
private WxFinderLiveService finderLiveService = null;
|
||||
private WxAssistantService assistantService = null;
|
||||
private WxChannelVipService vipService = new WxChannelVipServiceImpl(this);
|
||||
private WxChannelVipService vipService = null;
|
||||
private final WxChannelCompassFinderService compassFinderService =
|
||||
new WxChannelCompassFinderServiceImpl(this);
|
||||
private final WxChannelLiveDashboardService liveDashboardService =
|
||||
@@ -99,9 +100,14 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
return this.getConfig().getAccessToken();
|
||||
}
|
||||
} while (!locked);
|
||||
String response = doGetAccessTokenRequest();
|
||||
String response;
|
||||
if (getConfig().isStableAccessToken()) {
|
||||
response = doGetStableAccessTokenRequest(forceRefresh);
|
||||
} else {
|
||||
response = doGetAccessTokenRequest();
|
||||
}
|
||||
return extractAccessToken(response);
|
||||
} catch (WxErrorException | InterruptedException e) {
|
||||
} catch (IOException | InterruptedException e) {
|
||||
throw new WxRuntimeException(e);
|
||||
} finally {
|
||||
if (locked) {
|
||||
@@ -113,10 +119,18 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
/**
|
||||
* 通过网络请求获取AccessToken
|
||||
*
|
||||
* @return .
|
||||
* @throws IOException .
|
||||
* @return AccessToken
|
||||
* @throws IOException IOException
|
||||
*/
|
||||
protected abstract String doGetAccessTokenRequest() throws WxErrorException;
|
||||
protected abstract String doGetAccessTokenRequest() throws IOException;
|
||||
|
||||
/**
|
||||
* 通过网络请求获取稳定版AccessToken
|
||||
*
|
||||
* @return Stable AccessToken
|
||||
* @throws IOException IOException
|
||||
*/
|
||||
protected abstract String doGetStableAccessTokenRequest(boolean forceRefresh) throws IOException;
|
||||
|
||||
@Override
|
||||
public String get(String url, String queryParam) throws WxErrorException {
|
||||
@@ -262,9 +276,9 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
protected String extractAccessToken(String resultContent) throws WxErrorException {
|
||||
log.info("resultContent: " + resultContent);
|
||||
log.debug("access-token response: " + resultContent);
|
||||
WxChannelConfig config = this.getConfig();
|
||||
WxError error = WxError.fromJson(resultContent, WxType.MiniApp);
|
||||
WxError error = WxError.fromJson(resultContent, WxType.Channel);
|
||||
if (error.getErrorCode() != 0) {
|
||||
throw new WxErrorException(error);
|
||||
}
|
||||
@@ -354,6 +368,14 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
return fundService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized WxStoreHomePageService getHomePageService() {
|
||||
if (homePageService == null) {
|
||||
homePageService = new WxStoreHomePageServiceImpl(this);
|
||||
}
|
||||
return homePageService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized WxLeagueWindowService getLeagueWindowService() {
|
||||
if (leagueWindowService == null) {
|
||||
@@ -413,6 +435,9 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
|
||||
@Override
|
||||
public WxChannelVipService getVipService() {
|
||||
if (vipService == null) {
|
||||
vipService = new WxChannelVipServiceImpl(this);
|
||||
}
|
||||
return vipService;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,14 @@ public class WxChannelCategoryServiceImpl implements WxChannelCategoryService {
|
||||
return response.getCategories();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopCategoryResponse listAvailableCategories(String fCatId) throws WxErrorException {
|
||||
String reqJson = "{\"f_cat_id\": " + fCatId + "}";
|
||||
String resJson = (String) shopService.executeWithoutLog(SimplePostRequestExecutor.create(shopService),
|
||||
AVAILABLE_CATEGORY_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, ShopCategoryResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoryDetailResult getCategoryDetail(String id) throws WxErrorException {
|
||||
Long catId = null;
|
||||
@@ -89,7 +97,11 @@ public class WxChannelCategoryServiceImpl implements WxChannelCategoryService {
|
||||
Long l1 = Long.parseLong(level1);
|
||||
Long l2 = Long.parseLong(level2);
|
||||
Long l3 = Long.parseLong(level3);
|
||||
CategoryAuditInfo categoryInfo = new CategoryAuditInfo(l1, l2, l3, certificate);
|
||||
CategoryAuditInfo categoryInfo = new CategoryAuditInfo();
|
||||
categoryInfo.setLevel1(l1);
|
||||
categoryInfo.setLevel2(l2);
|
||||
categoryInfo.setLevel3(l3);
|
||||
categoryInfo.setCertificates(certificate);
|
||||
reqJson = JsonUtils.encode(new CategoryAuditRequest(categoryInfo));
|
||||
} catch (Throwable e) {
|
||||
log.error("微信请求异常", e);
|
||||
@@ -98,6 +110,13 @@ public class WxChannelCategoryServiceImpl implements WxChannelCategoryService {
|
||||
return ResponseUtils.decode(resJson, AuditApplyResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuditApplyResponse addCategory(CategoryAuditInfo info) throws WxErrorException {
|
||||
String reqJson = JsonUtils.encode(new CategoryAuditRequest(info));
|
||||
String resJson = shopService.post(ADD_CATEGORY_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, AuditApplyResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse cancelCategoryAudit(String auditId) throws WxErrorException {
|
||||
String resJson = shopService.post(CANCEL_CATEGORY_AUDIT_URL, "{\"audit_id\": \"" + auditId + "\"}");
|
||||
|
||||
@@ -9,10 +9,13 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.channel.api.WxChannelOrderService;
|
||||
import me.chanjar.weixin.channel.bean.base.AddressInfo;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
import me.chanjar.weixin.channel.bean.delivery.PackageAuditInfo;
|
||||
import me.chanjar.weixin.channel.bean.delivery.DeliveryCompanyResponse;
|
||||
import me.chanjar.weixin.channel.bean.delivery.DeliveryInfo;
|
||||
import me.chanjar.weixin.channel.bean.delivery.DeliverySendParam;
|
||||
import me.chanjar.weixin.channel.bean.delivery.FreshInspectParam;
|
||||
import me.chanjar.weixin.channel.bean.order.ChangeOrderInfo;
|
||||
import me.chanjar.weixin.channel.bean.order.DecodeSensitiveInfoResponse;
|
||||
import me.chanjar.weixin.channel.bean.order.DeliveryUpdateParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderAddressParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderIdParam;
|
||||
@@ -22,6 +25,7 @@ import me.chanjar.weixin.channel.bean.order.OrderListResponse;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderPriceParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderRemarkParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderSearchParam;
|
||||
import me.chanjar.weixin.channel.bean.order.VirtualTelNumberResponse;
|
||||
import me.chanjar.weixin.channel.util.ResponseUtils;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
@@ -122,4 +126,26 @@ public class WxChannelOrderServiceImpl implements WxChannelOrderService {
|
||||
String resJson = shopService.post(DELIVERY_SEND_URL, param);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse uploadFreshInspect(String orderId, List<PackageAuditInfo> items)
|
||||
throws WxErrorException {
|
||||
FreshInspectParam param = new FreshInspectParam(orderId, items);
|
||||
String resJson = shopService.post(UPLOAD_FRESH_INSPECT_URL, param);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VirtualTelNumberResponse getVirtualTelNumber(String orderId) throws WxErrorException {
|
||||
String reqJson = "{\"order_id\":\"" + orderId + "\"}";
|
||||
String resJson = shopService.post(VIRTUAL_TEL_NUMBER_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, VirtualTelNumberResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DecodeSensitiveInfoResponse decodeSensitiveInfo(String orderId) throws WxErrorException {
|
||||
String reqJson = "{\"order_id\":\"" + orderId + "\"}";
|
||||
String resJson = shopService.post(DECODE_SENSITIVE_INFO_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, DecodeSensitiveInfoResponse.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,16 +6,22 @@ import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.CA
|
||||
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_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_DELISTING_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_DEL_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_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_QRCODE_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;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.STOP_LIMIT_TASK_URL;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.channel.api.WxChannelProductService;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
@@ -23,13 +29,20 @@ import me.chanjar.weixin.channel.bean.limit.LimitTaskAddResponse;
|
||||
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.SkuStockBatchParam;
|
||||
import me.chanjar.weixin.channel.bean.product.SkuStockBatchResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.SkuStockParam;
|
||||
import me.chanjar.weixin.channel.bean.product.SkuStockResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuFastInfo;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuGetResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuInfo;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuListParam;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuListResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuUpdateInfo;
|
||||
import me.chanjar.weixin.channel.bean.product.SpuUpdateResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.link.ProductH5UrlResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.link.ProductQrCodeResponse;
|
||||
import me.chanjar.weixin.channel.bean.product.link.ProductTagLinkResponse;
|
||||
import me.chanjar.weixin.channel.util.JsonUtils;
|
||||
import me.chanjar.weixin.channel.util.ResponseUtils;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
@@ -49,6 +62,20 @@ public class WxChannelProductServiceImpl implements WxChannelProductService {
|
||||
this.shopService = shopService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpuUpdateResponse addProduct(SpuUpdateInfo info) throws WxErrorException {
|
||||
String reqJson = JsonUtils.encode(info);
|
||||
String resJson = shopService.post(SPU_ADD_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, SpuUpdateResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpuUpdateResponse updateProduct(SpuUpdateInfo info) throws WxErrorException {
|
||||
String reqJson = JsonUtils.encode(info);
|
||||
String resJson = shopService.post(SPU_UPDATE_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, SpuUpdateResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpuUpdateResponse addProduct(SpuInfo info) throws WxErrorException {
|
||||
String reqJson = JsonUtils.encode(info);
|
||||
@@ -63,6 +90,13 @@ public class WxChannelProductServiceImpl implements WxChannelProductService {
|
||||
return ResponseUtils.decode(resJson, SpuUpdateResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse updateProductAuditFree(SpuFastInfo info) throws WxErrorException {
|
||||
String reqJson = JsonUtils.encode(info);
|
||||
String resJson = shopService.post(SPU_AUDIT_FREE_UPDATE_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, SpuUpdateResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse updateStock(String productId, String skuId, Integer diffType, Integer num)
|
||||
throws WxErrorException {
|
||||
@@ -148,6 +182,35 @@ public class WxChannelProductServiceImpl implements WxChannelProductService {
|
||||
return ResponseUtils.decode(resJson, SkuStockResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkuStockBatchResponse getSkuStockBatch(List<String> productIds) throws WxErrorException {
|
||||
SkuStockBatchParam param = new SkuStockBatchParam(productIds);
|
||||
String reqJson = JsonUtils.encode(param);
|
||||
String resJson = shopService.post(SPU_GET_STOCK_BATCH_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, SkuStockBatchResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductH5UrlResponse getProductH5Url(String productId) throws WxErrorException {
|
||||
String reqJson = "{\"product_id\":\"" + productId + "\"}";
|
||||
String resJson = shopService.post(SPU_H5URL_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, ProductH5UrlResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductQrCodeResponse getProductQrCode(String productId) throws WxErrorException {
|
||||
String reqJson = "{\"product_id\":\"" + productId + "\"}";
|
||||
String resJson = shopService.post(SPU_QRCODE_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, ProductQrCodeResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductTagLinkResponse getProductTagLink(String productId) throws WxErrorException {
|
||||
String reqJson = "{\"product_id\":\"" + productId + "\"}";
|
||||
String resJson = shopService.post(SPU_TAGLINK_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, ProductTagLinkResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LimitTaskAddResponse addLimitTask(LimitTaskParam param) throws WxErrorException {
|
||||
String reqJson = JsonUtils.encode(param);
|
||||
|
||||
@@ -5,22 +5,20 @@ import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.GET_ST
|
||||
|
||||
import java.io.IOException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.channel.api.WxChannelVipService;
|
||||
import me.chanjar.weixin.channel.bean.token.StableToken;
|
||||
import me.chanjar.weixin.channel.bean.token.StableTokenParam;
|
||||
import me.chanjar.weixin.channel.config.WxChannelConfig;
|
||||
import me.chanjar.weixin.channel.util.JsonUtils;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.common.util.http.HttpType;
|
||||
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
|
||||
import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.Consts;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.BasicResponseHandler;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
@@ -33,19 +31,6 @@ public class WxChannelServiceHttpClientImpl extends BaseWxChannelServiceImpl<Htt
|
||||
|
||||
private CloseableHttpClient httpClient;
|
||||
private HttpHost httpProxy;
|
||||
private Boolean stabled = false;
|
||||
private Boolean forceRefresh = false;
|
||||
|
||||
/**
|
||||
* 设置调用接口参数.
|
||||
*
|
||||
* @param stabled false 表示调用AccessToken接口, true调用稳定版接口
|
||||
* @param forceRefresh stabled=true使用, true表示强制刷新模式
|
||||
*/
|
||||
public WxChannelServiceHttpClientImpl(Boolean stabled, Boolean forceRefresh) {
|
||||
this.stabled = stabled;
|
||||
this.forceRefresh = forceRefresh;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initHttp() {
|
||||
@@ -83,26 +68,7 @@ public class WxChannelServiceHttpClientImpl extends BaseWxChannelServiceImpl<Htt
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doGetAccessTokenRequest() throws WxErrorException {
|
||||
try {
|
||||
if (stabled) {
|
||||
return internalGetStableAccessToken(this.forceRefresh);
|
||||
} else{
|
||||
return internalGetAccessToken();
|
||||
}
|
||||
} catch(Exception e) {
|
||||
throw new WxErrorException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取access_token
|
||||
*
|
||||
* @return 返回json的字符串
|
||||
* @throws IOException the io exception
|
||||
*/
|
||||
protected String internalGetAccessToken() throws IOException {
|
||||
protected String doGetAccessTokenRequest() throws IOException {
|
||||
WxChannelConfig config = this.getConfig();
|
||||
String url = StringUtils.isNotEmpty(config.getAccessTokenUrl()) ? config.getAccessTokenUrl() :
|
||||
StringUtils.isNotEmpty(config.getApiHostUrl()) ?
|
||||
@@ -133,7 +99,6 @@ public class WxChannelServiceHttpClientImpl extends BaseWxChannelServiceImpl<Htt
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取稳定版接口调用凭据
|
||||
*
|
||||
@@ -141,7 +106,8 @@ public class WxChannelServiceHttpClientImpl extends BaseWxChannelServiceImpl<Htt
|
||||
* @return 返回json的字符串
|
||||
* @throws IOException the io exception
|
||||
*/
|
||||
protected String internalGetStableAccessToken(Boolean forceRefresh) throws IOException {
|
||||
@Override
|
||||
protected String doGetStableAccessTokenRequest(boolean forceRefresh) throws IOException {
|
||||
WxChannelConfig config = this.getConfig();
|
||||
String url = GET_STABLE_ACCESS_TOKEN_URL;
|
||||
|
||||
@@ -150,19 +116,19 @@ public class WxChannelServiceHttpClientImpl extends BaseWxChannelServiceImpl<Htt
|
||||
RequestConfig requestConfig = RequestConfig.custom().setProxy(this.getRequestHttpProxy()).build();
|
||||
httpPost.setConfig(requestConfig);
|
||||
}
|
||||
StableTokenParam requestParam = new StableTokenParam();
|
||||
requestParam.setAppId(config.getAppid());
|
||||
requestParam.setSecret(config.getSecret());
|
||||
requestParam.setGrantType("client_credential");
|
||||
requestParam.setForceRefresh(forceRefresh);
|
||||
String requestJson = JsonUtils.encode(requestParam);
|
||||
assert requestJson != null;
|
||||
|
||||
StableToken stableToken = new StableToken("client_credential", config.getAppid(),config.getSecret(), forceRefresh);
|
||||
|
||||
StringEntity entity = new StringEntity(JsonUtils.encode(stableToken), Consts.UTF_8);
|
||||
entity.setContentType("application/json; charset=utf-8");
|
||||
httpPost.setEntity(entity);
|
||||
|
||||
httpPost.setEntity(new StringEntity(requestJson, ContentType.APPLICATION_JSON));
|
||||
try (CloseableHttpResponse response = getRequestHttpClient().execute(httpPost)) {
|
||||
return new BasicResponseHandler().handleResponse(response);
|
||||
} finally {
|
||||
httpPost.releaseConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,20 +10,17 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
public class WxChannelServiceImpl extends WxChannelServiceHttpClientImpl {
|
||||
|
||||
/**
|
||||
* 设置普通模式access_token接口参数
|
||||
*/
|
||||
public WxChannelServiceImpl() {
|
||||
super(false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置获取access_token接口参数.
|
||||
*
|
||||
* @param stabled false 表示调用普通模式AccessToken接口, true调用稳定模式接口
|
||||
* @param forceRefresh stabled=true使用, true表示强制刷新模式
|
||||
*/
|
||||
public WxChannelServiceImpl(Boolean stabled, Boolean forceRefresh) {
|
||||
super(stabled, forceRefresh);
|
||||
}
|
||||
// /**
|
||||
// * 设置获取access_token接口参数.
|
||||
// *
|
||||
// * @param stabled false 表示调用普通模式AccessToken接口, true调用稳定模式接口
|
||||
// * @param forceRefresh stabled=true使用, true表示强制刷新模式
|
||||
// * @deprecated 请使用 {@link BaseWxChannelServiceImpl#setConfig(WxChannelConfig) } 替代
|
||||
// */
|
||||
// @Deprecated
|
||||
// public WxChannelServiceImpl(Boolean stabled, Boolean forceRefresh) {
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,25 +1,27 @@
|
||||
package me.chanjar.weixin.channel.api.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.channel.bean.token.StableToken;
|
||||
import me.chanjar.weixin.channel.util.JsonUtils;
|
||||
import me.chanjar.weixin.common.bean.WxAccessToken;
|
||||
import me.chanjar.weixin.common.enums.WxType;
|
||||
import me.chanjar.weixin.common.error.WxError;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.common.util.http.HttpType;
|
||||
import me.chanjar.weixin.common.util.http.okhttp.DefaultOkHttpClientBuilder;
|
||||
import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
|
||||
import okhttp3.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.Consts;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.GET_ACCESS_TOKEN_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.GET_STABLE_ACCESS_TOKEN_URL;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.channel.bean.token.StableTokenParam;
|
||||
import me.chanjar.weixin.channel.config.WxChannelConfig;
|
||||
import me.chanjar.weixin.channel.util.JsonUtils;
|
||||
import me.chanjar.weixin.common.util.http.HttpType;
|
||||
import me.chanjar.weixin.common.util.http.okhttp.DefaultOkHttpClientBuilder;
|
||||
import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
|
||||
import okhttp3.Authenticator;
|
||||
import okhttp3.Credentials;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.Route;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @author : zhenyun.su
|
||||
* @since : 2024/2/27
|
||||
@@ -28,19 +30,8 @@ import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.GET_ST
|
||||
public class WxChannelServiceOkHttpImpl extends BaseWxChannelServiceImpl<OkHttpClient, OkHttpProxyInfo> {
|
||||
private OkHttpClient httpClient;
|
||||
private OkHttpProxyInfo httpProxy;
|
||||
private Boolean stabled = false;
|
||||
private Boolean forceRefresh = false;
|
||||
protected final Object globalAccessTokenRefreshLock = new Object();
|
||||
|
||||
/**
|
||||
* 设置调用接口参数.
|
||||
*
|
||||
* @param stabled false 表示调用AccessToken接口, true调用稳定版接口
|
||||
* @param forceRefresh stabled=true使用, true表示强制刷新模式
|
||||
*/
|
||||
public WxChannelServiceOkHttpImpl(Boolean stabled, Boolean forceRefresh) {
|
||||
this.stabled = stabled;
|
||||
this.forceRefresh = forceRefresh;
|
||||
public WxChannelServiceOkHttpImpl() {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,76 +70,40 @@ public class WxChannelServiceOkHttpImpl extends BaseWxChannelServiceImpl<OkHttpC
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doGetAccessTokenRequest() throws WxErrorException {
|
||||
if (stabled) {
|
||||
return internalGetStableAccessToken(this.forceRefresh);
|
||||
} else{
|
||||
return internalGetAccessToken(forceRefresh);
|
||||
protected String doGetAccessTokenRequest() throws IOException {
|
||||
WxChannelConfig config = this.getConfig();
|
||||
String url = StringUtils.isNotEmpty(config.getAccessTokenUrl()) ? config.getAccessTokenUrl() :
|
||||
StringUtils.isNotEmpty(config.getApiHostUrl()) ?
|
||||
GET_ACCESS_TOKEN_URL.replace("https://api.weixin.qq.com", config.getApiHostUrl()) : GET_ACCESS_TOKEN_URL;
|
||||
|
||||
url = String.format(url, config.getAppid(), config.getSecret());
|
||||
|
||||
Request request = new Request.Builder().url(url).get().build();
|
||||
try (Response response = getRequestHttpClient().newCall(request).execute()) {
|
||||
return Objects.requireNonNull(response.body()).string();
|
||||
}
|
||||
}
|
||||
|
||||
public String internalGetStableAccessToken(boolean forceRefresh) throws WxErrorException {
|
||||
if (!this.config.isAccessTokenExpired() && !forceRefresh) {
|
||||
return this.config.getAccessToken();
|
||||
} else {
|
||||
synchronized(this.globalAccessTokenRefreshLock) {
|
||||
OkHttpClient client = this.getRequestHttpClient();
|
||||
@Override
|
||||
protected String doGetStableAccessTokenRequest(boolean forceRefresh) throws IOException {
|
||||
WxChannelConfig config = this.getConfig();
|
||||
String url = StringUtils.isNotEmpty(config.getAccessTokenUrl()) ?
|
||||
config.getAccessTokenUrl() : StringUtils.isNotEmpty(config.getApiHostUrl()) ?
|
||||
GET_STABLE_ACCESS_TOKEN_URL.replace("https://api.weixin.qq.com", config.getApiHostUrl()) :
|
||||
GET_STABLE_ACCESS_TOKEN_URL;
|
||||
|
||||
String url = String.format(GET_STABLE_ACCESS_TOKEN_URL, config.getAppid(), config.getSecret());
|
||||
StableTokenParam requestParam = new StableTokenParam();
|
||||
requestParam.setAppId(config.getAppid());
|
||||
requestParam.setSecret(config.getSecret());
|
||||
requestParam.setGrantType("client_credential");
|
||||
requestParam.setForceRefresh(forceRefresh);
|
||||
String requestJson = JsonUtils.encode(requestParam);
|
||||
assert requestJson != null;
|
||||
|
||||
StableToken stableToken = new StableToken("client_credential", config.getAppid(),config.getSecret(), forceRefresh);
|
||||
|
||||
RequestBody body = RequestBody.Companion.create(JsonUtils.encode(stableToken), MediaType.parse("application/json; charset=utf-8"));
|
||||
|
||||
Request request = (new Request.Builder()).url(url).post(body).build();
|
||||
String resultContent = null;
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
resultContent = response.body().string();
|
||||
} catch (IOException var9) {
|
||||
log.error(var9.getMessage(), var9);
|
||||
}
|
||||
|
||||
WxError error = WxError.fromJson(resultContent, WxType.CP);
|
||||
if (error.getErrorCode() != 0) {
|
||||
throw new WxErrorException(error);
|
||||
}
|
||||
|
||||
WxAccessToken accessToken = WxAccessToken.fromJson(resultContent);
|
||||
this.config.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
|
||||
}
|
||||
return this.config.getAccessToken();
|
||||
}
|
||||
}
|
||||
|
||||
public String internalGetAccessToken(boolean forceRefresh) throws WxErrorException {
|
||||
if (!this.config.isAccessTokenExpired() && !forceRefresh) {
|
||||
return this.config.getAccessToken();
|
||||
} else {
|
||||
synchronized(this.globalAccessTokenRefreshLock) {
|
||||
OkHttpClient client = this.getRequestHttpClient();
|
||||
|
||||
String url = String.format(GET_ACCESS_TOKEN_URL, config.getAppid(), config.getSecret());
|
||||
|
||||
Request request = (new Request.Builder()).url(url).get().build();
|
||||
|
||||
String resultContent = null;
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
resultContent = response.body().string();
|
||||
} catch (IOException var9) {
|
||||
log.error(var9.getMessage(), var9);
|
||||
}
|
||||
|
||||
WxError error = WxError.fromJson(resultContent, WxType.CP);
|
||||
if (error.getErrorCode() != 0) {
|
||||
throw new WxErrorException(error);
|
||||
}
|
||||
|
||||
WxAccessToken accessToken = WxAccessToken.fromJson(resultContent);
|
||||
this.config.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
|
||||
}
|
||||
return this.config.getAccessToken();
|
||||
RequestBody body = RequestBody.Companion.create(requestJson, MediaType.parse("application/json; charset=utf-8"));
|
||||
Request request = new Request.Builder().url(url).post(body).build();
|
||||
try (Response response = getRequestHttpClient().newCall(request).execute()) {
|
||||
return Objects.requireNonNull(response.body()).string();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,51 +18,51 @@ import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Vip.*;
|
||||
|
||||
@Slf4j
|
||||
public class WxChannelVipServiceImpl implements WxChannelVipService {
|
||||
private BaseWxChannelServiceImpl vipHttpService;
|
||||
private BaseWxChannelServiceImpl shopService;
|
||||
|
||||
public WxChannelVipServiceImpl(BaseWxChannelServiceImpl vipHttpService) {
|
||||
this.vipHttpService = vipHttpService;
|
||||
public WxChannelVipServiceImpl(BaseWxChannelServiceImpl shopService) {
|
||||
this.shopService = shopService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VipInfoResponse getVipInfo(String openId, Boolean needPhoneNumber) throws WxErrorException {
|
||||
VipInfoParam param = new VipInfoParam(openId, needPhoneNumber);
|
||||
String respJson = vipHttpService.post(VIP_USER_INFO_URL, param);
|
||||
String respJson = shopService.post(VIP_USER_INFO_URL, param);
|
||||
return ResponseUtils.decode(respJson, VipInfoResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VipListResponse getVipList(Boolean needPhoneNumber, Integer pageNum, Integer PageSize) throws WxErrorException {
|
||||
VipListParam param = new VipListParam(needPhoneNumber, pageNum, PageSize);
|
||||
String respJson = vipHttpService.post(VIP_USER_LIST_URL, param);
|
||||
public VipListResponse getVipList(Boolean needPhoneNumber, Integer pageNum, Integer pageSize) throws WxErrorException {
|
||||
VipListParam param = new VipListParam(needPhoneNumber, pageNum, pageSize);
|
||||
String respJson = shopService.post(VIP_USER_LIST_URL, param);
|
||||
return ResponseUtils.decode(respJson, VipListResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VipScoreResponse getVipScore(String openId) throws WxErrorException {
|
||||
VipParam param = new VipParam(openId);
|
||||
String respJson = vipHttpService.post(VIP_SCORE_URL, param);
|
||||
VipOpenIdParam param = new VipOpenIdParam(openId);
|
||||
String respJson = shopService.post(VIP_SCORE_URL, param);
|
||||
return ResponseUtils.decode(respJson, VipScoreResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse increaseVipScore(String openId, String score, String remark, String requestId) throws WxErrorException {
|
||||
VipScoreParam param = new VipScoreParam(openId, score, remark, requestId);
|
||||
String respJson = vipHttpService.post(SCORE_INCREASE_URL, param);
|
||||
String respJson = shopService.post(SCORE_INCREASE_URL, param);
|
||||
return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse decreaseVipScore(String openId, String score, String remark, String requestId) throws WxErrorException {
|
||||
VipScoreParam param = new VipScoreParam(openId, score, remark, requestId);
|
||||
String respJson = vipHttpService.post(SCORE_DECREASE_URL, param);
|
||||
String respJson = shopService.post(SCORE_DECREASE_URL, param);
|
||||
return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse updateVipGrade(String openId, Integer score) throws WxErrorException {
|
||||
VipGradeParam param = new VipGradeParam(openId, score);
|
||||
String respJson = vipHttpService.post(GRADE_UPDATE_URL, param);
|
||||
String respJson = shopService.post(GRADE_UPDATE_URL, param);
|
||||
return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
package me.chanjar.weixin.channel.api.impl;
|
||||
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.HomePage.*;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.channel.api.WxStoreHomePageService;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.background.BackgroundApplyResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.background.BackgroundGetResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.banner.BannerApplyParam;
|
||||
import me.chanjar.weixin.channel.bean.home.banner.BannerApplyResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.banner.BannerGetResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.banner.BannerInfo;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeProductEditInfo;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeProductEditParam;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeProductListInfo;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeProductListParam;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeProductListResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeShowGetResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeShowInfo;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeShowParam;
|
||||
import me.chanjar.weixin.channel.bean.home.tree.TreeShowSetResponse;
|
||||
import me.chanjar.weixin.channel.bean.home.window.WindowProductIndexParam;
|
||||
import me.chanjar.weixin.channel.bean.home.window.WindowProductListParam;
|
||||
import me.chanjar.weixin.channel.bean.home.window.WindowProductSetting;
|
||||
import me.chanjar.weixin.channel.bean.home.window.WindowProductSettingResponse;
|
||||
import me.chanjar.weixin.channel.util.ResponseUtils;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
/**
|
||||
* 微信小店 主页管理相关接口
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Slf4j
|
||||
public class WxStoreHomePageServiceImpl implements WxStoreHomePageService {
|
||||
|
||||
/** 微信小店服务 */
|
||||
private final BaseWxChannelServiceImpl storeService;
|
||||
|
||||
public WxStoreHomePageServiceImpl(BaseWxChannelServiceImpl storeService) {
|
||||
this.storeService = storeService;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse addTreeProduct(TreeProductEditInfo info) throws WxErrorException {
|
||||
TreeProductEditParam param = new TreeProductEditParam(info);
|
||||
String resJson = storeService.post(ADD_TREE_PRODUCT_URL, param);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse delTreeProduct(TreeProductEditInfo info) throws WxErrorException {
|
||||
TreeProductEditParam param = new TreeProductEditParam(info);
|
||||
String resJson = storeService.post(DEL_TREE_PRODUCT_URL, param);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreeProductListResponse getTreeProductList(TreeProductListInfo info) throws WxErrorException {
|
||||
TreeProductListParam param = new TreeProductListParam(info);
|
||||
String resJson = storeService.post(LIST_TREE_PRODUCT_URL, param);
|
||||
return ResponseUtils.decode(resJson, TreeProductListResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreeShowSetResponse setShowTree(TreeShowInfo info) throws WxErrorException {
|
||||
TreeShowParam param = new TreeShowParam(info);
|
||||
String resJson = storeService.post(SET_SHOW_TREE_URL, param);
|
||||
return ResponseUtils.decode(resJson, TreeShowSetResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreeShowGetResponse getShowTree() throws WxErrorException {
|
||||
String resJson = storeService.post(GET_SHOW_TREE_URL, "");
|
||||
return ResponseUtils.decode(resJson, TreeShowGetResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WindowProductSettingResponse listWindowProduct(Integer pageSize, String nextKey) throws WxErrorException {
|
||||
WindowProductListParam param = new WindowProductListParam(pageSize, nextKey);
|
||||
String resJson = storeService.post(LIST_WINDOW_PRODUCT_URL, param);
|
||||
return ResponseUtils.decode(resJson, WindowProductSettingResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse reorderWindowProduct(String productId, Integer indexNum) throws WxErrorException {
|
||||
WindowProductIndexParam param = new WindowProductIndexParam(productId, indexNum);
|
||||
String resJson = storeService.post(REORDER_WINDOW_PRODUCT_URL, param);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse hideWindowProduct(String productId, Integer setHide) throws WxErrorException {
|
||||
WindowProductSetting param = new WindowProductSetting();
|
||||
param.setProductId(productId);
|
||||
param.setSetHide(setHide);
|
||||
String resJson = storeService.post(HIDE_WINDOW_PRODUCT_URL, param);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse topWindowProduct(String productId, Integer setTop) throws WxErrorException {
|
||||
WindowProductSetting param = new WindowProductSetting();
|
||||
param.setProductId(productId);
|
||||
param.setSetTop(setTop);
|
||||
String resJson = storeService.post(TOP_WINDOW_PRODUCT_URL, param);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BackgroundApplyResponse applyBackground(String imgUrl) throws WxErrorException {
|
||||
String paramJson = "{\"img_url\":\"" + imgUrl + "\"}";
|
||||
String resJson = storeService.post(APPLY_BACKGROUND_URL, paramJson);
|
||||
return ResponseUtils.decode(resJson, BackgroundApplyResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BackgroundGetResponse getBackground() throws WxErrorException {
|
||||
String resJson = storeService.post(GET_BACKGROUND_URL, "");
|
||||
return ResponseUtils.decode(resJson, BackgroundGetResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse cancelBackground(Integer applyId) throws WxErrorException {
|
||||
String paramJson = "{\"apply_id\":" + applyId + "}";
|
||||
String resJson = storeService.post(CANCEL_BACKGROUND_URL, paramJson);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse removeBackground() throws WxErrorException {
|
||||
String resJson = storeService.post(REMOVE_BACKGROUND_URL, "");
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BannerApplyResponse applyBanner(BannerInfo info) throws WxErrorException {
|
||||
BannerApplyParam param = new BannerApplyParam(info);
|
||||
String resJson = storeService.post(APPLY_BANNER_URL, param);
|
||||
return ResponseUtils.decode(resJson, BannerApplyResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BannerGetResponse getBanner() throws WxErrorException {
|
||||
String resJson = storeService.post(GET_BANNER_URL, "");
|
||||
return ResponseUtils.decode(resJson, BannerGetResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse cancelBanner(Integer applyId) throws WxErrorException {
|
||||
String paramJson = "{\"apply_id\":" + applyId + "}";
|
||||
String resJson = storeService.post(CANCEL_BANNER_URL, paramJson);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse removeBanner() throws WxErrorException {
|
||||
String resJson = storeService.post(REMOVE_BANNER_URL, "");
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package me.chanjar.weixin.channel.bean.audit;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@@ -15,6 +16,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class CategoryAuditInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8792967130645424788L;
|
||||
@@ -31,7 +33,47 @@ public class CategoryAuditInfo implements Serializable {
|
||||
@JsonProperty("level3")
|
||||
private Long level3;
|
||||
|
||||
/** 资质材料,图片url,图片类型,最多不超过10张 */
|
||||
/** 新类目树类目ID */
|
||||
@JsonProperty("cats_v2")
|
||||
private List<CatsV2> catsV2;
|
||||
|
||||
/** 资质材料,图片fileid,图片类型,最多不超过10张 */
|
||||
@JsonProperty("certificate")
|
||||
private List<String> certificates;
|
||||
|
||||
/** 报备函,图片fileid,图片类型,最多不超过10张 */
|
||||
@JsonProperty("baobeihan")
|
||||
private List<String> baobeihan;
|
||||
|
||||
/** 经营证明,图片fileid,图片类型,最多不超过10张 */
|
||||
@JsonProperty("jingyingzhengming")
|
||||
private List<String> jingyingzhengming;
|
||||
|
||||
/** 带货口碑,图片fileid,图片类型,最多不超过10张 */
|
||||
@JsonProperty("daihuokoubei")
|
||||
private List<String> daihuokoubei;
|
||||
|
||||
/** 入住资质,图片fileid,图片类型,最多不超过10张 */
|
||||
@JsonProperty("ruzhuzhizhi")
|
||||
private List<String> ruzhuzhizhi;
|
||||
|
||||
/** 经营流水,图片fileid,图片类型,最多不超过10张 */
|
||||
@JsonProperty("jingyingliushui")
|
||||
private List<String> jingyingliushui;
|
||||
|
||||
/** 补充材料,图片fileid,图片类型,最多不超过10张 */
|
||||
@JsonProperty("buchongcailiao")
|
||||
private List<String> buchongcailiao;
|
||||
|
||||
/** 经营平台,仅支持taobao,jd,douyin,kuaishou,pdd,other这些取值 */
|
||||
@JsonProperty("jingyingpingtai")
|
||||
private String jingyingpingtai;
|
||||
|
||||
/** 账号名称 */
|
||||
@JsonProperty("zhanghaomingcheng")
|
||||
private String zhanghaomingcheng;
|
||||
|
||||
/** 品牌列表,获取类目信息中的attr.is_limit_brand为true时必传 */
|
||||
@JsonProperty("brand_list")
|
||||
private List<CategoryBrand> brandList;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package me.chanjar.weixin.channel.bean.audit;
|
||||
|
||||
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 CategoryBrand implements Serializable {
|
||||
private static final long serialVersionUID = -5437441266080209907L;
|
||||
|
||||
/** 品牌ID,是店铺申请且已审核通过的品牌ID */
|
||||
@JsonProperty("brand_id")
|
||||
private String brand_id;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package me.chanjar.weixin.channel.bean.audit;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 新类目树类目ID
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CatsV2 implements Serializable {
|
||||
private static final long serialVersionUID = -2484092110142035589L;
|
||||
|
||||
/** 新类目树类目ID */
|
||||
@JsonProperty("cat_id")
|
||||
private String catId;
|
||||
}
|
||||
@@ -74,6 +74,34 @@ public class CategoryDetailResult extends WxChannelBaseResponse {
|
||||
/** 佣金信息 */
|
||||
@JsonProperty("transactionfee_info")
|
||||
private FeeInfo feeInfo;
|
||||
|
||||
/** 折扣规则 */
|
||||
@JsonProperty("coupon_rule")
|
||||
private CouponRule couponRule;
|
||||
|
||||
/** 价格下限,单位分,商品售价不可低于此价格 */
|
||||
@JsonProperty("floor_price")
|
||||
private Long floorPrice;
|
||||
|
||||
/** 收货时间选项 */
|
||||
@JsonProperty("confirm_receipt_days")
|
||||
private List<String> confirmReceiptDays;
|
||||
|
||||
/** 是否品牌定向准入,即该类目一定要有品牌 */
|
||||
@JsonProperty("is_limit_brand")
|
||||
private Boolean limitBrand;
|
||||
|
||||
/** 商品编辑要求 */
|
||||
@JsonProperty("product_requirement")
|
||||
private ProductRequirement productRequirement;
|
||||
|
||||
/** 尺码表 */
|
||||
@JsonProperty("size_chart")
|
||||
private SizeChart sizeChart;
|
||||
|
||||
/** 资质信息 */
|
||||
@JsonProperty("product_qua_list")
|
||||
private List<QualificationInfo> productQuaList;
|
||||
}
|
||||
|
||||
@Data
|
||||
@@ -93,11 +121,27 @@ public class CategoryDetailResult extends WxChannelBaseResponse {
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
/** 类目必填项类型,string为自定义,select_one为多选一 */
|
||||
/** 属性类型,string为自定义,select_one为多选一,该参数短期保留,用于兼容。将来废弃,使用type_v2替代 */
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
|
||||
/** 类目必填项值 */
|
||||
/**
|
||||
* 属性类型v2,共7种类型
|
||||
* string:文本
|
||||
* select_one:单选,选项列表在value中
|
||||
* select_many:多选,选项列表在value中
|
||||
* integer:整数,数字必须为整数
|
||||
* decimal4:小数(4 位精度),小数部分最多 4 位
|
||||
* integer_unit:整数 + 单位,单位的选项列表在value中
|
||||
* decimal4_unit:小数(4 位精度) + 单位,单位的选项列表在value中
|
||||
*/
|
||||
@JsonProperty("type_v2")
|
||||
private String typeV2;
|
||||
|
||||
/**
|
||||
* 可选项列表,当type为:select_one/select_many时,为选项列表
|
||||
* 当type为:integer_unit/decimal4_unit时,为单位的列表
|
||||
*/
|
||||
@JsonProperty("value")
|
||||
private String value;
|
||||
|
||||
@@ -105,7 +149,13 @@ public class CategoryDetailResult extends WxChannelBaseResponse {
|
||||
@JsonProperty("is_required")
|
||||
private Boolean required;
|
||||
|
||||
/** 输入提示,请填写提示语 */
|
||||
@JsonProperty("hint")
|
||||
private String hint;
|
||||
|
||||
/** 允许添加选项,当type为select_one/select_many时,标识是否允许添加新选项(value中不存在的选项) */
|
||||
@JsonProperty("append_allowed")
|
||||
private Boolean appendAllowed;
|
||||
}
|
||||
|
||||
@Data
|
||||
@@ -123,8 +173,78 @@ public class CategoryDetailResult extends WxChannelBaseResponse {
|
||||
/** 佣金激励类型,0:无激励措施,1:新店佣金减免 */
|
||||
@JsonProperty("incentive_type")
|
||||
private Integer incentiveType;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class CouponRule implements Serializable {
|
||||
|
||||
/** 最高的折扣比例,百分比, 0表示无限制 */
|
||||
@JsonProperty("discount_ratio_limit")
|
||||
private Integer supportCoupon;
|
||||
|
||||
/** 最高的折扣金额,单位分,0表示无限制 */
|
||||
@JsonProperty("discount_limit")
|
||||
private Integer couponType;
|
||||
}
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class ProductRequirement implements Serializable {
|
||||
/** 商品标题的编辑要求 */
|
||||
@JsonProperty("product_title_requirement")
|
||||
private String productTitleRequirement;
|
||||
|
||||
/** 商品主图的编辑要求 */
|
||||
@JsonProperty("product_img_requirement")
|
||||
private String productImgRequirement;
|
||||
|
||||
/** 商品描述的编辑要求 */
|
||||
@JsonProperty("product_desc_requirement")
|
||||
private String productDescRequirement;
|
||||
}
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class SizeChart implements Serializable {
|
||||
|
||||
/** 是否支持尺码表 */
|
||||
@JsonProperty("is_support")
|
||||
private Boolean support;
|
||||
|
||||
/** 尺码配置要求列表 */
|
||||
@JsonProperty("item_list")
|
||||
private List<SizeChartItem> itemList;
|
||||
}
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class SizeChartItem implements Serializable {
|
||||
/** 尺码属性名称 */
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
/** 尺码属性值的单位 */
|
||||
@JsonProperty("unit")
|
||||
private String unit;
|
||||
|
||||
/** 尺码属性值的类型,1:字符型,2:整数型,3:小数型 */
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
|
||||
/** 尺码属性值的填写格式,1:单值填写,2:区间值填写,3:支持单值或区间值 */
|
||||
@JsonProperty("format")
|
||||
private String format;
|
||||
|
||||
/** 尺码属性值的限制 */
|
||||
@JsonProperty("limit")
|
||||
private String limit;
|
||||
|
||||
/** 是否必填 */
|
||||
@JsonProperty("is_required")
|
||||
private Boolean required;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package me.chanjar.weixin.channel.bean.category;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@@ -24,8 +25,18 @@ public class CategoryQualification implements Serializable {
|
||||
@JsonProperty("qua")
|
||||
private QualificationInfo info;
|
||||
|
||||
/** 商品资质信息 */
|
||||
/** 商品资质信息,将废弃,使用product_qua_list代替 */
|
||||
@JsonProperty("product_qua")
|
||||
@Deprecated
|
||||
private QualificationInfo productInfo;
|
||||
|
||||
/** 品牌资质信息 */
|
||||
@JsonProperty("brand_qua")
|
||||
@Deprecated
|
||||
private QualificationInfo brandQua;
|
||||
|
||||
/** 商品资质列表,替代product_qua */
|
||||
@JsonProperty("product_qua_list")
|
||||
private List<QualificationInfo> productQuaList;
|
||||
|
||||
}
|
||||
|
||||
@@ -22,4 +22,7 @@ public class CategoryQualificationResponse extends WxChannelBaseResponse {
|
||||
@JsonProperty("cats")
|
||||
private List<CategoryAndQualificationList> list;
|
||||
|
||||
@JsonProperty("cats_v2")
|
||||
private List<CategoryAndQualificationList> catsV2;
|
||||
|
||||
}
|
||||
|
||||
@@ -29,4 +29,8 @@ public class QualificationInfo implements Serializable {
|
||||
/** 该类目申请的时候是否一定要提交资质 */
|
||||
@JsonProperty("mandatory")
|
||||
private Boolean mandatory;
|
||||
|
||||
/** 资质名称 */
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
}
|
||||
|
||||
@@ -29,4 +29,8 @@ public class ShopCategory implements Serializable {
|
||||
/** 层级 */
|
||||
@JsonProperty("level")
|
||||
private Integer level;
|
||||
|
||||
/** 是否为叶子类目(品类) */
|
||||
@JsonProperty("leaf")
|
||||
private Boolean leaf;
|
||||
}
|
||||
|
||||
@@ -23,5 +23,7 @@ public class ShopCategoryResponse extends WxChannelBaseResponse {
|
||||
@JsonProperty("cat_list")
|
||||
private List<ShopCategory> categories;
|
||||
|
||||
|
||||
/** 类目列表 */
|
||||
@JsonProperty("cat_list_v2")
|
||||
private List<ShopCategory> catListV2;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package me.chanjar.weixin.channel.bean.delivery;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 商品打包信息 参数
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class FreshInspectParam implements Serializable {
|
||||
private static final long serialVersionUID = -1635894867602084789L;
|
||||
|
||||
/** 订单ID */
|
||||
@JsonProperty("order_id")
|
||||
private String orderId;
|
||||
|
||||
/** 商品打包信息 */
|
||||
@JsonProperty("audit_items")
|
||||
private List<PackageAuditInfo> auditItems;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package me.chanjar.weixin.channel.bean.delivery;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.enums.PackageAuditItemType;
|
||||
|
||||
/**
|
||||
* 商品打包信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PackageAuditInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1118087167138310282L;
|
||||
|
||||
/**
|
||||
* 审核项名称,枚举类型参考 {@link PackageAuditItemType}
|
||||
* 使用方法:DeliveryAuditItemType.EXPRESS_PIC.getKey()
|
||||
*/
|
||||
@JsonProperty("item_name")
|
||||
private String itemName;
|
||||
|
||||
/** 图片/视频url */
|
||||
@JsonProperty("item_value")
|
||||
private String itemValue;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package me.chanjar.weixin.channel.bean.home.background;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 提交背景图申请 结果
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BackgroundApplyResponse extends WxChannelBaseResponse {
|
||||
|
||||
private static final long serialVersionUID = -5627456997199822109L;
|
||||
|
||||
/** 申请编号 */
|
||||
@JsonProperty("apply_id")
|
||||
private Integer applyId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package me.chanjar.weixin.channel.bean.home.background;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 背景图审核信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class BackgroundApplyResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3154900058221168732L;
|
||||
|
||||
/** 申请编号 */
|
||||
@JsonProperty("apply_id")
|
||||
private Integer applyId;
|
||||
|
||||
/** 申请状态。1审核中 2审核驳回 */
|
||||
@JsonProperty("state")
|
||||
private Integer state;
|
||||
|
||||
/** 审核结果描述。state为审核驳回时有值。 */
|
||||
@JsonProperty("audit_desc")
|
||||
private String auditDesc;
|
||||
|
||||
/** 图片url */
|
||||
@JsonProperty("img_url")
|
||||
private String imgUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.chanjar.weixin.channel.bean.home.background;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 背景图返回结果
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BackgroundGetResponse extends WxChannelBaseResponse {
|
||||
|
||||
private static final long serialVersionUID = -9158761351220981959L;
|
||||
|
||||
/** 当前生效的背景图片url */
|
||||
@JsonProperty("img_url")
|
||||
private String imgUrl;
|
||||
|
||||
/** 背景图审核信息 */
|
||||
@JsonProperty("apply")
|
||||
private BackgroundApplyResult apply;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 精选展示位申请详情
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class BannerApplyDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4622897527243343862L;
|
||||
|
||||
/** 审核状态。 1-审核中;2-审核驳回 */
|
||||
@JsonProperty("audit_state")
|
||||
private Integer auditState;
|
||||
|
||||
/** 审核结果描述。audit_state为驳回时有值。 */
|
||||
@JsonProperty("audit_desc")
|
||||
private String auditDesc;
|
||||
|
||||
/** 精选展示位申请明细 */
|
||||
@JsonProperty("banner")
|
||||
private BannerItem banner;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 精选展示位申请信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class BannerApplyInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 72190625450999960L;
|
||||
|
||||
/** 申请编号 */
|
||||
@JsonProperty("apply_id")
|
||||
private Integer applyId;
|
||||
|
||||
/** 申请状态 1-审核中;2-审核驳回 */
|
||||
@JsonProperty("state")
|
||||
private Integer state;
|
||||
|
||||
/** 展示位的展示样式 1-小图模式;2-大图模式 */
|
||||
@JsonProperty("scale")
|
||||
private Integer scale;
|
||||
|
||||
/** 精选展示位申请明细 */
|
||||
@JsonProperty("banner")
|
||||
private List<BannerApplyDetail> banner;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
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
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class BannerApplyParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 9083668032979490150L;
|
||||
|
||||
/** banner */
|
||||
@JsonProperty("banner")
|
||||
private BannerInfo banner;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 提交精选展位申请 结果
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BannerApplyResponse extends WxChannelBaseResponse {
|
||||
|
||||
private static final long serialVersionUID = -2194587734444499201L;
|
||||
|
||||
/** 申请编号 */
|
||||
@JsonProperty("apply_id")
|
||||
private Integer applyId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 精选展位返回结果
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BannerGetResponse extends WxChannelBaseResponse {
|
||||
|
||||
private static final long serialVersionUID = -1563254921362215934L;
|
||||
|
||||
/** 当前生效的展示位 */
|
||||
@JsonProperty("banner")
|
||||
private BannerInfo banner;
|
||||
|
||||
/** 最近一次流程中的申请。不返回已生效或已撤销的申请 */
|
||||
@JsonProperty("apply")
|
||||
private BannerApplyInfo apply;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 精选展示位
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class BannerInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2003175482038217418L;
|
||||
|
||||
/** 展示位的展示样式 1-小图模式;2-大图模式 */
|
||||
@JsonProperty("scale")
|
||||
private Integer scale;
|
||||
|
||||
/** 精选展示位明细 */
|
||||
@JsonProperty("banner")
|
||||
private List<BannerItem> banner;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 精选展示位明细
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class BannerItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6982412458700854481L;
|
||||
|
||||
/** 展示位类型 1-商品 3-视频号 4-公众号 {@link me.chanjar.weixin.channel.enums.BannerType} */
|
||||
@JsonProperty("type")
|
||||
private Integer type;
|
||||
|
||||
/** 展示位信息 */
|
||||
@JsonProperty("banner")
|
||||
private BannerItemDetail banner;
|
||||
|
||||
/** 商品 */
|
||||
@JsonProperty("product")
|
||||
private BannerItemProduct product;
|
||||
|
||||
/** 视频号 */
|
||||
@JsonProperty("finder")
|
||||
private BannerItemFinder finder;
|
||||
|
||||
/** 公众号 */
|
||||
@JsonProperty("official_account")
|
||||
private BannerItemOfficialAccount officialAccount;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 精选展示位明细中的明细
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class BannerItemDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5975434996207526173L;
|
||||
|
||||
/** 图片url */
|
||||
@JsonProperty("img_url")
|
||||
private String imgUrl;
|
||||
|
||||
/** 标题 */
|
||||
@JsonProperty("title")
|
||||
private String title;
|
||||
|
||||
/** 描述 */
|
||||
@JsonProperty("description")
|
||||
private String description;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 精选展示位明细中的视频号数据
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class BannerItemFinder implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -7397790079913284012L;
|
||||
|
||||
/** 视频号ID */
|
||||
@JsonProperty("finder_user_name")
|
||||
private String finderUserName;
|
||||
|
||||
/** 视频号视频的唯一标识 */
|
||||
@JsonProperty("feed_id")
|
||||
private String feedId;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 精选展示位明细中的公众号数据
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class BannerItemOfficialAccount implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5596947592282082891L;
|
||||
|
||||
/** 公众号文章url */
|
||||
@JsonProperty("url")
|
||||
private String url;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package me.chanjar.weixin.channel.bean.home.banner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 精选展示位明细中的商品
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class BannerItemProduct implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8034487065591522594L;
|
||||
|
||||
/** 商品id */
|
||||
@JsonProperty("product_id")
|
||||
private Long productId;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
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 CatTreeNode implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3154219180098003510L;
|
||||
|
||||
/** 分类id */
|
||||
@JsonProperty("id")
|
||||
private Integer id;
|
||||
|
||||
/** 分类名字 */
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
/** 是否在用户端展示该分类。1为是,0为否 */
|
||||
@JsonProperty("is_displayed")
|
||||
private Integer displayed;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
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 LevelTreeInfo implements Serializable {
|
||||
|
||||
/** 一级分类 */
|
||||
@JsonProperty("level1")
|
||||
private OneLevelTreeNode level1;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 一级分类
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class OneLevelTreeNode extends CatTreeNode {
|
||||
|
||||
/** 二级分类 */
|
||||
@JsonProperty("level2")
|
||||
private CatTreeNode level2;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 展示在店铺主页的商品分类
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class TreeAuditResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8142657614529852121L;
|
||||
|
||||
/** 版本号。设置分类树的接口会用到 */
|
||||
@JsonProperty("version")
|
||||
private Integer version;
|
||||
|
||||
/** 展示在店铺主页的商品分类 */
|
||||
@JsonProperty("audit_results")
|
||||
private List<TreeAuditResultDetail> auditResults;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 分类审核结果
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class TreeAuditResultDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6085892397971684732L;
|
||||
|
||||
/** 该分类ID的审核结果 */
|
||||
@JsonProperty("level_id")
|
||||
private Integer level_id;
|
||||
|
||||
/** 审核结果枚举。1:不通过;2:通过 */
|
||||
@JsonProperty("result_code")
|
||||
private Integer result_code;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 添加/删除分类关联的商品 参数
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TreeProductEditInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5596947592282082891L;
|
||||
|
||||
/** 一级分类id */
|
||||
@JsonProperty("level_1_id")
|
||||
private Integer level1Id;
|
||||
|
||||
/** 二级分类id */
|
||||
@JsonProperty("level_2_id")
|
||||
private Integer level2Id;
|
||||
|
||||
/** 商品id列表 */
|
||||
@JsonProperty("product_ids")
|
||||
private List<Long> productIds;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
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 TreeProductEditParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4906016235749892703L;
|
||||
|
||||
/** 参数 */
|
||||
@JsonProperty("req")
|
||||
private TreeProductEditInfo req;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
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 TreeProductListInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2774682583380930076L;
|
||||
|
||||
/** 一级分类id */
|
||||
@JsonProperty("level_1_id")
|
||||
private Integer level1Id;
|
||||
|
||||
/** 二级分类id */
|
||||
@JsonProperty("level_2_id")
|
||||
private Integer level2Id;
|
||||
|
||||
/** 分页大小 */
|
||||
@JsonProperty("page_size")
|
||||
private Integer pageSize;
|
||||
|
||||
/** 从头拉取填空。翻页拉取的话填resp返回的值 */
|
||||
@JsonProperty("page_context")
|
||||
private String pageContext;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
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 TreeProductListParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8444106841479328711L;
|
||||
|
||||
/** 参数 */
|
||||
@JsonProperty("req")
|
||||
private TreeProductListInfo req;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 资金流水响应
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TreeProductListResponse extends WxChannelBaseResponse {
|
||||
|
||||
private static final long serialVersionUID = 4566848209585635054L;
|
||||
|
||||
/** 结果 */
|
||||
@JsonProperty("resp")
|
||||
private TreeProductListResult resp;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 资金流水响应 结果
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class TreeProductListResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4566848209585635054L;
|
||||
|
||||
/** 关联的商品ID。如果返回为空,返回翻页到底了 */
|
||||
@JsonProperty("product_ids")
|
||||
private List<Long> productIds;
|
||||
|
||||
/** 总条数 */
|
||||
@JsonProperty("total_count")
|
||||
private Integer totalCount;
|
||||
|
||||
/** 拉取下一页的话,需要把这个值填到req的page_context里面 */
|
||||
@JsonProperty("page_context")
|
||||
private String pageContext;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TreeShowGetResponse extends WxChannelBaseResponse {
|
||||
|
||||
/** resp */
|
||||
@JsonProperty("resp")
|
||||
private TreeShowInfo resp;
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 分类展示信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TreeShowInfo implements Serializable {
|
||||
|
||||
/** 分类树 */
|
||||
@JsonProperty("tree")
|
||||
private LevelTreeInfo tree;
|
||||
|
||||
/** 版本号。通过获取商品分类树或者本接口得到 */
|
||||
@JsonProperty("version")
|
||||
private Integer version;
|
||||
|
||||
/** 表示有哪一些分类ID清空关联得商品,如果不清空,那么分类ID和商品得关联关系会一直存在。如果是一级分类,就填"1"。如果是二级分类,就填"1.2"。 */
|
||||
@JsonProperty("classification_id_deleted")
|
||||
private List<String> classificationIdDeleted;
|
||||
|
||||
// 一些自定义的方法
|
||||
|
||||
/**
|
||||
* 创建Tree节点
|
||||
*
|
||||
* @return Tree节点
|
||||
*/
|
||||
protected LevelTreeInfo createTree() {
|
||||
if (tree == null) {
|
||||
tree = new LevelTreeInfo();
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建一级分类节点
|
||||
*
|
||||
* @return 一级分类节点
|
||||
*/
|
||||
protected OneLevelTreeNode createLevel1() {
|
||||
this.createTree();
|
||||
if (tree.getLevel1() == null) {
|
||||
tree.setLevel1(new OneLevelTreeNode());
|
||||
}
|
||||
return tree.getLevel1();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建二级分类节点
|
||||
*
|
||||
* @return 二级分类节点
|
||||
*/
|
||||
protected CatTreeNode createLevel2() {
|
||||
OneLevelTreeNode level1 = this.createLevel1();
|
||||
if (level1.getLevel2() == null) {
|
||||
level1.setLevel2(new CatTreeNode());
|
||||
}
|
||||
return level1.getLevel2();
|
||||
}
|
||||
|
||||
|
||||
@JsonIgnore
|
||||
public void setLevel1Id(Integer id) {
|
||||
createLevel1().setId(id);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public void setLevel1Name(String name) {
|
||||
createLevel1().setName(name);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public void setLevel1Displayed(Integer displayed) {
|
||||
createLevel1().setDisplayed(displayed);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public void setLevel2Id(Integer id) {
|
||||
createLevel2().setId(id);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public void setLevel2Name(String name) {
|
||||
createLevel2().setName(name);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public void setLevel2Displayed(Integer displayed) {
|
||||
createLevel2().setDisplayed(displayed);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
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 TreeShowParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1577647561992899360L;
|
||||
|
||||
/** 分类信息 */
|
||||
@JsonProperty("req")
|
||||
private TreeShowInfo req;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package me.chanjar.weixin.channel.bean.home.tree;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TreeShowSetResponse extends WxChannelBaseResponse {
|
||||
|
||||
/** resp */
|
||||
@JsonProperty("resp")
|
||||
private TreeAuditResult resp;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.chanjar.weixin.channel.bean.home.window;
|
||||
|
||||
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 WindowProductIndexParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1370480140179330908L;
|
||||
|
||||
/** 商品id */
|
||||
@JsonProperty("product_id")
|
||||
private String productId;
|
||||
|
||||
/** 商品重新排序后的新序号,最大移动步长为500(即新序号与当前序号的距离小于500) */
|
||||
@JsonProperty("index_num")
|
||||
private Integer indexNum;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package me.chanjar.weixin.channel.bean.home.window;
|
||||
|
||||
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 WindowProductListParam implements Serializable {
|
||||
|
||||
/** 每页数量(默认10,不超过30) */
|
||||
@JsonProperty("page_size")
|
||||
private Integer pageSize;
|
||||
|
||||
/** 由上次请求返回,记录翻页的上下文。传入时会从上次返回的结果往后翻一页,不传默认获取第一页数据。 */
|
||||
@JsonProperty("next_key")
|
||||
private String nextKey;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package me.chanjar.weixin.channel.bean.home.window;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
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
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class WindowProductSetting implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5931781905709862287L;
|
||||
|
||||
/** 商品id */
|
||||
@JsonProperty("product_id")
|
||||
private String productId;
|
||||
|
||||
/** 是否隐藏,设置为隐藏的商品只在首页不可见,并不代表下架。 */
|
||||
@JsonProperty("is_set_hide")
|
||||
private Integer setHide;
|
||||
|
||||
/** 是否置顶 */
|
||||
@JsonProperty("is_set_top")
|
||||
private Integer setTop;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package me.chanjar.weixin.channel.bean.home.window;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 主页商品配置列表
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WindowProductSettingResponse extends WxChannelBaseResponse {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 商品信息 */
|
||||
@JsonProperty("products")
|
||||
private List<WindowProductSetting> products;
|
||||
|
||||
/** 本次翻页的上下文,用于请求下一页 */
|
||||
@JsonProperty("next_key")
|
||||
private String nextKey;
|
||||
|
||||
/** 商品总数 */
|
||||
@JsonProperty("total_num")
|
||||
private Integer totalNum;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package me.chanjar.weixin.channel.bean.message.store;
|
||||
|
||||
/**
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.message.WxChannelMessage;
|
||||
|
||||
/**
|
||||
* 小店注销消息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@JacksonXmlRootElement(localName = "xml")
|
||||
public class CloseStoreMessage extends WxChannelMessage {
|
||||
|
||||
private static final long serialVersionUID = 7619787772418774020L;
|
||||
|
||||
/** appid */
|
||||
@JsonProperty("appid")
|
||||
@JacksonXmlProperty(localName = "appid")
|
||||
private String appid;
|
||||
|
||||
/** Unix时间戳,即格林威治时间1970年01月01日00时00分00秒(北京时间1970年01月01日08时00分00秒)起至现在的总秒数 */
|
||||
@JsonProperty("close_timestamp")
|
||||
@JacksonXmlProperty(localName = "close_timestamp")
|
||||
private Long closeTimestamp;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package me.chanjar.weixin.channel.bean.message.store;
|
||||
|
||||
/**
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.message.WxChannelMessage;
|
||||
|
||||
/**
|
||||
* 小店修改名称消息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@JacksonXmlRootElement(localName = "xml")
|
||||
public class NicknameUpdateMessage extends WxChannelMessage {
|
||||
|
||||
private static final long serialVersionUID = 7619787772418774020L;
|
||||
|
||||
/** appid */
|
||||
@JsonProperty("appid")
|
||||
@JacksonXmlProperty(localName = "appid")
|
||||
private String appid;
|
||||
|
||||
/** 小店旧昵称 */
|
||||
@JsonProperty("old_nickname")
|
||||
@JacksonXmlProperty(localName = "old_nickname")
|
||||
private String oldNickname;
|
||||
|
||||
/** 小店新昵称 */
|
||||
@JsonProperty("new_nickname")
|
||||
@JacksonXmlProperty(localName = "new_nickname")
|
||||
private String newNickname;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.AddressInfo;
|
||||
|
||||
/**
|
||||
* 解码地址数据
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DecodeAddressInfo extends AddressInfo {
|
||||
|
||||
/** 虚拟发货订单联系方式,在发货方式为无需快递(deliver_method=1)时返回 */
|
||||
@JsonProperty("virtual_order_tel_number")
|
||||
private String virtualOrderTelNumber;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 解码订单包含的敏感数据响应
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DecodeSensitiveInfoResponse extends WxChannelBaseResponse {
|
||||
|
||||
private static final long serialVersionUID = 935829924760021624L;
|
||||
|
||||
/** 收货信息 */
|
||||
@JsonProperty("address_info")
|
||||
private DecodeAddressInfo addressInfo;
|
||||
|
||||
/** 虚拟号信息 */
|
||||
@JsonProperty("virtual_number_info")
|
||||
private VirtualNumberInfo virtualNumberInfo;
|
||||
}
|
||||
@@ -44,4 +44,16 @@ public class OrderDeliveryInfo implements Serializable {
|
||||
@JsonProperty("ewaybill_order_code")
|
||||
private String ewaybillOrderCode;
|
||||
|
||||
/** 订单质检类型 2生鲜类质检 1珠宝玉石类质检 0不需要;不传递本字段表示不需要 */
|
||||
@JsonProperty("quality_inspect_type")
|
||||
private String qualityInspectType;
|
||||
|
||||
/** 质检信息 */
|
||||
@JsonProperty("quality_inspect_info")
|
||||
private QualityInsepctInfo qualityInspectInfo;
|
||||
|
||||
/** 虚拟商品充值账户信息 */
|
||||
@JsonProperty("recharge_info")
|
||||
private RechargeInfo rechargeInfo;
|
||||
|
||||
}
|
||||
|
||||
@@ -30,12 +30,33 @@ public class OrderSearchCondition implements Serializable {
|
||||
@JsonProperty("user_name")
|
||||
private String userName;
|
||||
|
||||
/** 收件人电话 */
|
||||
/**
|
||||
* 收件人电话
|
||||
* @deprecated 当前字段已经废弃,请勿使用,如果原本填手机后四位,可正常使用,否则接口报错
|
||||
*/
|
||||
@JsonProperty("tel_number")
|
||||
@Deprecated
|
||||
private String telNumber;
|
||||
|
||||
/**
|
||||
* 收件人电话后四位
|
||||
*/
|
||||
@JsonProperty("tel_number_last4")
|
||||
private String telNumberLast4;
|
||||
|
||||
/** 选填,只搜一个订单时使用 */
|
||||
@JsonProperty("order_id")
|
||||
private String orderId;
|
||||
|
||||
/** 商家备注 */
|
||||
@JsonProperty("merchant_notes")
|
||||
private String merchantNotes;
|
||||
|
||||
/** 买家备注 */
|
||||
@JsonProperty("customer_notes")
|
||||
private String customerNotes;
|
||||
|
||||
/** 申请修改地址审核中 */
|
||||
@JsonProperty("address_under_review")
|
||||
private Boolean addressUnderReview;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 质检信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class QualityInsepctInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8109819414306253475L;
|
||||
|
||||
/** 质检状态 */
|
||||
@JsonProperty("inspect_status")
|
||||
private Integer inspectStatus;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 虚拟商品充值账户信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class RechargeInfo implements Serializable {
|
||||
|
||||
/** 虚拟商品充值账号,当account_type=qq或phone_number或mail的时候返回 */
|
||||
@JsonProperty("account_no")
|
||||
private String accountNo;
|
||||
|
||||
/** 账号充值类型,可选项: weixin(微信号),qq(qq),phone_number(电话号码),mail(邮箱) */
|
||||
@JsonProperty("account_type")
|
||||
private String accountType;
|
||||
|
||||
/** 当account_type="weixin"的时候返回 */
|
||||
@JsonProperty("wx_openid")
|
||||
private String wxOpenId;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 虚拟号信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class VirtualNumberInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -372834823737476644L;
|
||||
|
||||
/** 虚拟号 */
|
||||
@JsonProperty("virtual_number")
|
||||
private String virtualNumber;
|
||||
|
||||
/** 分机号 */
|
||||
@JsonProperty("extension")
|
||||
private String extension;
|
||||
|
||||
/** 过期时间戳 */
|
||||
@JsonProperty("expiration")
|
||||
private Long expiration;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 兑换虚拟号 返回结果
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class VirtualTelNumberResponse extends WxChannelBaseResponse {
|
||||
|
||||
/** 虚拟号码 */
|
||||
@JsonProperty("virtual_tel_number")
|
||||
private String virtualTelNumber;
|
||||
|
||||
/** 虚拟号码过期时间 */
|
||||
@JsonProperty("virtual_tel_expire_time")
|
||||
private Long virtualTelExpireTime;
|
||||
|
||||
/** 兑换虚拟号码次数 */
|
||||
@JsonProperty("get_virtual_tel_cnt")
|
||||
private Integer getVirtualTelCnt;
|
||||
}
|
||||
@@ -20,4 +20,20 @@ public class ExtraServiceInfo implements Serializable {
|
||||
*/
|
||||
@JsonProperty("seven_day_return")
|
||||
private Integer sevenDayReturn;
|
||||
|
||||
/** 先用后付,0-不支持先用后付,1-支持先用后付。若店铺已开通先用后付,支持先用后付的类目商品将在上架后自动打开先用后付。 */
|
||||
@JsonProperty("pay_after_use")
|
||||
private Integer payAfterUse;
|
||||
|
||||
/** 是否支持运费险,0-不支持运费险,1-支持运费险。需要商户开通运费险服务,且当前类目支持运费险才会生效。 */
|
||||
@JsonProperty("freight_insurance")
|
||||
private Integer freightInsurance;
|
||||
|
||||
/** 是否支持假一赔三,0-不支持假一赔三,1-支持假一赔三。 */
|
||||
@JsonProperty("fake_one_pay_three")
|
||||
private Integer fakeOnePayThree;
|
||||
|
||||
/** 是否支持坏损包退,0-不支持坏损包退,1-支持坏损包退。 */
|
||||
@JsonProperty("damage_guarantee")
|
||||
private Integer damageGuarantee;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package me.chanjar.weixin.channel.bean.product;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 商品资质信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProductQuaInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -71766140204505768L;
|
||||
|
||||
/** 商品资质id,对应获取类目信息中的字段product_qua_list[].qua_id */
|
||||
@JsonProperty("qua_id")
|
||||
private String quaId;
|
||||
|
||||
/** 商品资质图片列表 */
|
||||
@JsonProperty("qua_url")
|
||||
private List<String> quaUrl;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package me.chanjar.weixin.channel.bean.product;
|
||||
|
||||
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 ProductSaleLimitInfo implements Serializable {
|
||||
|
||||
/** 是否受到管控,商品存在售卖限制时,固定返回1 */
|
||||
@JsonProperty("is_limited")
|
||||
private Integer limited;
|
||||
|
||||
/** 售卖限制标题 */
|
||||
@JsonProperty("title")
|
||||
private String title;
|
||||
|
||||
/** 售卖限制描述 */
|
||||
@JsonProperty("sub_title")
|
||||
private String subTitle;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package me.chanjar.weixin.channel.bean.product;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 免审商品更新Sku数据
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class SkuFastInfo implements Serializable {
|
||||
|
||||
/** sku_id */
|
||||
@JsonProperty("sku_id")
|
||||
private String skuId;
|
||||
|
||||
/** 售卖价格,以分为单位,数字类型,最大不超过10000000(1000万元) */
|
||||
@JsonProperty("sale_price")
|
||||
private Integer salePrice;
|
||||
|
||||
@JsonProperty("stock_info")
|
||||
private StockInfo stockInfo;
|
||||
|
||||
/** sku发货信息 */
|
||||
@JsonProperty("sku_deliver_info")
|
||||
private SkuDeliverInfo skuDeliverInfo;
|
||||
|
||||
/** 是否要删除当前sku */
|
||||
@JsonProperty("is_delete")
|
||||
private Boolean delete;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class StockInfo implements Serializable {
|
||||
|
||||
/** 修改类型。1: 增加;2:减少;3:设置 */
|
||||
@JsonProperty("diff_type")
|
||||
protected Integer diffType;
|
||||
|
||||
/** 增加、减少或者设置的库存值 */
|
||||
@JsonProperty("num")
|
||||
protected Integer num;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class SkuInfo implements Serializable {
|
||||
|
||||
/** skuID */
|
||||
@JsonProperty("sku_id")
|
||||
private Long skuId;
|
||||
private String skuId;
|
||||
|
||||
public SkuInfo() {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* spu库存列表
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SkuStockBatchList implements Serializable {
|
||||
private static final long serialVersionUID = -8082428962162052815L;
|
||||
|
||||
/** 库存信息 */
|
||||
@JsonProperty("spu_stock_list")
|
||||
private List<SpuStockInfo> spuStockList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package me.chanjar.weixin.channel.bean.product;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SkuStockBatchParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3706326762056220559L;
|
||||
|
||||
/** 商品ID列表 注意这里是 productId ,序列化参数没有写错 */
|
||||
@JsonProperty("product_id")
|
||||
private List<String> productIds;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package me.chanjar.weixin.channel.bean.product;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 批量查询sku库存响应
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SkuStockBatchResponse extends WxChannelBaseResponse {
|
||||
|
||||
private static final long serialVersionUID = 7745444061881828137L;
|
||||
|
||||
/** 库存信息 */
|
||||
@JsonProperty("data")
|
||||
private SkuStockBatchList data;
|
||||
}
|
||||
@@ -29,7 +29,14 @@ public class SkuStockInfo implements Serializable {
|
||||
@JsonProperty("warehouse_stocks")
|
||||
private List<WarehouseStockInfo> warehouseStocks;
|
||||
|
||||
/** 库存总量:通用库存数量 + 限时抢购库存数量 + 区域库存总量 */
|
||||
/**
|
||||
* 普通查询:库存总量:通用库存数量 + 限时抢购库存数量 + 区域库存总量
|
||||
* 批量查询:库存总量:通用库存数量 + 限时抢购库存数量 + 区域库存数量 + 达人专属计划营销库存数量
|
||||
*/
|
||||
@JsonProperty("total_stock_num")
|
||||
private Integer totalStockNum;
|
||||
|
||||
/** 达人专属计划营销库存数量 */
|
||||
@JsonProperty("finder_stock_num")
|
||||
private Integer finderTotalNum;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package me.chanjar.weixin.channel.bean.product;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -18,5 +19,6 @@ public class SkuStockResponse extends WxChannelBaseResponse {
|
||||
private static final long serialVersionUID = -2156342792354605826L;
|
||||
|
||||
/** 库存信息 */
|
||||
@JsonProperty("data")
|
||||
private SkuStockInfo data;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.chanjar.weixin.channel.bean.product;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 商品免审更新参数
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class SpuFastInfo implements Serializable {
|
||||
|
||||
/** 商品ID */
|
||||
@JsonProperty("product_id")
|
||||
protected String productId;
|
||||
|
||||
/** SKU列表 */
|
||||
@JsonProperty("skus")
|
||||
protected List<SkuFastInfo> skus;
|
||||
|
||||
}
|
||||
@@ -25,4 +25,8 @@ public class SpuGetResponse extends WxChannelBaseResponse {
|
||||
/** 商品草稿数据,入参data_type==1时不返回该字段 */
|
||||
@JsonProperty("edit_product")
|
||||
private SpuInfo editProduct;
|
||||
|
||||
/** 当日售卖上限提醒,当店铺受到售卖管控时返回,没有返回本字段表示没有无额外限制 */
|
||||
@JsonProperty("sale_limit_info")
|
||||
private ProductSaleLimitInfo saleLimitInfo;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,10 @@ public class SpuInfo extends SpuSimpleInfo {
|
||||
@JsonProperty("cats")
|
||||
private List<SpuCategory> cats;
|
||||
|
||||
/** 新类目树,商家需要先申请可使用类目 */
|
||||
@JsonProperty("cats_v2")
|
||||
private List<SpuCategory> catsV2;
|
||||
|
||||
/** 商品参数 */
|
||||
@JsonProperty("attrs")
|
||||
private List<AttrInfo> attrs;
|
||||
@@ -107,10 +111,24 @@ public class SpuInfo extends SpuSimpleInfo {
|
||||
@JsonProperty("product_type")
|
||||
private Integer productType;
|
||||
|
||||
|
||||
/**
|
||||
* 商品的售后信息
|
||||
*/
|
||||
@JsonProperty("after_sale_info")
|
||||
private AfterSaleInfo afterSaleInfo;
|
||||
|
||||
/**
|
||||
* 当商品类型位福袋抽奖商品(即product_type==2)且该抽奖商品由橱窗的自营商品导入生成时有值,
|
||||
* 表示导入的来源商品id,其他场景下该字段无值或者值为0
|
||||
*/
|
||||
@JsonProperty("src_product_id")
|
||||
private String srcProductId;
|
||||
|
||||
/** 商品资质列表 */
|
||||
@JsonProperty("product_qua_infos")
|
||||
private List<ProductQuaInfo> productQuaInfos;
|
||||
|
||||
/** 尺码表信息 */
|
||||
@JsonProperty("size_chart")
|
||||
private SpuSizeChart sizeChart;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class SpuSimpleInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5583726432139404883L;
|
||||
|
||||
/** 交易组件平台内部商品ID */
|
||||
/** 商品ID */
|
||||
@JsonProperty("product_id")
|
||||
protected String productId;
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
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 <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SpuSizeChart implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5019617420608575610L;
|
||||
|
||||
/** 是否支持尺码表 */
|
||||
@JsonProperty("enable")
|
||||
private Boolean enable;
|
||||
|
||||
/** 尺码表 */
|
||||
@JsonProperty("specification_list")
|
||||
private List<SpuSizeChartItem> specificationList;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
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 <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SpuSizeChartItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3757716378584654974L;
|
||||
|
||||
/** 尺码属性名称 */
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
/** 尺码属性值的单位 */
|
||||
@JsonProperty("unit")
|
||||
private String unit;
|
||||
|
||||
/** 尺码属性值是否为区间 */
|
||||
@JsonProperty("is_range")
|
||||
private Boolean range;
|
||||
|
||||
/** 尺码值与尺码属性值的映射列表 */
|
||||
@JsonProperty("value_list")
|
||||
private List<ValueRange> valueList;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class ValueRange implements Serializable {
|
||||
/** 尺码值 */
|
||||
@JsonProperty("key")
|
||||
private String key;
|
||||
|
||||
/** 尺码属性值;尺码属性值为非区间时返回 */
|
||||
@JsonProperty("value")
|
||||
private String value;
|
||||
|
||||
/** 尺码属性值的左边界;尺码属性值为区间时返回 */
|
||||
@JsonProperty("left")
|
||||
private String left;
|
||||
|
||||
/** 尺码属性值的右边界;尺码属性值为区间时返回 */
|
||||
@JsonProperty("right")
|
||||
private String right;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* SPU库存信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SpuStockInfo implements Serializable {
|
||||
|
||||
/** 商品ID */
|
||||
@JsonProperty("product_id")
|
||||
protected String productId;
|
||||
|
||||
/** sku库存 */
|
||||
@JsonProperty("sku_stock")
|
||||
private List<SkuStockInfo> skuStock;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package me.chanjar.weixin.channel.bean.product;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 商品更新数据
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class SpuUpdateInfo extends SpuInfo {
|
||||
|
||||
/** 添加完成后是否立即上架。1:是;0:否;默认0 */
|
||||
@JsonProperty("listing")
|
||||
private Integer listing;
|
||||
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 区域库存
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@@ -21,4 +23,8 @@ public class WarehouseStockInfo implements Serializable {
|
||||
/** 区域库存数量 */
|
||||
@JsonProperty("num")
|
||||
private Integer num;
|
||||
|
||||
/** 区域库存的锁定库存(已下单未支付的库存)数量 */
|
||||
@JsonProperty("lock_stock")
|
||||
private Integer lockStock;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package me.chanjar.weixin.channel.bean.product.link;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 商品H5短链 结果
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ProductH5UrlResponse extends WxChannelBaseResponse {
|
||||
|
||||
/** 商品H5短链 */
|
||||
@JsonProperty("product_h5url")
|
||||
private String productH5url;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package me.chanjar.weixin.channel.bean.product.link;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 商品二维码 结果
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ProductQrCodeResponse extends WxChannelBaseResponse {
|
||||
|
||||
/** 商品二维码 */
|
||||
@JsonProperty("product_qrcode")
|
||||
private String productQrcode;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package me.chanjar.weixin.channel.bean.product.link;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
/**
|
||||
* 商品口令 结果
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ProductTagLinkResponse extends WxChannelBaseResponse {
|
||||
|
||||
/** 商品口令 */
|
||||
@JsonProperty("product_taglink")
|
||||
private String productTaglink;
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import java.io.Serializable;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StableToken implements Serializable {
|
||||
public class StableTokenParam implements Serializable {
|
||||
private static final long serialVersionUID = 6849364823232834171L;
|
||||
|
||||
@JsonProperty("grant_type")
|
||||
@@ -17,7 +17,7 @@ import java.io.Serializable;
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@AllArgsConstructor
|
||||
public class VipParam implements Serializable {
|
||||
public class VipOpenIdParam implements Serializable {
|
||||
private static final long serialVersionUID = -7924178026258012317L;
|
||||
@JsonProperty("openid")
|
||||
private String openId;
|
||||
@@ -7,7 +7,9 @@ import me.chanjar.weixin.common.error.WxError;
|
||||
* 微信视频号错误码
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
* @deprecated 请使用 {@link me.chanjar.weixin.common.error.WxError} 替代
|
||||
*/
|
||||
@Deprecated
|
||||
public class ChannelWxError extends WxError {
|
||||
|
||||
private static final long serialVersionUID = -2638512715814977441L;
|
||||
|
||||
@@ -19,6 +19,14 @@ public interface WxChannelConfig {
|
||||
*/
|
||||
String getAccessToken();
|
||||
|
||||
/**
|
||||
* Is use stable access token api
|
||||
*
|
||||
* @link <a href="https://developers.weixin.qq.com/doc/store/API/basics/getStableAccessToken.html">获取稳定版AccessToken</a>
|
||||
* @return the boolean
|
||||
*/
|
||||
boolean isStableAccessToken();
|
||||
|
||||
/**
|
||||
* Gets access token lock.
|
||||
*
|
||||
|
||||
@@ -33,6 +33,8 @@ public class WxChannelDefaultConfigImpl implements WxChannelConfig {
|
||||
private volatile int httpProxyPort;
|
||||
private volatile String httpProxyUsername;
|
||||
private volatile String httpProxyPassword;
|
||||
/** 是否使用稳定版获取accessToken接口 */
|
||||
private volatile boolean stableAccessToken;
|
||||
|
||||
private volatile int retrySleepMillis = 1000;
|
||||
private volatile int maxRetryTimes = 5;
|
||||
@@ -63,6 +65,15 @@ public class WxChannelDefaultConfigImpl implements WxChannelConfig {
|
||||
this.accessToken = accessToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStableAccessToken() {
|
||||
return stableAccessToken;
|
||||
}
|
||||
|
||||
public void setStableAccessToken(boolean stableAccessToken) {
|
||||
this.stableAccessToken = stableAccessToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Lock getAccessTokenLock() {
|
||||
return this.accessTokenLock;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user