Fix DateRange control config mapping in weixin-java-cp approval template#3897
Merged
binarywang merged 2 commits intodevelopfrom Mar 3, 2026
Merged
Fix DateRange control config mapping in weixin-java-cp approval template#3897binarywang merged 2 commits intodevelopfrom
binarywang merged 2 commits intodevelopfrom
Conversation
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix inconsistent properties for DateRange control in workflow template
Fix DateRange control config mapping in weixin-java-cp approval template
Mar 3, 2026
There was a problem hiding this comment.
Pull request overview
该 PR 修复了企业微信 OA 审批模板中 DateRange(时长)控件的 config.date_range 反序列化映射缺失问题,并补齐了 date_range 配置里与实际 API 返回一致的字段,避免反序列化时字段被静默丢弃。
Changes:
- 为
TemplateConfig增加dateRange(date_range)字段以正确承载DateRange控件配置 - 为
TemplateDateRange补充officialHoliday(official_holiday)与perdayDuration(perday_duration)字段 - 同步更新
WxCpOaApprovalTemplateResult.TemplateConfig内部类的dateRange字段与相关 import
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateDateRange.java | 补齐 date_range 配置缺失字段并添加 Gson 映射注解 |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateConfig.java | 将 date_range 映射提升到 TemplateConfig,并更新 Javadoc 列表 |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplateResult.java | 同步内部 TemplateConfig 的 date_range 字段映射,避免结果对象丢字段 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
DateRangecontrol'sconfig.date_rangewas not mapped inTemplateConfig— it existed only insideTemplateAttendance, causing the fields to be silently dropped during deserialization. Additionally,TemplateDateRangewas missingofficial_holidayandperday_durationfields present in the actual API response.Changes
TemplateDateRange— addofficialHoliday(official_holiday) andperdayDuration(perday_duration) fieldsTemplateConfig(templatedata package) — adddateRange(date_range) field; update Javadoc to mentionDateRangeWxCpOaApprovalTemplateResult.TemplateConfig(inner class) — add samedateRangefield + importAPI response shape now correctly mapped
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.