add ocr pipeline

This commit is contained in:
m
2026-09-15 23:52:19 +02:00
parent 102cc425b9
commit 050434325a
21 changed files with 1028 additions and 17 deletions
+8 -1
View File
@@ -85,6 +85,13 @@ func FilesUpload(c *gin.Context) {
}
userID := c.GetString(UserIDKey)
folderID := c.PostForm("folderId")
// resourceId optionnel : cible un fichier déjà connu (metadata-only de
// l'outbox) pour lui attacher ses octets physiques (ex. OCR serveur).
resourceID := c.PostForm("resourceId")
if resourceID != "" && !deviceIDPattern.MatchString(resourceID) {
api.Error(c, http.StatusNotFound, "NOT_FOUND", "file not found")
return
}
c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, Store.MaxFileSize+1)
file, err := c.FormFile("file")
@@ -102,7 +109,7 @@ func FilesUpload(c *gin.Context) {
return
}
dto, err := Store.Upload(userID, file, folderID)
dto, err := Store.Upload(userID, file, folderID, resourceID)
if err != nil {
writeError(c, err)
return