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:
@@ -9,6 +9,7 @@ type Repository struct {
|
||||
Resources *Resources
|
||||
Devices *Devices
|
||||
Operations *Operations
|
||||
OcrJobs *OcrJobs
|
||||
}
|
||||
|
||||
func NewRepository(conn *sql.DB) *Repository {
|
||||
@@ -16,5 +17,6 @@ func NewRepository(conn *sql.DB) *Repository {
|
||||
Resources: &Resources{DB: conn},
|
||||
Devices: &Devices{DB: conn},
|
||||
Operations: &Operations{DB: conn},
|
||||
OcrJobs: &OcrJobs{DB: conn},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user