feat(api): OCR réel — POST /ocr/jobs + GET /ocr/jobs/:id (tesseract syscall, jobs asynchrones)
- ocr/tesseract.go : Engine → Tesseract subprocess (OCR_LANG fra+eng) ; PDF → calque texte via ledongthuc/pdf (go.mod : nouveau dep) - repository/ocr_jobs.go : queued→processing→done/failed, scoping device, text/error NULLIFés - service/ocr.go : Create valide le fichier (GetFile), queue + goroutine de traitement ; physique résolu par glob UPLOAD_DIR/<device>/<id>.* ; fail propre (fichier illisible, erreur moteur) - handlers/ocr.go : réels (validate fileId, NOT_FOUND si job d'un autre device), fin 501 OCR - tests end-to-end : cycle queued→done (stub moteur), NOT_FOUND fichier inconnu, scoping device - smoke réel : PNG 'VAULTDROP' → job done text='VAULTDROP' (tesseract installé) - docs/AGENTS : §5 + état des routes (tout V1 réel)
This commit is contained in:
@@ -13,6 +13,9 @@ import (
|
||||
// (cmd/server). Nil until then.
|
||||
var Store *service.Resources
|
||||
|
||||
// Ocr queues/reads OCR jobs; set once at startup alongside Store.
|
||||
var Ocr *service.Ocr
|
||||
|
||||
// writeError maps repository/service sentinels to contract error codes.
|
||||
func writeError(c *gin.Context, err error) {
|
||||
switch {
|
||||
|
||||
Reference in New Issue
Block a user