Skip to content

feat(miniapp): 新增 URL Link 二维码快速跳转规则管理服务#4040

Open
Copilot wants to merge 2 commits into
developfrom
copilot/add-qrcode-jump-management-methods
Open

feat(miniapp): 新增 URL Link 二维码快速跳转规则管理服务#4040
Copilot wants to merge 2 commits into
developfrom
copilot/add-qrcode-jump-management-methods

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 31, 2026

本次改动延续分支任务,补齐小程序 URL Link 二维码快速跳转规则管理能力。目标是将官方 wxaqrcodefast 相关接口在 miniapp SDK 中完整落地,包含服务入口、请求/响应模型与调用实现。

  • 接口能力补齐(服务层)

    • 新增 WxMaQrcodeJumpService,提供:
      • addRule
      • getRules
      • getRuleList
      • deleteRule
    • 新增实现 WxMaQrcodeJumpServiceImpl,对接官方快速跳转规则管理接口。
  • SDK 主服务集成

    • WxMaService 增加 getQrcodeJumpService()
    • BaseWxMaServiceImpl 挂载 qrcodeJumpService 实例并暴露 getter,保持与现有 service 获取模式一致。
  • API 常量与数据模型

    • WxMaApiUrlConstants 增加 QrcodeJump 常量组:
      • QRCODE_JUMP_ADD
      • QRCODE_JUMP_GET
      • QRCODE_JUMP_GET_LIST
      • QRCODE_JUMP_DELETE
    • 新增模型:
      • WxMaQrcodeJumpRule
      • WxMaQrcodeJumpWxaItem
      • WxMaQrcodeJumpRuleListResponse
  • 单元测试

    • 新增 WxMaQrcodeJumpServiceImplTest,覆盖:
      • 规则新增
      • 规则查询
      • 分页查询(含空结果场景)
      • 规则删除
    • 重点校验请求路径常量与关键请求体字段序列化结果。
WxMaQrcodeJumpService jumpService = wxMaService.getQrcodeJumpService();
List<WxMaQrcodeJumpRule> rules = jumpService.getRuleList(1, 1, 20);
jumpService.deleteRule("/pages/index");

Copilot AI changed the title [WIP] Add qrcode jump management methods to WxMpQrcodeService feat(miniapp): 新增 URL Link 二维码快速跳转规则管理服务 Jun 1, 2026
@binarywang binarywang marked this pull request as ready for review June 1, 2026 01:54
Copilot AI review requested due to automatic review settings June 1, 2026 01:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

本次 PR 为 weixin-java-miniapp 补齐小程序「URL Link 二维码快速跳转规则管理(wxaqrcodefast)」能力,新增独立服务入口、对应请求/响应模型、API URL 常量,并在主服务中挂载该能力,同时新增单元测试覆盖核心调用与序列化。

Changes:

  • 新增 WxMaQrcodeJumpService 及其实现 WxMaQrcodeJumpServiceImpl,封装规则新增/查询/分页/删除接口调用。
  • WxMaServiceBaseWxMaServiceImpl 中集成并暴露 getQrcodeJumpService()
  • 新增 URL 常量组 WxMaApiUrlConstants.QrcodeJump 与相关数据模型、并增加对应单元测试。

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaQrcodeJumpService.java 定义 URL Link 二维码快速跳转规则管理的服务接口
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaQrcodeJumpServiceImpl.java 实现规则管理接口调用与响应解析
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java 主服务接口新增 getQrcodeJumpService() 入口
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java 基础实现挂载并返回 qrcodeJumpService 实例
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java 新增 QrcodeJump API URL 常量组
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/qrcode/WxMaQrcodeJumpRule.java 新增跳转规则模型
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/qrcode/WxMaQrcodeJumpWxaItem.java 新增测试/体验版可跳转小程序信息模型
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/qrcode/WxMaQrcodeJumpRuleListResponse.java 新增规则列表响应承载模型
weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaQrcodeJumpServiceImplTest.java 新增单元测试覆盖新增/查询/分页/删除与关键请求体序列化

Comment on lines +3 to +23
import cn.binarywang.wx.miniapp.api.WxMaQrcodeJumpService;
import cn.binarywang.wx.miniapp.bean.qrcode.WxMaQrcodeJumpRule;
import cn.binarywang.wx.miniapp.bean.qrcode.WxMaQrcodeJumpRuleListResponse;
import com.google.gson.JsonObject;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.error.WxErrorException;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.QrcodeJump.*;
import static me.chanjar.weixin.common.util.json.WxGsonBuilder.create;

/**
* {@link WxMaQrcodeJumpService} 实现。
*/
@RequiredArgsConstructor
public class WxMaQrcodeJumpServiceImpl implements WxMaQrcodeJumpService {
private final BaseWxMaServiceImpl wxMaService;
Comment on lines +26 to +33
private BaseWxMaServiceImpl wxMaService;
private WxMaQrcodeJumpService qrcodeJumpService;

@BeforeMethod
public void setUp() {
this.wxMaService = mock(BaseWxMaServiceImpl.class);
this.qrcodeJumpService = new WxMaQrcodeJumpServiceImpl(this.wxMaService);
}
Comment on lines +55 to +56
@SerializedName("is_expire")
private Boolean expire;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[weixin-java-mp] 服务号二维码跳转管理接口缺失 (qrcodejump get/add/publish/delete)

3 participants