feat(openflare): Pages 部署包改用 upload 本地文件存储框架

通过 upload.Ingest 摄取 zip 部署包并记录 upload_id,删除部署时调用
upload.Remove;Agent 下载改为 OpenDeploymentPackage 从存储后端流式输出。
新增 of_pages_deployments.upload_id 迁移,保留 artifact_path 兼容旧数据。
This commit is contained in:
ryan
2026-06-18 19:52:59 +08:00
parent 9ac5ff6925
commit 29176da35f
8 changed files with 247 additions and 77 deletions
@@ -137,13 +137,17 @@ func DownloadPagesPackageHandler(c *gin.Context) {
if !ok {
return
}
filePath, fileName, err := pages.GetDeploymentPackagePath(c.Request.Context(), deploymentID)
packageObj, fileName, err := pages.OpenDeploymentPackage(c.Request.Context(), deploymentID)
if err != nil {
compat.Fail(c, err.Error())
return
}
defer packageObj.Body.Close()
c.Header("Content-Disposition", "attachment; filename="+fileName)
c.File(filePath)
if packageObj.ContentType != "" {
c.Header("Content-Type", packageObj.ContentType)
}
c.DataFromReader(http.StatusOK, packageObj.ContentLength, packageObj.ContentType, packageObj.Body, nil)
}
func pagesDeploymentIDParam(c *gin.Context) (uint, bool) {