forked from binarywang/WxJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,870 additions
and
1 deletion.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxAssistantService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package me.chanjar.weixin.channel.api; | ||
|
||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; | ||
import me.chanjar.weixin.channel.bean.window.request.AddWindowProductRequest; | ||
import me.chanjar.weixin.channel.bean.window.request.GetWindowProductListRequest; | ||
import me.chanjar.weixin.channel.bean.window.request.WindowProductRequest; | ||
import me.chanjar.weixin.channel.bean.window.response.GetWindowProductListResponse; | ||
import me.chanjar.weixin.channel.bean.window.response.GetWindowProductResponse; | ||
import me.chanjar.weixin.common.error.WxErrorException; | ||
|
||
/** | ||
* 视频号助手 橱窗管理服务 <br/> | ||
* 关于橱窗商品ID的说明: <br/> | ||
* 不支持带货中心来源的商品,其余商品的橱窗商品ID与商品来源处的平台内部商品ID相同,对应关系如下 <br/> | ||
* <pre> | ||
* 商品来源 橱窗ID说明 | ||
* 视频号小店 视频号小店商品的 product_id 字段 | ||
* 交易组件 组件商品的 product_id 字段 | ||
* </pre> | ||
* | ||
* @author <a href="https://github.com/imyzt">imyzt</a> | ||
*/ | ||
public interface WxAssistantService { | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/windowproduct/add.html">上架商品到橱窗</a> | ||
* @param req 商品信息 | ||
* @return 操作结果 | ||
*/ | ||
WxChannelBaseResponse addWindowProduct(AddWindowProductRequest req) throws WxErrorException; | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/windowproduct/get.html">获取橱窗商品详情</a> | ||
* | ||
* @param req 商品信息 | ||
* @return 橱窗商品详情 | ||
*/ | ||
GetWindowProductResponse getWindowProduct(WindowProductRequest req) throws WxErrorException; | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/windowproduct/list_get.html">获取已添加到橱窗的商品列表</a> | ||
* 接口限制了 page_size × page_index ≤ 10000。命中限制时建议改用传last_buffer顺序翻页的请求方式 | ||
* @param req 商品信息 | ||
* @return 已添加到橱窗的商品列表 | ||
*/ | ||
GetWindowProductListResponse getWindowProductList(GetWindowProductListRequest req) throws WxErrorException; | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/windowproduct/off.html">下架橱窗商品</a> | ||
* @param req 商品信息 | ||
* @return 操作结果 | ||
*/ | ||
WxChannelBaseResponse offWindowProduct(WindowProductRequest req) throws WxErrorException; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxFinderLiveService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package me.chanjar.weixin.channel.api; | ||
|
||
import me.chanjar.weixin.channel.bean.lead.component.request.GetFinderLiveDataListRequest; | ||
import me.chanjar.weixin.channel.bean.lead.component.request.GetFinderLiveLeadsDataRequest; | ||
import me.chanjar.weixin.channel.bean.lead.component.response.FinderAttrResponse; | ||
import me.chanjar.weixin.channel.bean.lead.component.response.GetFinderLiveDataListResponse; | ||
import me.chanjar.weixin.channel.bean.lead.component.response.GetFinderLiveLeadsDataResponse; | ||
import me.chanjar.weixin.common.error.WxErrorException; | ||
|
||
/** | ||
* 视频号助手 留资服务的直播数据服务 | ||
* | ||
* @author <a href="https://github.com/imyzt">imyzt</a> | ||
*/ | ||
public interface WxFinderLiveService { | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/live/get_finder_attr_by_appid.html">获取视频号账号信息</a> | ||
* | ||
* @return 视频号账号信息 | ||
*/ | ||
FinderAttrResponse getFinderAttrByAppid() throws WxErrorException; | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/live/get_finder_live_data_list.html">获取留资直播间数据详情</a> | ||
* | ||
* @param req 留资组件信息 | ||
* @return 留资信息详情 | ||
*/ | ||
GetFinderLiveDataListResponse getFinderLiveDataList(GetFinderLiveDataListRequest req) throws WxErrorException; | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/live/get_finder_live_leads_data.html">获取账号收集的留资数量</a> | ||
* 说明:该接口只统计2023.9.13号起的数据,所以start_time应大于等于1694534400 | ||
* | ||
* @param req 留资组件信息 | ||
* @return 留资信息列表 | ||
*/ | ||
GetFinderLiveLeadsDataResponse getFinderLiveLeadsData(GetFinderLiveLeadsDataRequest req) throws WxErrorException; | ||
|
||
} |
60 changes: 60 additions & 0 deletions
60
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxLeadComponentService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package me.chanjar.weixin.channel.api; | ||
|
||
import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadInfoByComponentRequest; | ||
import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsComponentIdRequest; | ||
import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsComponentPromoteRecordRequest; | ||
import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsInfoByRequestIdRequest; | ||
import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsRequestIdRequest; | ||
import me.chanjar.weixin.channel.bean.lead.component.response.GetLeadsComponentIdResponse; | ||
import me.chanjar.weixin.channel.bean.lead.component.response.GetLeadsComponentPromoteRecordResponse; | ||
import me.chanjar.weixin.channel.bean.lead.component.response.GetLeadsRequestIdResponse; | ||
import me.chanjar.weixin.channel.bean.lead.component.response.LeadInfoResponse; | ||
import me.chanjar.weixin.common.error.WxErrorException; | ||
|
||
/** | ||
* 视频号助手 留资组件管理服务 | ||
* | ||
* @author <a href="https://github.com/imyzt">imyzt</a> | ||
*/ | ||
public interface WxLeadComponentService { | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/leads/get_leads_info_by_component_id.html">按时间获取留资信息详情</a> | ||
* | ||
* @param req 留资组件信息 | ||
* @return 留资信息详情 | ||
*/ | ||
LeadInfoResponse getLeadsInfoByComponentId(GetLeadInfoByComponentRequest req) throws WxErrorException; | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/leads/get_leads_info_by_request_id.html">按直播场次获取留资信息详情</a> | ||
* | ||
* @param req 留资组件信息 | ||
* @return 留资信息详情 | ||
*/ | ||
LeadInfoResponse getLeadsInfoByRequestId(GetLeadsInfoByRequestIdRequest req) throws WxErrorException; | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/leads/get_leads_request_id.html">获取留资request_id列表详情</a> | ||
* | ||
* @param req 留资组件信息 | ||
* @return 留资信息列表 | ||
*/ | ||
GetLeadsRequestIdResponse getLeadsRequestId(GetLeadsRequestIdRequest req) throws WxErrorException; | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/leads/get_leads_component_promote_record.html">获取留资组件直播推广记录信息详情</a> | ||
* | ||
* @param req 留资组件信息 | ||
* @return 留资组件直播推广记录信息详情 | ||
*/ | ||
GetLeadsComponentPromoteRecordResponse getLeadsComponentPromoteRecord(GetLeadsComponentPromoteRecordRequest req) throws WxErrorException; | ||
|
||
/** | ||
* <a href="https://developers.weixin.qq.com/doc/channels/API/leads/get_leads_component_id.html">获取留资组件Id列表详情</a> | ||
* | ||
* @param req 留资组件信息 | ||
* @return 留资组件Id列表 | ||
*/ | ||
GetLeadsComponentIdResponse getLeadsComponentId(GetLeadsComponentIdRequest req) throws WxErrorException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxAssistantServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package me.chanjar.weixin.channel.api.impl; | ||
|
||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import me.chanjar.weixin.channel.api.WxAssistantService; | ||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; | ||
import me.chanjar.weixin.channel.bean.window.request.AddWindowProductRequest; | ||
import me.chanjar.weixin.channel.bean.window.request.GetWindowProductListRequest; | ||
import me.chanjar.weixin.channel.bean.window.request.WindowProductRequest; | ||
import me.chanjar.weixin.channel.bean.window.response.GetWindowProductListResponse; | ||
import me.chanjar.weixin.channel.bean.window.response.GetWindowProductResponse; | ||
import me.chanjar.weixin.channel.util.ResponseUtils; | ||
import me.chanjar.weixin.common.error.WxErrorException; | ||
|
||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Assistant.ADD_WINDOW_PRODUCT_URL; | ||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Assistant.GET_WINDOW_PRODUCT_URL; | ||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Assistant.LIST_WINDOW_PRODUCT_URL; | ||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Assistant.OFF_WINDOW_PRODUCT_URL; | ||
|
||
/** | ||
* 视频号助手 橱窗管理服务 | ||
* | ||
* @author <a href="https://github.com/imyzt">imyzt</a> | ||
*/ | ||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class WxAssistantServiceImpl implements WxAssistantService { | ||
|
||
/** 微信商店服务 */ | ||
private final BaseWxChannelServiceImpl shopService; | ||
@Override | ||
public WxChannelBaseResponse addWindowProduct(AddWindowProductRequest req) throws WxErrorException { | ||
String resJson = shopService.post(ADD_WINDOW_PRODUCT_URL, "{}"); | ||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
} | ||
|
||
@Override | ||
public GetWindowProductResponse getWindowProduct(WindowProductRequest req) throws WxErrorException { | ||
String resJson = shopService.post(GET_WINDOW_PRODUCT_URL, "{}"); | ||
return ResponseUtils.decode(resJson, GetWindowProductResponse.class); | ||
} | ||
|
||
@Override | ||
public GetWindowProductListResponse getWindowProductList(GetWindowProductListRequest req) throws WxErrorException { | ||
String resJson = shopService.post(LIST_WINDOW_PRODUCT_URL, "{}"); | ||
return ResponseUtils.decode(resJson, GetWindowProductListResponse.class); | ||
} | ||
|
||
@Override | ||
public WxChannelBaseResponse offWindowProduct(WindowProductRequest req) throws WxErrorException { | ||
String resJson = shopService.post(OFF_WINDOW_PRODUCT_URL, "{}"); | ||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...ava-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxFinderLiveServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package me.chanjar.weixin.channel.api.impl; | ||
|
||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import me.chanjar.weixin.channel.api.WxFinderLiveService; | ||
import me.chanjar.weixin.channel.bean.lead.component.request.GetFinderLiveDataListRequest; | ||
import me.chanjar.weixin.channel.bean.lead.component.request.GetFinderLiveLeadsDataRequest; | ||
import me.chanjar.weixin.channel.bean.lead.component.response.FinderAttrResponse; | ||
import me.chanjar.weixin.channel.bean.lead.component.response.GetFinderLiveDataListResponse; | ||
import me.chanjar.weixin.channel.bean.lead.component.response.GetFinderLiveLeadsDataResponse; | ||
import me.chanjar.weixin.channel.util.ResponseUtils; | ||
import me.chanjar.weixin.common.error.WxErrorException; | ||
|
||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.FinderLive.GET_FINDER_ATTR_BY_APPID; | ||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.FinderLive.GET_FINDER_LIVE_DATA_LIST; | ||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.FinderLive.GET_FINDER_LIVE_LEADS_DATA; | ||
|
||
/** | ||
* 视频号助手 留资服务的直播数据服务 | ||
* @author imyzt | ||
* @date 2024/01/27 | ||
*/ | ||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class WxFinderLiveServiceImpl implements WxFinderLiveService { | ||
|
||
/** 微信商店服务 */ | ||
private final BaseWxChannelServiceImpl shopService; | ||
@Override | ||
public FinderAttrResponse getFinderAttrByAppid() throws WxErrorException { | ||
String resJson = shopService.post(GET_FINDER_ATTR_BY_APPID, "{}"); | ||
return ResponseUtils.decode(resJson, FinderAttrResponse.class); | ||
} | ||
|
||
@Override | ||
public GetFinderLiveDataListResponse getFinderLiveDataList(GetFinderLiveDataListRequest req) throws WxErrorException { | ||
String resJson = shopService.post(GET_FINDER_LIVE_DATA_LIST, req); | ||
return ResponseUtils.decode(resJson, GetFinderLiveDataListResponse.class); | ||
} | ||
|
||
@Override | ||
public GetFinderLiveLeadsDataResponse getFinderLiveLeadsData(GetFinderLiveLeadsDataRequest req) throws WxErrorException { | ||
String resJson = shopService.post(GET_FINDER_LIVE_LEADS_DATA, req); | ||
return ResponseUtils.decode(resJson, GetFinderLiveLeadsDataResponse.class); | ||
} | ||
} |
Oops, something went wrong.