feat: auto-generate full package when uploading patch

- Add FullPackagePath, FullPackageSize, FullPackageHash to Version model
- When uploading patch, merge with base full package to create new full package
- Check update API returns full package info for download
- Add package_util.go with merge functions

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 11:43:58 +08:00
parent fd98c0dcc4
commit 551f4f1576
4 changed files with 217 additions and 22 deletions
+13 -3
View File
@@ -216,8 +216,18 @@ func handleAppCheckUpdate(c *gin.Context) {
}
}
// 确定下载地址:优先使用自定义地址
// 确定下载地址:优先使用完整包地址,其次自定义地址
downloadURL := latestVersion.FilePath
downloadSize := latestVersion.FileSize
downloadHash := latestVersion.FileHash
// 使用完整包地址(如果有)
if latestVersion.FullPackagePath != "" {
downloadURL = latestVersion.FullPackagePath
downloadSize = latestVersion.FullPackageSize
downloadHash = latestVersion.FullPackageHash
}
// 自定义地址优先级最高
if latestVersion.CustomDownloadURL != "" {
downloadURL = latestVersion.CustomDownloadURL
}
@@ -228,8 +238,8 @@ func handleAppCheckUpdate(c *gin.Context) {
"current_version": clientVersion,
"latest_version": latestVersion.Version,
"download_url": downloadURL,
"file_size": latestVersion.FileSize,
"file_hash": latestVersion.FileHash,
"file_size": downloadSize,
"file_hash": downloadHash,
"entry_file": latestVersion.EntryFile,
"update_notes": latestVersion.Description,
"update_strategy": updateStrategy,