fix: 支持长整型企业微信应用ID - #4079
Conversation
🤖 Augment PR SummarySummary: 本 PR 主要为企业微信(CP)应用 AgentId 增加对超出 Changes:
Technical Notes: 该改动涉及对外公共 API(接口方法签名)变更,可能影响下游编译与序列化/反序列化链路,需要关注兼容性与迁移说明。 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c1018e2f3
ℹ️ 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".
代码审查(事后复审,PR 已合并)结论:把 P1-1 Solon 插件未同步,未配置 agentId 时启动直接 NPE
两处仍是 触发条件:使用通讯录同步 Secret、不配置 同时,Solon 用户依然无法配置超出 int 范围的 建议:
P1-2 回调路由仍按 Integer 解析 agentid
(this.agentId == null || this.agentId.equals(Integer.valueOf(wxMessage.getAgentId())))规则的 P2-3 其余 agentId 仍为 Integer,第三方/服务商链路会溢出PR 描述提到「第三方服务商可通过 获取企业授权信息 获取 agentid」,但对应响应 Bean 未改:
其中响应 Bean 的影响最直接:Gson 把超过 P2-4 本 PR 夹带了与 agentId 无关的变更分支中包含 顺带指出 P3-5 回归测试覆盖偏薄
另外 |
修改内容
agentId的核心配置、Spring Boot 单账号/多账号属性及默认调用链由Integer调整为Long。wx.cp.agent-id,例如1013699173317。agentId的调用路径,并补充回归用例。根因
Spring Boot 配置属性与 CP 核心配置均使用
Integer,导致超出 32 位范围的agentId在应用启动绑定配置时抛出NumberFormatException。影响
CP 模块
agentId相关公开 API 改为Long,属于不保持二进制兼容的类型调整。验证
mvn -pl weixin-java-cp -am -Dtest=WxCpDefaultConfigImplTest -Dsurefire.failIfNoSpecifiedTests=false testmvn -pl weixin-java-cp,spring-boot-starters/wx-java-cp-spring-boot-starter,spring-boot-starters/wx-java-cp-multi-spring-boot-starter -am -Dmaven.test.skip=true packageCloses #4077