fix: upload ai table exports to oss
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user