fix(chaoxing): support multiple uploadDate formats#2545
Merged
xrgzs merged 3 commits intoMay 31, 2026
Conversation
Signed-off-by: yuxiaoyu8192 <103018181+yuxiaoyu8192@users.noreply.github.com>
代码格式化 Signed-off-by: yuxiaoyu8192 <103018181+yuxiaoyu8192@users.noreply.github.com>
xrgzs
reviewed
May 31, 2026
时间解析失败返回空 Signed-off-by: yuxiaoyu8192 <103018181+yuxiaoyu8192@users.noreply.github.com>
xrgzs
approved these changes
May 31, 2026
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.
Summary / 摘要
修复超星小组盘驱动在解析不同来源文件时的
uploadDate字段兼容性问题。超星 API在不同场景下返回三种不同格式的时间戳,导致 JSON 解析失败。
问题:
1780191356415"1780191356415""2024-11-06 07:49"解决方案:
增强
int64_str类型的UnmarshalJSON方法,支持三种格式的智能解析,统一输出毫秒时间戳。修改内容:
int64_str.UnmarshalJSON()方法,添加日期字符串解析逻辑File.Content.UploadDate字段类型为int64_strfileToObj()函数的类型转换用户可见变化:
✅ 修复文件列表拉取失败的问题
✅ 支持手机端和网页端上传的所有文件
✅ 兼容历史遗留数据
This PR has breaking changes.
This PR changes public API, config, storage format, or migration behavior.
This PR requires corresponding changes in related repositories.
Related repository PRs / 关联仓库 PR:
Related Issues / 关联 Issue
Fixes # (如果有相关 issue,请填写编号)
Testing / 测试
测试环境:
834df21c-2a65-49b8-a30c-71e36aeaca52测试结果:
测试数据:
文件 1: uploadDate: 1780191356415 (数字) ✅
文件 2: uploadDate: "2024-11-06 07:49" (字符串) ✅
go test ./...(未添加单元测试,但已通过真实 API 测试)Checklist / 检查清单
gofmt,go fmt, orprettierwhere applicable.AI Disclosure / AI 使用声明
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Documentation / 文档
Tests / 测试
Review assistance / 审查辅助
I have reviewed and validated all AI-assisted content included in this PR.
I have ensured that all AI-assisted commits include
Co-Authored-Byattribution.I can reproduce all AI-assisted content included in this PR without any AI tools.
AI 使用详情:
int64_str类型的UnmarshalJSON方法增强