diff --git a/README.md b/README.md index 0c6daaea9c..ebd8a852c7 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ - 微信开放平台:`weixin-java-open` - 公众号(包括订阅号和服务号):`weixin-java-mp` - 企业号/企业微信:`weixin-java-cp` + - 视频号/微信小店:`weixin-java-channel` --------------------------------- diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java index c107cc85cd..6f7be2f63f 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java @@ -89,6 +89,18 @@ void orderCancel(OrderCancelMessage message, final String content, final String void orderPay(OrderPayMessage message, final String content, final String appId, final Map context, final WxSessionManager sessionManager); + /** + * 订单待发货 + * + * @param message 消息 + * @param content 消息原始内容 + * @param appId appId + * @param context 上下文 + * @param sessionManager session管理器 + */ + void orderWaitShipping(OrderIdMessage message, final String content, final String appId, final Map context, + final WxSessionManager sessionManager); + /** * 订单发货 * diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassShopService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassShopService.java new file mode 100644 index 0000000000..aa3a85fa74 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassShopService.java @@ -0,0 +1,126 @@ +package me.chanjar.weixin.channel.api; + +import me.chanjar.weixin.channel.bean.compass.shop.FinderAuthListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderOverallResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderProductListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderProductOverallResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopLiveListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopOverallResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopProductDataResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopProductListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopSaleProfileDataResponse; +import me.chanjar.weixin.common.error.WxErrorException; + +/** + * 视频号/微信小店 罗盘商家版服务 + * + * @author Zeyes + */ +public interface WxChannelCompassShopService { + + /** + * 获取电商概览数据 + * + * @param ds 日期,格式 yyyyMMdd + * @return 电商概览数据 + * + * @throws WxErrorException 异常 + */ + ShopOverallResponse getShopOverall(String ds) throws WxErrorException; + + /** + * 获取授权视频号列表 + * + * @return 获取授权视频号列表 + * + * @throws WxErrorException 异常 + */ + FinderAuthListResponse getFinderAuthorizationList() throws WxErrorException; + + /** + * 获取带货达人列表 + * + * @param ds 日期,格式 yyyyMMdd + * @return 带货达人列表 + * + * @throws WxErrorException 异常 + */ + FinderListResponse getFinderList(String ds) throws WxErrorException; + + /** + * 获取带货数据概览 + * + * @param ds 日期,格式 yyyyMMdd + * @return 带货数据概览 + * + * @throws WxErrorException 异常 + */ + FinderOverallResponse getFinderOverall(String ds) throws WxErrorException; + + /** + * 获取带货达人商品列表 + * + * @param ds 日期,格式YYYYMMDD + * @param finderId 视频号ID + * @return 带货达人商品列表 + * + * @throws WxErrorException 异常 + */ + FinderProductListResponse getFinderProductList(String ds, String finderId) throws WxErrorException; + + /** + * 获取带货达人详情 + * + * @param ds 日期,格式YYYYMMDD + * @param finderId 视频号ID + * @return 带货达人详情 + * + * @throws WxErrorException 异常 + */ + FinderProductOverallResponse getFinderProductOverall(String ds, String finderId) throws WxErrorException; + + /** + * 获取店铺开播列表 + * + * @param ds 日期,格式YYYYMMDD + * @param finderId 视频号ID + * @return 店铺开播列表 + * + * @throws WxErrorException 异常 + */ + ShopLiveListResponse getShopLiveList(String ds, String finderId) throws WxErrorException; + + /** + * 获取商品详细信息 + * + * @param ds 日期,格式YYYYMMDD + * @param productId 商品id + * @return 商品详细信息 + * + * @throws WxErrorException 异常 + */ + ShopProductDataResponse getShopProductData(String ds, String productId) throws WxErrorException; + + /** + * 获取商品列表 + * + * @param ds 日期,格式YYYYMMDD + * @return 商品列表 + * + * @throws WxErrorException 异常 + */ + ShopProductListResponse getShopProductList(String ds) throws WxErrorException; + + /** + * 获取店铺人群数据 + * + * @param ds 日期,格式 yyyyMMdd + * @param type 用户类型,1商品曝光用户 2商品点击用户 3购买用户 4首购用户 5复购用户 + * @return 店铺人群数据 + * + * @throws WxErrorException 异常 + */ + ShopSaleProfileDataResponse getShopSaleProfileData(String ds, Integer type) throws WxErrorException; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelService.java index 89f6b00964..50a029c196 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelService.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelService.java @@ -98,6 +98,20 @@ public interface WxChannelService extends BaseWxChannelService { */ WxStoreHomePageService getHomePageService(); + /** + * 合作账号服务 + * + * @return 团长合作服务 + */ + WxStoreCooperationService getCooperationService(); + + /** + * 视频号/微信小店 罗盘商家版服务 + * + * @return 罗盘商家版服务 + */ + WxChannelCompassShopService getCompassShopService(); + /** * 优选联盟-团长合作达人管理服务 * diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreCooperationService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreCooperationService.java new file mode 100644 index 0000000000..96d2ff5f8d --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreCooperationService.java @@ -0,0 +1,70 @@ +package me.chanjar.weixin.channel.api; + +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; +import me.chanjar.weixin.channel.bean.cooperation.CooperationListResponse; +import me.chanjar.weixin.channel.bean.cooperation.CooperationQrCodeResponse; +import me.chanjar.weixin.channel.bean.cooperation.CooperationStatusResponse; +import me.chanjar.weixin.common.error.WxErrorException; + +/** + * 微信小店 合作账号相关接口 + * + * @author Zeyes + * @see 合作账号状态机 + */ +public interface WxStoreCooperationService { + + /** + * 获取合作账号列表 + * + * @param sharerType 合作账号类型 2公众号 3小程序 + * @return 合作账号列表 + * + * @throws WxErrorException 异常 + */ + CooperationListResponse listCooperation(Integer sharerType) throws WxErrorException; + + /** + * 获取合作账号状态 + * + * @param sharerId 合作账号id 公众号: gh_开头id 小程序: appid + * @param sharerType 合作账号类型 2公众号 3小程序 + * @return 合作账号状态 + * + * @throws WxErrorException 异常 + */ + CooperationStatusResponse getCooperationStatus(String sharerId, Integer sharerType) throws WxErrorException; + + /** + * 生成合作账号邀请二维码 + * + * @param sharerId 合作账号id 公众号: gh_开头id 小程序: appid + * @param sharerType 合作账号类型 2公众号 3小程序 + * @return 二维码 + * + * @throws WxErrorException 异常 + */ + CooperationQrCodeResponse generateQrCode(String sharerId, Integer sharerType) throws WxErrorException; + + /** + * 取消合作账号邀请 + * + * @param sharerId 合作账号id 公众号: gh_开头id 小程序: appid + * @param sharerType 合作账号类型 2公众号 3小程序 + * @return WxChannelBaseResponse + * + * @throws WxErrorException 异常 + */ + WxChannelBaseResponse cancelInvitation(String sharerId, Integer sharerType) throws WxErrorException; + + /** + * 解绑合作账号 + * + * @param sharerId 合作账号id 公众号: gh_开头id 小程序: appid + * @param sharerType 合作账号类型 2公众号 3小程序 + * @return WxChannelBaseResponse + * + * @throws WxErrorException 异常 + */ + WxChannelBaseResponse unbind(String sharerId, Integer sharerType) throws WxErrorException; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java index 200021b37d..ea0ee6c444 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java @@ -72,6 +72,8 @@ protected void addDefaultRule() { this.addRule(OrderCancelMessage.class, ORDER_CANCEL, this::orderCancel); /* 订单支付成功 */ this.addRule(OrderPayMessage.class, ORDER_PAY, this::orderPay); + /* 订单待发货 */ + this.addRule(OrderIdMessage.class, ORDER_WAIT_SHIPPING, this::orderWaitShipping); /* 订单发货 */ this.addRule(OrderDeliveryMessage.class, ORDER_DELIVER, this::orderDelivery); /* 订单确认收货 */ @@ -186,6 +188,12 @@ public void orderPay(OrderPayMessage message, String content, String appId, log.info("订单支付成功:{}", JsonUtils.encode(message)); } + @Override + public void orderWaitShipping(OrderIdMessage message, String content, String appId, + Map context, WxSessionManager sessionManager) { + log.info("订单待发货:{}", JsonUtils.encode(message)); + } + @Override public void orderDelivery(OrderDeliveryMessage message, String content, String appId, Map context, WxSessionManager sessionManager) { diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java index ee4625c1a3..f85a9116c6 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java @@ -48,6 +48,8 @@ public abstract class BaseWxChannelServiceImpl implements WxChannelService private final WxChannelSharerService sharerService = new WxChannelSharerServiceImpl(this); private final WxChannelFundService fundService = new WxChannelFundServiceImpl(this); private WxStoreHomePageService homePageService = null; + private WxStoreCooperationService cooperationService = null; + private WxChannelCompassShopService compassShopService = null; private WxLeagueWindowService leagueWindowService = null; private WxLeagueSupplierService leagueSupplierService = null; private WxLeaguePromoterService leaguePromoterService = null; @@ -56,10 +58,8 @@ public abstract class BaseWxChannelServiceImpl implements WxChannelService private WxFinderLiveService finderLiveService = null; private WxAssistantService assistantService = null; private WxChannelVipService vipService = null; - private final WxChannelCompassFinderService compassFinderService = - new WxChannelCompassFinderServiceImpl(this); - private final WxChannelLiveDashboardService liveDashboardService = - new WxChannelLiveDashboardServiceImpl(this); + private WxChannelCompassFinderService compassFinderService = null; + private WxChannelLiveDashboardService liveDashboardService = null; protected WxChannelConfig config; private int retrySleepMillis = 1000; @@ -376,6 +376,22 @@ public synchronized WxStoreHomePageService getHomePageService() { return homePageService; } + @Override + public synchronized WxStoreCooperationService getCooperationService() { + if (cooperationService == null) { + cooperationService = new WxStoreCooperationServiceImpl(this); + } + return cooperationService; + } + + @Override + public synchronized WxChannelCompassShopService getCompassShopService() { + if (compassShopService == null) { + compassShopService = new WxChannelCompassShopServiceImpl(this); + } + return compassShopService; + } + @Override public synchronized WxLeagueWindowService getLeagueWindowService() { if (leagueWindowService == null) { @@ -409,7 +425,7 @@ public synchronized WxLeagueProductService getLeagueProductService() { } @Override - public WxLeadComponentService getLeadComponentService() { + public synchronized WxLeadComponentService getLeadComponentService() { if (leadComponentService == null) { leadComponentService = new WxLeadComponentServiceImpl(this); } @@ -417,7 +433,7 @@ public WxLeadComponentService getLeadComponentService() { } @Override - public WxFinderLiveService getFinderLiveService() { + public synchronized WxFinderLiveService getFinderLiveService() { if (finderLiveService == null) { finderLiveService = new WxFinderLiveServiceImpl(this); } @@ -425,7 +441,7 @@ public WxFinderLiveService getFinderLiveService() { } @Override - public WxAssistantService getAssistantService() { + public synchronized WxAssistantService getAssistantService() { if (assistantService == null) { assistantService = new WxAssistantServiceImpl(this) { }; @@ -434,7 +450,7 @@ public WxAssistantService getAssistantService() { } @Override - public WxChannelVipService getVipService() { + public synchronized WxChannelVipService getVipService() { if (vipService == null) { vipService = new WxChannelVipServiceImpl(this); } @@ -442,9 +458,19 @@ public WxChannelVipService getVipService() { } @Override - public WxChannelCompassFinderService getCompassFinderService() { return compassFinderService; } + public synchronized WxChannelCompassFinderService getCompassFinderService() { + if (compassFinderService == null) { + compassFinderService = new WxChannelCompassFinderServiceImpl(this); + } + return compassFinderService; + } @Override - public WxChannelLiveDashboardService getLiveDashboardService() { return liveDashboardService; } + public synchronized WxChannelLiveDashboardService getLiveDashboardService() { + if (liveDashboardService == null) { + liveDashboardService = new WxChannelLiveDashboardServiceImpl(this); + } + return liveDashboardService; + } } diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassFinderServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassFinderServiceImpl.java index 34bead89d6..acaad0c0c1 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassFinderServiceImpl.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassFinderServiceImpl.java @@ -2,6 +2,7 @@ import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.channel.api.WxChannelCompassFinderService; +import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam; import me.chanjar.weixin.channel.bean.compass.finder.*; import me.chanjar.weixin.channel.util.ResponseUtils; import me.chanjar.weixin.common.error.WxErrorException; diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImpl.java new file mode 100644 index 0000000000..36b5a23950 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImpl.java @@ -0,0 +1,116 @@ +package me.chanjar.weixin.channel.api.impl; + +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.FINDER_AUTH_LIST_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.FINDER_LIST_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_FINDER_OVERALL_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_FINDER_PRODUCT_LIST_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_FINDER_PRODUCT_OVERALL_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_LIVE_LIST_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_SHOP_OVERALL_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_SHOP_PRODUCT_DATA_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_SHOP_PRODUCT_LIST_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_SHOP_SALE_PROFILE_DATA_URL; + +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.channel.api.WxChannelCompassShopService; +import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam; +import me.chanjar.weixin.channel.bean.compass.shop.CompassFinderIdParam; +import me.chanjar.weixin.channel.bean.compass.shop.FinderAuthListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderOverallResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderProductListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderProductOverallResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopLiveListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopOverallResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopProductDataParam; +import me.chanjar.weixin.channel.bean.compass.shop.ShopProductDataResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopProductListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopSaleProfileDataParam; +import me.chanjar.weixin.channel.bean.compass.shop.ShopSaleProfileDataResponse; +import me.chanjar.weixin.channel.util.ResponseUtils; +import me.chanjar.weixin.common.error.WxErrorException; + +/** + * 视频号/微信小店 罗盘商家版 服务实现 + * + * @author Zeyes + */ +@Slf4j +public class WxChannelCompassShopServiceImpl implements WxChannelCompassShopService { + + /** + * 微信商店服务 + */ + private final BaseWxChannelServiceImpl shopService; + + public WxChannelCompassShopServiceImpl(BaseWxChannelServiceImpl shopService) {this.shopService = shopService;} + + @Override + public ShopOverallResponse getShopOverall(String ds) throws WxErrorException { + CompassFinderBaseParam param = new CompassFinderBaseParam(ds); + String resJson = shopService.post(GET_SHOP_OVERALL_URL, param); + return ResponseUtils.decode(resJson, ShopOverallResponse.class); + } + + @Override + public FinderAuthListResponse getFinderAuthorizationList() throws WxErrorException { + String resJson = shopService.post(FINDER_AUTH_LIST_URL, "{}"); + return ResponseUtils.decode(resJson, FinderAuthListResponse.class); + } + + @Override + public FinderListResponse getFinderList(String ds) throws WxErrorException { + CompassFinderBaseParam param = new CompassFinderBaseParam(ds); + String resJson = shopService.post(FINDER_LIST_URL, param); + return ResponseUtils.decode(resJson, FinderListResponse.class); + } + + @Override + public FinderOverallResponse getFinderOverall(String ds) throws WxErrorException { + CompassFinderBaseParam param = new CompassFinderBaseParam(ds); + String resJson = shopService.post(GET_FINDER_OVERALL_URL, param); + return ResponseUtils.decode(resJson, FinderOverallResponse.class); + } + + @Override + public FinderProductListResponse getFinderProductList(String ds, String finderId) throws WxErrorException { + CompassFinderIdParam param = new CompassFinderIdParam(ds, finderId); + String resJson = shopService.post(GET_FINDER_PRODUCT_LIST_URL, param); + return ResponseUtils.decode(resJson, FinderProductListResponse.class); + } + + @Override + public FinderProductOverallResponse getFinderProductOverall(String ds, String finderId) throws WxErrorException { + CompassFinderIdParam param = new CompassFinderIdParam(ds, finderId); + String resJson = shopService.post(GET_FINDER_PRODUCT_OVERALL_URL, param); + return ResponseUtils.decode(resJson, FinderProductOverallResponse.class); + } + + @Override + public ShopLiveListResponse getShopLiveList(String ds, String finderId) throws WxErrorException { + CompassFinderIdParam param = new CompassFinderIdParam(ds, finderId); + String resJson = shopService.post(GET_LIVE_LIST_URL, param); + return ResponseUtils.decode(resJson, ShopLiveListResponse.class); + } + + @Override + public ShopProductDataResponse getShopProductData(String ds, String productId) throws WxErrorException { + ShopProductDataParam param = new ShopProductDataParam(ds, productId); + String resJson = shopService.post(GET_SHOP_PRODUCT_DATA_URL, param); + return ResponseUtils.decode(resJson, ShopProductDataResponse.class); + } + + @Override + public ShopProductListResponse getShopProductList(String ds) throws WxErrorException { + CompassFinderBaseParam param = new CompassFinderBaseParam(ds); + String resJson = shopService.post(GET_SHOP_PRODUCT_LIST_URL, param); + return ResponseUtils.decode(resJson, ShopProductListResponse.class); + } + + @Override + public ShopSaleProfileDataResponse getShopSaleProfileData(String ds, Integer type) throws WxErrorException { + ShopSaleProfileDataParam param = new ShopSaleProfileDataParam(ds, type); + String resJson = shopService.post(GET_SHOP_SALE_PROFILE_DATA_URL, param); + return ResponseUtils.decode(resJson, ShopSaleProfileDataResponse.class); + } +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImpl.java new file mode 100644 index 0000000000..f82e35fa2f --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImpl.java @@ -0,0 +1,68 @@ +package me.chanjar.weixin.channel.api.impl; + +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Cooperation.CANCEL_COOPERATION_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Cooperation.GENERATE_QRCODE_COOPERATION_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Cooperation.GET_COOPERATION_STATUS_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Cooperation.LIST_COOPERATION_URL; +import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Cooperation.UNBIND_COOPERATION_URL; + +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.channel.api.WxStoreCooperationService; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; +import me.chanjar.weixin.channel.bean.cooperation.CooperationListResponse; +import me.chanjar.weixin.channel.bean.cooperation.CooperationQrCodeResponse; +import me.chanjar.weixin.channel.bean.cooperation.CooperationSharerParam; +import me.chanjar.weixin.channel.bean.cooperation.CooperationStatusResponse; +import me.chanjar.weixin.channel.util.ResponseUtils; +import me.chanjar.weixin.common.error.WxErrorException; + +/** + * 微信小店 合作账号相关接口 + * + * @author Zeyes + */ +@Slf4j +public class WxStoreCooperationServiceImpl implements WxStoreCooperationService { + + /** 微信小店服务 */ + private final BaseWxChannelServiceImpl storeService; + + public WxStoreCooperationServiceImpl(BaseWxChannelServiceImpl storeService) { + this.storeService = storeService; + } + + @Override + public CooperationListResponse listCooperation(Integer sharerType) throws WxErrorException { + String paramJson = "{\"sharer_type\":" + sharerType + "}"; + String resJson = storeService.post(LIST_COOPERATION_URL, paramJson); + return ResponseUtils.decode(resJson, CooperationListResponse.class); + } + + @Override + public CooperationStatusResponse getCooperationStatus(String sharerId, Integer sharerType) throws WxErrorException { + CooperationSharerParam param = new CooperationSharerParam(sharerId, sharerType); + String resJson = storeService.post(GET_COOPERATION_STATUS_URL, param); + return ResponseUtils.decode(resJson, CooperationStatusResponse.class); + } + + @Override + public CooperationQrCodeResponse generateQrCode(String sharerId, Integer sharerType) throws WxErrorException { + CooperationSharerParam param = new CooperationSharerParam(sharerId, sharerType); + String resJson = storeService.post(GENERATE_QRCODE_COOPERATION_URL, param); + return ResponseUtils.decode(resJson, CooperationQrCodeResponse.class); + } + + @Override + public WxChannelBaseResponse cancelInvitation(String sharerId, Integer sharerType) throws WxErrorException { + CooperationSharerParam param = new CooperationSharerParam(sharerId, sharerType); + String resJson = storeService.post(CANCEL_COOPERATION_URL, param); + return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); + } + + @Override + public WxChannelBaseResponse unbind(String sharerId, Integer sharerType) throws WxErrorException { + CooperationSharerParam param = new CooperationSharerParam(sharerId, sharerType); + String resJson = storeService.post(UNBIND_COOPERATION_URL, param); + return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); + } +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListResponse.java index 3ad67cffcf..dde39238a7 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListResponse.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListResponse.java @@ -14,7 +14,7 @@ */ @Data @NoArgsConstructor -@EqualsAndHashCode +@EqualsAndHashCode(callSuper = true) public class AfterSaleListResponse extends WxChannelBaseResponse { private static final long serialVersionUID = 5033313416948732123L; @@ -23,6 +23,7 @@ public class AfterSaleListResponse extends WxChannelBaseResponse { private List ids; /** 翻页参数 */ + @JsonProperty("next_key") private String nextKey; /** 是否还有数据 */ diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryResponse.java index af6f484254..6509321b88 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryResponse.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryResponse.java @@ -3,6 +3,7 @@ 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; @@ -13,6 +14,7 @@ */ @Data @NoArgsConstructor +@EqualsAndHashCode(callSuper = true) public class PassCategoryResponse extends WxChannelBaseResponse { private static final long serialVersionUID = -3674591447273025743L; diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/CompassFinderBaseParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/CompassFinderBaseParam.java similarity index 92% rename from weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/CompassFinderBaseParam.java rename to weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/CompassFinderBaseParam.java index 78e088f9ec..a1d5e277cc 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/CompassFinderBaseParam.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/CompassFinderBaseParam.java @@ -1,4 +1,4 @@ -package me.chanjar.weixin.channel.bean.compass.finder; +package me.chanjar.weixin.channel.bean.compass; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductDataParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductDataParam.java index bddb9f3356..57a26a9794 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductDataParam.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductDataParam.java @@ -5,6 +5,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam; /** * 获取带货商品数据请求参数 diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileDataParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileDataParam.java index 57a5854e71..abe4610785 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileDataParam.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileDataParam.java @@ -5,6 +5,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam; /** * 获取带货人群数据请求参数 diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/CompassFinderIdParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/CompassFinderIdParam.java new file mode 100644 index 0000000000..9383d2de2f --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/CompassFinderIdParam.java @@ -0,0 +1,32 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam; + +/** + * 带货达人 请求参数 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CompassFinderIdParam extends CompassFinderBaseParam { + + private static final long serialVersionUID = 9214560943091074780L; + + /** 视频号ID */ + @JsonProperty("finder_id") + private String finderId; + + public CompassFinderIdParam(String ds, String finderId) { + super(ds); + this.finderId = finderId; + } + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderAuthListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderAuthListResponse.java new file mode 100644 index 0000000000..0f0351e975 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderAuthListResponse.java @@ -0,0 +1,30 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +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 Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class FinderAuthListResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = -3215073536002857589L; + + /** 主营视频号id */ + @JsonProperty("main_finder_id") + private String mainFinderId; + + /** 授权视频号id列表 */ + @JsonProperty("authorized_finder_id_list") + private List authorizedFinderIdList; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvData.java new file mode 100644 index 0000000000..822f93c4f0 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvData.java @@ -0,0 +1,39 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 带货达人数据 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class FinderGmvData implements Serializable { + + private static final long serialVersionUID = -7463331971169286175L; + + /** 成交金额,单位分 */ + @JsonProperty("pay_gmv") + private String payGmv; + + /** 动销商品数 */ + @JsonProperty("pay_product_id_cnt") + private String payProductIdCnt; + + /** 成交人数 */ + @JsonProperty("pay_uv") + private String payUv; + + /** 退款金额,单位分 */ + @JsonProperty("refund_gmv") + private String refundGmv; + + /** 成交退款金额,单位分 */ + @JsonProperty("pay_refund_gmv") + private String payRefundGmv; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvItem.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvItem.java new file mode 100644 index 0000000000..a102732c8a --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvItem.java @@ -0,0 +1,30 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 带货达人列表数据 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class FinderGmvItem implements Serializable { + + private static final long serialVersionUID = -3740996985044711599L; + + /** 视频号id */ + @JsonProperty("finder_id") + private String finderId; + + /** 视频号昵称 */ + @JsonProperty("finder_nickname") + private String finderNickname; + + /** 带货达人数据 */ + @JsonProperty("data") + private FinderGmvData data; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderListResponse.java new file mode 100644 index 0000000000..a5a37d9a2f --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderListResponse.java @@ -0,0 +1,26 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +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 Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class FinderListResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = 6358992001065379269L; + + /** 授权视频号id列表 */ + @JsonProperty("finder_list") + private List finderList; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallData.java new file mode 100644 index 0000000000..6303202709 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallData.java @@ -0,0 +1,35 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 带货数据概览 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class FinderOverallData implements Serializable { + + private static final long serialVersionUID = -994852668593815907L; + + /** 成交金额,单位分 */ + @JsonProperty("pay_gmv") + private String payGmv; + + /** 动销达人数 */ + @JsonProperty("pay_sales_finder_cnt") + private String paySalesFinderCnt; + + /** 动销商品数 */ + @JsonProperty("pay_product_id_cnt") + private String payProductIdCnt; + + /** 点击-成交转化率 */ + @JsonProperty("click_to_pay_uv_ratio") + private Double clickToPayUvRatio; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallResponse.java new file mode 100644 index 0000000000..fdc83fcce8 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallResponse.java @@ -0,0 +1,26 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; + +/** + * 带货数据概览 响应 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class FinderOverallResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = -4935555091396799318L; + + /** + * 电商概览数据 + */ + @JsonProperty("data") + private FinderOverallData data; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListItem.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListItem.java new file mode 100644 index 0000000000..7f6ad34445 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListItem.java @@ -0,0 +1,66 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 带货达人商品列表 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class FinderProductListItem implements Serializable { + + private static final long serialVersionUID = 1646092488200992026L; + + /** 商品id */ + @JsonProperty("product_id") + private String productId; + + /** 商品头图 */ + @JsonProperty("head_img_url") + private String headImgUrl; + + /** 商品标题 */ + @JsonProperty("title") + private String title; + + /** 商品价格 */ + @JsonProperty("price") + private String price; + + /** 商品1级类目 */ + @JsonProperty("first_category_id") + private String firstCategoryId; + + /** 商品2级类目 */ + @JsonProperty("second_category_id") + private String secondCategoryId; + + /** 商品3级类目 */ + @JsonProperty("third_category_id") + private String thirdCategoryId; + + /** gmv */ + @JsonProperty("data") + private GmvData data; + + + @Data + @NoArgsConstructor + public static class GmvData implements Serializable { + private static final long serialVersionUID = 1840494188469233735L; + + /** 佣金率 */ + @JsonProperty("commission_ratio") + private Double commissionRatio; + + /** 成交金额,单位分 */ + @JsonProperty("pay_gmv") + private String payGmv; + } + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListResponse.java new file mode 100644 index 0000000000..bcdb1932d4 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListResponse.java @@ -0,0 +1,28 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +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 Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class FinderProductListResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = 5883861777181983173L; + + /** + * 带货达人商品列表 + */ + @JsonProperty("product_list") + private List productList; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductOverallResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductOverallResponse.java new file mode 100644 index 0000000000..e47223a4d8 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductOverallResponse.java @@ -0,0 +1,25 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; + +/** + * 带货达人详情 响应 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class FinderProductOverallResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = 6358992001065379269L; + + /** 带货达人详情 */ + @JsonProperty("data") + private FinderGmvData data; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductSimpleGmvData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductSimpleGmvData.java new file mode 100644 index 0000000000..7a635dc4b0 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductSimpleGmvData.java @@ -0,0 +1,26 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 带货达人商品GMV数据 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class FinderProductSimpleGmvData implements Serializable { + private static final long serialVersionUID = -3740996985044711599L; + + /** 佣金率 */ + @JsonProperty("commission_ratio") + private Double commissionRatio; + + /** 成交金额,单位分 */ + @JsonProperty("pay_gmv") + private String payGmv; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopField.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopField.java new file mode 100644 index 0000000000..4acd91ace0 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopField.java @@ -0,0 +1,44 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import java.util.List; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 维度数据 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class ShopField implements Serializable { + + private static final long serialVersionUID = -8669197081350262569L; + + /** 维度类别名 */ + @JsonProperty("field_name") + private String fieldName; + + /** 维度指标数据列表 */ + @JsonProperty("data_list") + private List dataList; + + + @Data + @NoArgsConstructor + public static class FieldDetail implements Serializable { + + private static final long serialVersionUID = 2900633035074950462L; + + /** 维度指标名 */ + @JsonProperty("dim_key") + private String dimKey; + + /** 维度指标值 */ + @JsonProperty("dim_value") + private String dimValue; + + } +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveData.java new file mode 100644 index 0000000000..d6a7b99451 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveData.java @@ -0,0 +1,36 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 店铺开播数据 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class ShopLiveData implements Serializable { + + /** 直播id */ + @JsonProperty("live_id") + private String liveId; + + /** 直播标题 */ + @JsonProperty("live_title") + private String liveTitle; + + /** 开播时间,unix时间戳 */ + @JsonProperty("live_time") + private String liveTime; + + /** 直播时长,单位秒 */ + @JsonProperty("live_duration") + private String liveDuration; + + /** 直播封面 */ + @JsonProperty("live_cover_img_url") + private String liveCoverImgUrl; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveListResponse.java new file mode 100644 index 0000000000..3ec9b68772 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveListResponse.java @@ -0,0 +1,26 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +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 Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class ShopLiveListResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = -7110751559923117330L; + + /** 店铺开播列表 */ + @JsonProperty("live_list") + private List liveList; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverall.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverall.java new file mode 100644 index 0000000000..bf2fc8f42f --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverall.java @@ -0,0 +1,42 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 电商概览数据 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class ShopOverall implements Serializable { + + private static final long serialVersionUID = 3304918097895132226L; + + /** 成交金额,单位分 */ + @JsonProperty("pay_gmv") + private String payGmv; + + /** 成交人数 */ + @JsonProperty("pay_uv") + private String payUv; + + /** 成交退款金额,单位分 */ + @JsonProperty("pay_refund_gmv") + private String payRefundGmv; + + /** 成交订单数 */ + @JsonProperty("pay_order_cnt") + private String payOrderCnt; + + /** 直播成交金额,单位分 */ + @JsonProperty("live_pay_gmv") + private String livePayGmv; + + /** 短视频成交金额,单位分 */ + @JsonProperty("feed_pay_gmv") + private String feedPayGmv; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverallResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverallResponse.java new file mode 100644 index 0000000000..4b371454ca --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverallResponse.java @@ -0,0 +1,27 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; + +/** + * 获取电商概览数据响应 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class ShopOverallResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = 1632800741359642057L; + + /** + * 电商概览数据 + */ + @JsonProperty("data") + private ShopOverall data; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductCompassData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductCompassData.java new file mode 100644 index 0000000000..03253e399e --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductCompassData.java @@ -0,0 +1,143 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 店铺商品罗盘数据 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class ShopProductCompassData implements Serializable { + + private static final long serialVersionUID = 5387546181020447627L; + + /** 成交金额 */ + @JsonProperty("pay_gmv") + private String payGmv; + + /**下单金额,单位分 */ + @JsonProperty("create_gmv") + private String createGmv; + + /** 下单订单数 */ + @JsonProperty("create_cnt") + private String createCnt; + + /** 下单人数 */ + @JsonProperty("create_uv") + private String createUv; + + /** 下单件数 */ + @JsonProperty("create_product_cnt") + private String createProductCnt; + + /** 成交订单数 */ + @JsonProperty("pay_cnt") + private String payCnt; + + /** 成交人数 */ + @JsonProperty("pay_uv") + private String payUv; + + /** 成交件数 */ + @JsonProperty("pay_product_cnt") + private String payProductCnt; + + /** 成交金额(剔除退款) */ + @JsonProperty("pure_pay_gmv") + private String purePayGmv; + + /** 成交客单价(剔除退款) */ + @JsonProperty("pay_gmv_per_uv") + private String payGmvPerUv; + + /** 实际结算金额,单位分 */ + @JsonProperty("seller_actual_settle_amount") + private String sellerActualSettleAmount; + + /** 实际服务费金额,单位分 */ + @JsonProperty("platform_actual_commission") + private String platformActualCommission; + + /** 实际达人佣金支出,单位分 */ + @JsonProperty("finderuin_actual_commission") + private String finderuinActualCommission; + + /** 实际团长佣金支出,单位分 */ + @JsonProperty("captain_actual_commission") + private String captainActualCommission; + + /** 预估结算金额,单位分 */ + @JsonProperty("seller_predict_settle_amount") + private String sellerPredictSettleAmount; + + /** 预估服务费金额,单位分 */ + @JsonProperty("platform_predict_commission") + private String platformPredictCommission; + + /** 预估达人佣金支出,单位分 */ + @JsonProperty("finderuin_predict_commission") + private String finderuinPredictCommission; + + /** 预估团长佣金支出,单位分 */ + @JsonProperty("captain_predict_commission") + private String captainPredictCommission; + + /** 商品点击人数 */ + @JsonProperty("product_click_uv") + private String productClickUv; + + /** 商品点击次数 */ + @JsonProperty("product_click_cnt") + private String productClickCnt; + + /** 成交退款金额,单位分 */ + @JsonProperty("pay_refund_gmv") + private String payRefundGmv; + + /** 成交退款人数,单位分 */ + @JsonProperty("pay_refund_uv") + private String payRefundUv; + + /** 成交退款率 */ + @JsonProperty("pay_refund_ratio") + private Double payRefundRatio; + + /** 发货后成交退款率 */ + @JsonProperty("pay_refund_after_send_ratio") + private Double payRefundAfterSendRatio; + + /** 成交退款订单数 */ + @JsonProperty("pay_refund_cnt") + private String payRefundCnt; + + /** 成交退款件数 */ + @JsonProperty("pay_refund_product_cnt") + private String payRefundProductCnt; + + /** 发货前成交退款率 */ + @JsonProperty("pay_refund_before_send_ratio") + private Double payRefundBeforeSendRatio; + + /** 退款金额,单位分 */ + @JsonProperty("refund_gmv") + private String refundGmv; + + /** 退款件数 */ + @JsonProperty("refund_product_cnt") + private String refundProductCnt; + + /** 退款订单数 */ + @JsonProperty("refund_cnt") + private String refundCnt; + + /** 退款人数 */ + @JsonProperty("refund_uv") + private String refundUv; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataParam.java new file mode 100644 index 0000000000..74d7306273 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataParam.java @@ -0,0 +1,32 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam; + +/** + * 商品数据 请求参数 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class ShopProductDataParam extends CompassFinderBaseParam { + + private static final long serialVersionUID = - 5016298274452168329L; + + /** 商品id */ + @JsonProperty("product_id") + private String productId; + + public ShopProductDataParam(String ds, String productId) { + super(ds); + this.productId = productId; + } + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataResponse.java new file mode 100644 index 0000000000..bd7a22d243 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataResponse.java @@ -0,0 +1,26 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; + +/** + * 商品详细信息 响应 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class ShopProductDataResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = 6903392663954301579L; + + /** 商品详细信息 */ + @JsonProperty("product_info") + private ShopProductInfo productInfo; + + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductInfo.java new file mode 100644 index 0000000000..1eb55eaa75 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductInfo.java @@ -0,0 +1,51 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 店铺带货商品数据 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class ShopProductInfo implements Serializable { + + private static final long serialVersionUID = 3376047696301017643L; + + /** 商品id */ + @JsonProperty("product_id") + private String productId; + + /** 商品图 */ + @JsonProperty("head_img_url") + private String headImgUrl; + + /** 商品标题 */ + @JsonProperty("title") + private String title; + + /** 商品价格,单位分 */ + @JsonProperty("price") + private String price; + + /** 商品一级类目 */ + @JsonProperty("first_category_id") + private String firstCategoryId; + + /** 商品二级类目 */ + @JsonProperty("second_category_id") + private String secondCategoryId; + + /** 商品三级类目 */ + @JsonProperty("third_category_id") + private String thirdCategoryId; + + /** 商品罗盘数据 */ + @JsonProperty("data") + private ShopProductCompassData data; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductListResponse.java new file mode 100644 index 0000000000..258b8f5845 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductListResponse.java @@ -0,0 +1,26 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +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 Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class ShopProductListResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = -6328224902770141045L; + + /** 商品列表 */ + @JsonProperty("product_list") + private List productList; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileData.java new file mode 100644 index 0000000000..23639c5356 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileData.java @@ -0,0 +1,24 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import java.util.List; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 店铺人群数据 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class ShopSaleProfileData implements Serializable { + + private static final long serialVersionUID = -6825849811081728787L; + + /** 维度数据列表 */ + @JsonProperty("field_list") + private List fieldList; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataParam.java new file mode 100644 index 0000000000..36cab13860 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataParam.java @@ -0,0 +1,32 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam; + +/** + * 获取带货人群数据请求参数 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class ShopSaleProfileDataParam extends CompassFinderBaseParam { + + private static final long serialVersionUID = 240010632808576923L; + + /** 用户类型 */ + @JsonProperty("type") + private Integer type; + + public ShopSaleProfileDataParam(String ds, Integer type) { + super(ds); + this.type = type; + } + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataResponse.java new file mode 100644 index 0000000000..a874cd6355 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataResponse.java @@ -0,0 +1,25 @@ +package me.chanjar.weixin.channel.bean.compass.shop; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; + +/** + * 店铺人群数据 响应 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class ShopSaleProfileDataResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = 8520148855114842741L; + + /** 店铺人群数据 */ + @JsonProperty("data") + private ShopSaleProfileData data; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationData.java new file mode 100644 index 0000000000..41020f4993 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationData.java @@ -0,0 +1,47 @@ +package me.chanjar.weixin.channel.bean.cooperation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 合作账号信息 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class CooperationData implements Serializable { + + private static final long serialVersionUID = 3930010847236599458L; + + /** 合作账号id 公众号: gh_开头id 小程序: appid */ + @JsonProperty("sharer_id") + private String sharerId; + + /** 邀请/合作账号状态 1已绑定 2已解绑 3邀请已拒绝 4邀请接受中 5邀请接受超时 6邀请接受失败 7邀请店铺取消 */ + @JsonProperty("status") + private Integer status; + + /** 合作账号名称 */ + @JsonProperty("sharer_name") + private String sharerName; + + /** 合作账号类型 2公众号 3小程序 */ + @JsonProperty("sharer_type") + private Integer sharerType; + + /** 接受绑定时间戳,ms */ + @JsonProperty("bind_time") + private Long bindTime; + + /** 用户拒绝时间戳,ms */ + @JsonProperty("reject_time") + private Long rejectTime; + + /** 商家取消时间戳,ms */ + @JsonProperty("cancel_time") + private Long cancelTime; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationListResponse.java new file mode 100644 index 0000000000..1b652b64d6 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationListResponse.java @@ -0,0 +1,25 @@ +package me.chanjar.weixin.channel.bean.cooperation; + +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 Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class CooperationListResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = 6998637882644598826L; + + /** 合作账号列表 */ + @JsonProperty("data_list") + private List dataList; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCode.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCode.java new file mode 100644 index 0000000000..272b9802da --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCode.java @@ -0,0 +1,23 @@ +package me.chanjar.weixin.channel.bean.cooperation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 合作账号二维码数据 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class CooperationQrCode implements Serializable { + + private static final long serialVersionUID = -7096916911986699150L; + + /** base64编码后的图片数据 */ + @JsonProperty("qrcode_base64") + private Integer qrCodeBase64; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCodeResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCodeResponse.java new file mode 100644 index 0000000000..b18b2b1c85 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCodeResponse.java @@ -0,0 +1,24 @@ +package me.chanjar.weixin.channel.bean.cooperation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; + +/** + * 合作账号二维码响应 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class CooperationQrCodeResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = 6998637882644598826L; + + /** 合作账号二维码 */ + @JsonProperty("data") + private CooperationQrCode data; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationSharerParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationSharerParam.java new file mode 100644 index 0000000000..4ca9bd8344 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationSharerParam.java @@ -0,0 +1,30 @@ +package me.chanjar.weixin.channel.bean.cooperation; + +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 Zeyes + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CooperationSharerParam implements Serializable { + + private static final long serialVersionUID = 5032621997764493109L; + + /** 合作账号id */ + @JsonProperty("sharer_id") + private String sharerId; + + /** 合作账号类型 */ + @JsonProperty("sharer_type") + private Integer sharerType; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatus.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatus.java new file mode 100644 index 0000000000..5267be6153 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatus.java @@ -0,0 +1,23 @@ +package me.chanjar.weixin.channel.bean.cooperation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 合作账号状态 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +public class CooperationStatus implements Serializable { + + private static final long serialVersionUID = -7096916911986699150L; + + /** 邀请/合作账号状态 1已绑定 2已解绑 3邀请已拒绝 4邀请接受中 5邀请接受超时 6邀请接受失败 7邀请店铺取消 */ + @JsonProperty("status") + private Integer status; + +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatusResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatusResponse.java new file mode 100644 index 0000000000..6507340c63 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatusResponse.java @@ -0,0 +1,24 @@ +package me.chanjar.weixin.channel.bean.cooperation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; + +/** + * 合作账号状态响应 + * + * @author Zeyes + */ +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class CooperationStatusResponse extends WxChannelBaseResponse { + + private static final long serialVersionUID = 6998637882644598826L; + + /** 合作账号状态 */ + @JsonProperty("data") + private CooperationStatus data; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/freight/ConditionFreeDetail.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/freight/ConditionFreeDetail.java index 68cb3b146e..cd0b76990d 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/freight/ConditionFreeDetail.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/freight/ConditionFreeDetail.java @@ -20,11 +20,11 @@ public class ConditionFreeDetail extends AddressInfoList { @JsonProperty("min_piece") private Integer minPiece; - /** 最低重量 */ + /** 最低重量,单位千克,订单商品总质量小于一千克,算作一千克 */ @JsonProperty("min_weight") private Double minWeight; - /** 最低金额 */ + /** 最低金额,单位(分) */ @JsonProperty("min_amount") private Integer minAmount; diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/league/supplier/SupplierFlowListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/league/supplier/SupplierFlowListResponse.java index 468985fe3e..d4a04af981 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/league/supplier/SupplierFlowListResponse.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/league/supplier/SupplierFlowListResponse.java @@ -9,8 +9,7 @@ /** * 资金流水列表 响应 * - * @author LiXiZe - * @since 2023-04-16 + * @author Zeyes */ @Data @NoArgsConstructor diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java index b1688cde5c..cad435df2b 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java @@ -93,18 +93,18 @@ public class OrderPriceInfo implements Serializable { * merchant_receieve_price=original_order_price-discounted_price-deduction_price-change_down_price */ @JsonProperty("merchant_receieve_price") - private Integer merchant_receive_price; + private Integer merchantReceivePrice; /** * 商家优惠金额,单位为分,含义同discounted_price,必填 */ @JsonProperty("merchant_discounted_price") - private Integer merchant_discounted_price; + private Integer merchantDiscountedPrice; /** * 达人优惠金额,单位为分 */ @JsonProperty("finder_discounted_price") - private Integer finder_discounted_price; + private Integer finderDiscountedPrice; } diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderProductInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderProductInfo.java index e7edeb8912..1e49455dc4 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderProductInfo.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderProductInfo.java @@ -168,4 +168,22 @@ public class OrderProductInfo implements Serializable { */ @JsonProperty("delivery_deadline") private Long deliveryDeadline; + + /** + * 商家优惠金额,单位为分 + */ + @JsonProperty("merchant_discounted_price") + private Integer merchantDiscountedPrice; + + /** + * 商家优惠金额,单位为分 + */ + @JsonProperty("finder_discounted_price") + private Integer finderDiscountedPrice; + + /** + * 是否赠品,非必填,赠品商品返回,1:是赠品 + */ + @JsonProperty("is_free_gift") + private Boolean freeGift; } diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java index 7b29194731..a160a31373 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java @@ -33,10 +33,18 @@ public class SpuInfo extends SpuSimpleInfo { @JsonProperty("head_imgs") private List headImgs; - /** 发货方式,若为无需快递(仅对部分类目开放),则无需填写运费模版id。0:快递发货;1:无需快递;默认0 */ + /** 发货方式:0-快递发货;1-无需快递,手机号发货;3-无需快递,可选发货账号类型,默认为0,若为无需快递,则无需填写运费模版id */ @JsonProperty("deliver_method") private Integer deliverMethod; + /** + * 发货账号:1-微信openid;2-QQ号;3-手机号;4-邮箱。 + * 可多选,只有deliver_method=3时,本参数有意义。 + * 且当发货账号为微信、QQ和邮箱时,需要更新订单接口读取详情字段,详情参考订单接口的说明 + */ + @JsonProperty("deliver_acct_type") + private List deliverAcctType; + /** 商品详情 */ @JsonProperty("desc_info") private DescriptionInfo descInfo; diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java index bee0263a25..0a945b1f35 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java @@ -22,6 +22,8 @@ public interface MessageEventConstants { String ORDER_CANCEL = "channels_ec_order_cancel"; /** 订单支付成功 */ String ORDER_PAY = "channels_ec_order_pay"; + /** 订单待发货 */ + String ORDER_WAIT_SHIPPING = "channels_ec_order_wait_shipping"; /** 订单发货 */ String ORDER_DELIVER = "channels_ec_order_deliver"; /** 订单确认收货 */ diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java index 35cb6d2140..e88f95e64b 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java @@ -316,6 +316,20 @@ public interface Share { String UNBIND_SHARER_URL = "https://api.weixin.qq.com/channels/ec/sharer/unbind"; } + /** 合作账号相关接口 */ + public interface Cooperation { + /** 获取合作账号列表 */ + String LIST_COOPERATION_URL = "https://api.weixin.qq.com/channels/ec/cooperation/list"; + /** 查看合作账号邀请状态 */ + String GET_COOPERATION_STATUS_URL = "https://api.weixin.qq.com/channels/ec/cooperation/invitation/get"; + /** 邀请合作账号 */ + String GENERATE_QRCODE_COOPERATION_URL = "https://api.weixin.qq.com/channels/ec/cooperation/invitation/qrcode/generate"; + /** 取消合作账号邀请 */ + String CANCEL_COOPERATION_URL = "https://api.weixin.qq.com/channels/ec/cooperation/invitation/cancel"; + /** 解绑合作账号 */ + String UNBIND_COOPERATION_URL = "https://api.weixin.qq.com/channels/ec/cooperation/unbind"; + } + /** 资金相关接口 */ public interface Fund { @@ -324,9 +338,9 @@ public interface Fund { /** 获取结算账户 */ String GET_BANK_ACCOUNT_URL = "https://api.weixin.qq.com/channels/ec/funds/getbankacct"; /** 获取资金流水详情 */ - String GET_BALANCE_FLOW_DETAIL_URL = "https://api.weixin.qq.com/channels/ec/league/funds/getfundsflowdetail"; + String GET_BALANCE_FLOW_DETAIL_URL = "https://api.weixin.qq.com/channels/ec/funds/getfundsflowdetail"; /** 获取资金流水列表 */ - String GET_BALANCE_FLOW_LIST_URL = "https://api.weixin.qq.com/channels/ec/league/funds/getfundsflowlist"; + String GET_BALANCE_FLOW_LIST_URL = "https://api.weixin.qq.com/channels/ec/funds/getfundsflowlist"; /** 获取提现记录 */ String GET_WITHDRAW_DETAIL_URL = "https://api.weixin.qq.com/channels/ec/funds/getwithdrawdetail"; /** 获取提现记录列表 */ @@ -526,4 +540,31 @@ public interface CompassFinder { */ String GET_SALE_PROFILE_DATA_URL = "https://api.weixin.qq.com/channels/ec/compass/finder/sale/profile/data/get"; } + + /** + * 罗盘商家版API + */ + public interface CompassShop { + + /** 获取电商数据概览 */ + String GET_SHOP_OVERALL_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/overall/get"; + /** 获取授权视频号列表 */ + String FINDER_AUTH_LIST_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/finder/authorization/list/get"; + /** 获取带货达人列表 */ + String FINDER_LIST_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/finder/list/get"; + /** 获取带货数据概览 */ + String GET_FINDER_OVERALL_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/finder/overall/get"; + /** 获取带货达人商品列表 */ + String GET_FINDER_PRODUCT_LIST_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/finder/product/list/get"; + /** 获取带货达人商品数据 */ + String GET_FINDER_PRODUCT_OVERALL_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/finder/product/overall/get"; + /** 获取店铺开播列表 */ + String GET_LIVE_LIST_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/live/list/get"; + /** 获取商品详细信息 */ + String GET_SHOP_PRODUCT_DATA_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/product/data/get"; + /** 获取商品列表 */ + String GET_SHOP_PRODUCT_LIST_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/product/list/get"; + /** 获取店铺人群数据 */ + String GET_SHOP_SALE_PROFILE_DATA_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/sale/profile/data/get"; + } } diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/FundsType.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/FundsType.java index ea3f8873ec..125e8c39c7 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/FundsType.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/FundsType.java @@ -24,12 +24,23 @@ public enum FundsType { /** 8 运费险分账 */ FREIGHT_SHARE(8, "运费险分账"), /** 9 联盟平台抽佣 */ - LEAGUE_COMMISSION(9, "联盟平台抽佣"), - /** 10 小店抽佣 */ - SHOP_COMMISSION(10, "小店抽佣"), + LEAGUE_PLAT_COMMISSION(9, "联盟平台抽佣"), + /** 10 联盟抽佣 */ + LEAGUE_COMMISSION(10, "联盟抽佣"), + /** 11台抽佣 */ + PLATFORM_COMMISSION(11, "平台抽佣"), + /** 12 团长抽佣 */ + LEADER_COMMISSION(12, "团长抽佣"), + /** 13 返佣人气卡 */ + POPULARITY_CARD(13, "返佣人气卡"), + /** 14 极速退款垫资金 */ + FAST_REFUND(14, "极速退款垫资金"), + /** 15 极速退款垫资回补 */ + FAST_REFUND_REPLENISHMENT(15, "极速退款垫资回补"), + /** 16 运费险 */ + FREIGHT_INSURANCE(16, "运费险"), /** 99 分账 */ SHARE(99, "分账"), - ; private final int key; diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PromoteType.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PromoteType.java index fa0bd60913..c1ba1a3561 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PromoteType.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PromoteType.java @@ -9,7 +9,14 @@ */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum PromoteType { - PROMOTE_TYPE_SHOP(1, "小店内推广"); + /** 1 小店内推广 */ + PROMOTE_TYPE_SHOP(1, "小店内推广"), + /** 9 会员券 */ + MEMBER(9, "会员券"), + /** 10 会员开卡礼券 */ + MEMBER_CARD(10, "会员开卡礼券"), + + ; private final int key; private final String val; diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SendTime.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SendTime.java index 85e4d4f0d6..9b5bc6e809 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SendTime.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SendTime.java @@ -23,7 +23,11 @@ public enum SendTime { TWENTYFOUR_HOUR("SendTime_TWENTYFOUR_HOUR", "24小时内发货"), /** 48小时内发货 */ FOUTYEIGHT_HOUR("SendTime_FOUTYEIGHT_HOUR", "48小时内发货"), - /** 3天内发货 */ + /** + * 3天内发货 + * @deprecated 已不支持,微信小店发货管理规则调整 + */ + @Deprecated THREE_DAY("SendTime_THREE_DAY", "3天内发货"), // /** 5天内发货 */ // FIVE_DAY("SendTime_FIVE_DAY", "5天内发货"), diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuEditStatus.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuEditStatus.java index 3d6063b8cf..71c71d5a26 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuEditStatus.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuEditStatus.java @@ -20,7 +20,13 @@ public enum SpuEditStatus { /** 4 审核成功 */ SUCCESS(4, "审核成功"), /** 5 商品信息写入中 */ - WRITING(5, "商品信息写入中"); + WRITING(5, "商品信息写入中"), + /** 7 商品异步提交,上传中(处于该状态的商品调用上架商品接口会返回10020067) */ + ASYNC_WRITING(7, "商品异步提交,上传中"), + /** 8 商品异步提交,上传失败(请重新提交) */ + ASYNC_FAIL(8, "商品异步提交,上传失败"), + + ; private final int status; private final String desc; diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuStatus.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuStatus.java index a74fee6b07..8f88d5ffac 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuStatus.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuStatus.java @@ -16,10 +16,20 @@ public enum SpuStatus { UP(5, "上架"), /** 6 回收站 */ TRASH(6, "回收站"), + /** 9 彻底删除,商品无法再进行任何操作 */ + DELETE(9, "彻底删除"), /** 11 自主下架 */ DOWN(11, "自主下架"), /** 13 违规下架/风控系统下架 */ - SYSTEM_DOWN(13, "违规下架"); + SYSTEM_DOWN(13, "违规下架/风控系统下架"), + /** 14 保证金不足下架 */ + DEPOSIT_INSUFFICIENT(14, "保证金不足下架"), + /** 15 品牌过期下架 */ + BRAND_EXPIRED(15, "品牌过期下架"), + /** 20 商品被封禁 */ + BAN(20, "商品被封禁"), + +; private final int status; private final String desc; diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImplTest.java new file mode 100644 index 0000000000..cae4d23067 --- /dev/null +++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImplTest.java @@ -0,0 +1,125 @@ +package me.chanjar.weixin.channel.api.impl; + +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +import com.google.inject.Inject; +import me.chanjar.weixin.channel.api.WxChannelCompassShopService; +import me.chanjar.weixin.channel.api.WxChannelService; +import me.chanjar.weixin.channel.bean.compass.shop.FinderAuthListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderOverallResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderProductListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.FinderProductOverallResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopLiveListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopOverallResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopProductDataResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopProductListResponse; +import me.chanjar.weixin.channel.bean.compass.shop.ShopSaleProfileDataResponse; +import me.chanjar.weixin.channel.test.ApiTestModule; +import me.chanjar.weixin.common.error.WxErrorException; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +/** + * @author Zeyes + */ +@Guice(modules = ApiTestModule.class) +public class WxChannelCompassShopServiceImplTest { + + @Inject + private WxChannelService channelService; + + @Test + public void testGetShopOverall() throws WxErrorException { + WxChannelCompassShopService service = channelService.getCompassShopService(); + String ds = "20240306"; + ShopOverallResponse response = service.getShopOverall(ds); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGetFinderAuthorizationList() throws WxErrorException { + WxChannelCompassShopService service = channelService.getCompassShopService(); + FinderAuthListResponse response = service.getFinderAuthorizationList(); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGetFinderList() throws WxErrorException { + WxChannelCompassShopService service = channelService.getCompassShopService(); + String ds = "20240306"; + FinderListResponse response = service.getFinderList(ds); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGetFinderOverall() throws WxErrorException { + WxChannelCompassShopService service = channelService.getCompassShopService(); + String ds = "20240306"; + FinderOverallResponse response = service.getFinderOverall(ds); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGetFinderProductList() throws WxErrorException { + WxChannelCompassShopService service = channelService.getCompassShopService(); + String ds = ""; + String finderId = ""; + FinderProductListResponse response = service.getFinderProductList(ds, finderId); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGetFinderProductOverall() throws WxErrorException { + WxChannelCompassShopService service = channelService.getCompassShopService(); + String ds = ""; + String finderId = ""; + FinderProductOverallResponse response = service.getFinderProductOverall(ds, finderId); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGetShopLiveList() throws WxErrorException { + WxChannelCompassShopService service = channelService.getCompassShopService(); + String ds = ""; + String finderId = ""; + ShopLiveListResponse response = service.getShopLiveList(ds, finderId); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGetShopProductData() throws WxErrorException { + WxChannelCompassShopService service = channelService.getCompassShopService(); + String ds = "20240306"; + String productId = ""; + ShopProductDataResponse response = service.getShopProductData(ds, productId); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGetShopProductList() throws WxErrorException { + WxChannelCompassShopService service = channelService.getCompassShopService(); + String ds = "20240306"; + ShopProductListResponse response = service.getShopProductList(ds); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGetShopSaleProfileData() throws WxErrorException { + WxChannelCompassShopService service = channelService.getCompassShopService(); + String ds = "20240306"; + ShopSaleProfileDataResponse response = service.getShopSaleProfileData(ds, 3); + assertNotNull(response); + assertTrue(response.isSuccess()); + } +} diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImplTest.java new file mode 100644 index 0000000000..bf70ce3c78 --- /dev/null +++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImplTest.java @@ -0,0 +1,66 @@ +package me.chanjar.weixin.channel.api.impl; + +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +import com.google.inject.Inject; +import me.chanjar.weixin.channel.api.WxChannelService; +import me.chanjar.weixin.channel.api.WxStoreCooperationService; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; +import me.chanjar.weixin.channel.test.ApiTestModule; +import me.chanjar.weixin.channel.util.JsonUtils; +import me.chanjar.weixin.common.error.WxErrorException; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +/** + * @author Zeyes + */ +@Guice(modules = ApiTestModule.class) +public class WxStoreCooperationServiceImplTest { + + @Inject + private WxChannelService channelService; + + @Test + public void testListCooperation() throws WxErrorException { + WxStoreCooperationService service = channelService.getCooperationService(); + Integer sharerType = 3; + WxChannelBaseResponse response = service.listCooperation(sharerType); + assertNotNull(response); + assertTrue(response.isSuccess()); + System.out.println(JsonUtils.encode(response)); + } + + @Test + public void testGetCooperationStatus() throws WxErrorException { + WxStoreCooperationService service = channelService.getCooperationService(); + WxChannelBaseResponse response = service.getCooperationStatus("sph3FZbOEY64mWQ", 2); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGenerateQrCode() throws WxErrorException { + WxStoreCooperationService service = channelService.getCooperationService(); + WxChannelBaseResponse response = service.generateQrCode("sph3FZbOEY64mWQ", 2); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testCancelInvitation() throws WxErrorException { + WxStoreCooperationService service = channelService.getCooperationService(); + WxChannelBaseResponse response = service.cancelInvitation("sph3FZbOEY64mWQ", 2); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testUnbind() throws WxErrorException { + WxStoreCooperationService service = channelService.getCooperationService(); + WxChannelBaseResponse response = service.unbind("sph3FZbOEY64mWQ", 2); + assertNotNull(response); + assertTrue(response.isSuccess()); + } +} diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterRuleTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterRuleTest.java index d1e2f72174..bff360f7cc 100644 --- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterRuleTest.java +++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterRuleTest.java @@ -6,8 +6,7 @@ import org.testng.annotations.Test; /** - * @author LiXiZe - * @since 2023-04-20 + * @author Zeyes */ public class WxChannelMessageRouterRuleTest { diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java index 4c39d45382..9d683edce6 100644 --- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java +++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java @@ -22,8 +22,7 @@ import org.testng.annotations.Test; /** - * @author LiXiZe - * @since 2023-04-21 + * @author Zeyes */ @Slf4j @Guice(modules = ApiTestModule.class)