remove npl

This commit is contained in:
m
2026-07-12 22:15:23 +02:00
parent 010cb2cb49
commit 3650b7ba9d
21 changed files with 8 additions and 478 deletions
-3
View File
@@ -64,7 +64,6 @@ func (h *FileHandler) List(c *gin.Context) {
CreatedAt string `json:"createdAt"`
MimeType string `json:"mimeType"`
OcrText string `json:"ocrText,omitempty"`
NlpData string `json:"nlpData,omitempty"`
UpdatedAt string `json:"updatedAt"`
}
@@ -79,7 +78,6 @@ func (h *FileHandler) List(c *gin.Context) {
Tags: []string{},
CreatedAt: f.CreatedAt,
OcrText: f.OcrText,
NlpData: f.NlpData,
UpdatedAt: f.UpdatedAt,
MimeType: f.MimeType,
}
@@ -124,7 +122,6 @@ func (h *FileHandler) Get(c *gin.Context) {
"createdAt": file.CreatedAt,
"updatedAt": file.UpdatedAt,
"ocrText": file.OcrText,
"nlpData": file.NlpData,
})
}
+2 -4
View File
@@ -7,15 +7,13 @@ import (
type Handler struct {
File *FileHandler
OCR *OCRHandler
NLP *NLPHandler
Health *HealthHandler
}
func New(fileSvc *service.FileService, ocrSvc *service.OCRService, nlpSvc *service.NLPService, urlSvc *service.URLService) *Handler {
func New(fileSvc *service.FileService, ocrSvc *service.OCRService, urlSvc *service.URLService) *Handler {
return &Handler{
File: &FileHandler{files: fileSvc, urls: urlSvc, ocr: ocrSvc},
OCR: &OCRHandler{ocr: ocrSvc, files: fileSvc},
NLP: &NLPHandler{nlp: nlpSvc, files: fileSvc},
Health: &HealthHandler{ocr: ocrSvc, nlp: nlpSvc},
Health: &HealthHandler{ocr: ocrSvc},
}
}
+1 -16
View File
@@ -7,23 +7,8 @@ import (
type HealthHandler struct {
ocr interface{ HealthCheck() error }
nlp interface{ HealthCheck() error }
}
func (h *HealthHandler) Check(c *gin.Context) {
status := gin.H{"status": "healthy"}
if err := h.ocr.HealthCheck(); err != nil {
status["ocr"] = err.Error()
} else {
status["ocr"] = "healthy"
}
if err := h.nlp.HealthCheck(); err != nil {
status["nlp"] = err.Error()
} else {
status["nlp"] = "healthy"
}
api.Success(c, status)
api.Success(c, gin.H{"status": "healthy"})
}
-22
View File
@@ -1,22 +0,0 @@
package handler
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/vaultdrop/backend/internal/service"
"github.com/vaultdrop/backend/pkg/api"
)
type NLPHandler struct {
nlp *service.NLPService
files *service.FileService
}
func (h *NLPHandler) CreateJob(c *gin.Context) {
api.Error(c, http.StatusNotImplemented, "NOT_IMPLEMENTED", "NLP job creation not yet implemented")
}
func (h *NLPHandler) GetJobStatus(c *gin.Context) {
api.Error(c, http.StatusNotFound, "JOB_NOT_FOUND", "NLP job not found")
}
-3
View File
@@ -18,7 +18,4 @@ func SetupRoutes(r *gin.Engine, h *Handler) {
api.POST("/ocr/jobs", h.OCR.CreateJob)
api.GET("/ocr/jobs/:id", h.OCR.GetJobStatus)
api.POST("/nlp/jobs", h.NLP.CreateJob)
api.GET("/nlp/jobs/:id", h.NLP.GetJobStatus)
}