fix: upload ai table exports to oss

This commit is contained in:
richjohnrambo
2026-09-29 16:50:36 +08:00
parent 9cb8c4d93a
commit 192ab342f6
7 changed files with 220 additions and 10 deletions
+8 -4
View File
@@ -443,11 +443,15 @@ func (a *API) aiTableAnalysisResource(w http.ResponseWriter, r *http.Request, p
writeStoreError(w, r, err)
return
}
fileName := aiTableExportFileName(item)
file, err := a.uploadAITableAnalysisExport(r.Context(), r, st, p, item)
if err != nil {
writeError(w, r, http.StatusServiceUnavailable, 30053, reasonAIProviderFailed, "ai export storage failed", nil)
return
}
writeSuccess(w, r, map[string]any{
"file_id": "ai_export_" + recordID,
"file_name": fileName,
"download_url": absoluteURL(r, "/v1/workbench/ai/table-analyses/"+recordID+"/export/download?format=docx"),
"file_id": file.FileID,
"file_name": file.FileName,
"download_url": file.DownloadURL,
"expires_at": time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339Nano),
})
return