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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user