add gitlab ci

This commit is contained in:
m
2026-09-16 14:47:10 +02:00
parent 906d48702c
commit cd4f0179fc
32 changed files with 1462 additions and 40 deletions
+20
View File
@@ -73,6 +73,26 @@ func (s *Resources) GetFile(ownerID, id string) (FileDTO, error) {
return toFileDTO(row), nil
}
// FileOcrDTO is the payload of GET /files/:id/ocr: the server-computed OCR
// extract of the resource, readable by its owner and by grantees (viewer+).
type FileOcrDTO struct {
Text string `json:"text"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
// GetFileOcr returns the OCR text of a file the user can see (viewer+, own or
// shared). Absent text → Text empty ("") with 200 (the caller decides).
func (s *Resources) GetFileOcr(ownerID, id string) (FileOcrDTO, error) {
row, err := s.Repo.GetFileVisible(ownerID, id)
if err != nil {
return FileOcrDTO{}, err
}
return FileOcrDTO{
Text: row.OcrText,
UpdatedAt: row.UpdatedAt.UTC().Format(time.RFC3339),
}, nil
}
func (s *Resources) DeleteFile(ownerID, id string) (string, error) {
return s.Repo.DeleteFile(ownerID, id)
}