add gitlab ci
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user