feat(channel): 新增微信小店质检管理(QIC)5个官方接口支持#4039
Conversation
|
@codex auggie review |
| public SubmitConfigResponse getSubmitConfig(String orderId) throws WxErrorException { | ||
| String queryParam = StringUtils.isBlank(orderId) ? "" : "order_id=" + orderId; | ||
| String respJson = shopService.get(GET_SUBMIT_CONFIG_URL, queryParam); | ||
| return ResponseUtils.decode(respJson, SubmitConfigResponse.class); | ||
| } |
| public static class DataPayload implements Serializable { | ||
| private static final long serialVersionUID = 684071509005627272L; | ||
|
|
||
| @JsonProperty("backupDeliveryId") | ||
| private String backupDeliveryId; | ||
|
|
||
| @JsonProperty("backupDeliveryName") | ||
| private String backupDeliveryName; | ||
|
|
||
| @JsonProperty("boxDTOList") | ||
| private List<BoxInfo> boxInfoList; |
🤖 Augment PR SummarySummary: This PR adds “质检管理(QIC)” support to Changes:
Technical Notes: Requests are executed through 🤖 Was this summary useful? React with 👍 or 👎 |
|
|
||
| @Override | ||
| public SubmitConfigResponse getSubmitConfig(String orderId) throws WxErrorException { | ||
| String queryParam = StringUtils.isBlank(orderId) ? "" : "order_id=" + orderId; |
There was a problem hiding this comment.
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelQicServiceImpl.java:41 — When orderId is blank this sets queryParam to ""; because BaseWxChannelServiceImpl already appends ?access_token=..., the GET executor will append an extra trailing & (e.g. ...access_token=...&). Consider passing null when no optional params are present so the final request URL isn't malformed/ambiguous.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0748aa9f0f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| public static class DataPayload implements Serializable { | ||
| private static final long serialVersionUID = 684071509005627272L; | ||
|
|
||
| @JsonProperty("backupDeliveryId") |
There was a problem hiding this comment.
Map inspect-code fields to the API payload names
The print-inspect-code response DTO starts annotating every returned field with camelCase names such as backupDeliveryId/boxDTOList, unlike the QIC API payload naming used by the other new DTOs. When WeChat returns the documented snake_case response fields, Jackson will silently leave these properties null, so a successful printInspectCode call won't expose the inspection code details to callers. Please align these @JsonProperty values with the actual response field names.
Useful? React with 👍 / 👎.
当前
weixin-java-channel缺少质检管理能力,无法覆盖珠宝/奢侈品等需送检场景。该 PR 按微信官方 QIC 文档补齐 5 个接口,并将能力接入WxChannelService主服务入口。接口层:新增质检服务抽象与入口接入
WxChannelQicService,提供以下能力:getInspectConfig()getSubmitConfig(String orderId)/getSubmitConfig()printInspectCode(String orderId)submitInspectInfo(SubmitInspectRequest)registerLogistics(RegisterLogisticsRequest)WxChannelService增加getQicService(),并在BaseWxChannelServiceImpl中完成懒加载注入。实现层:新增 QIC 服务实现与官方路径常量
WxChannelQicServiceImpl,按官方路径调用:/channels/ec/qic/inspect/config/get/channels/ec/qic/inspect/submitconfig/get/channels/ec/qic/inspect/code/print/channels/ec/qic/inspect/submit/channels/ec/qic/inspect/register_logisticsWxChannelApiUrlConstants中新增Qic常量分组,集中维护路径。数据模型:补齐请求/响应对象并对齐官方字段
InspectConfigResponseSubmitConfigResponseInspectCodeResponseSubmitInspectRequestRegisterLogisticsRequest测试:新增质检服务单元测试
WxChannelQicServiceImplTest,覆盖 5 个接口的调用入口与核心请求对象构造。示例(新增服务调用方式):