add gitlab ci
This commit is contained in:
@@ -59,6 +59,29 @@ func FilesGet(c *gin.Context) {
|
||||
api.OK(c, file)
|
||||
}
|
||||
|
||||
// FilesGetOcr expose l'extrait OCR server-side d'un fichier visible (viewer+,
|
||||
// own ou shared) : GET /files/:id/ocr. Réponse { text } ("" si pas encore
|
||||
// extrait) + updatedAt. Permet à un second device de récupérer le texte déjà
|
||||
// calculé sans re-téléverser les octets (cf. docs/api-v1.md §5).
|
||||
func FilesGetOcr(c *gin.Context) {
|
||||
if Store == nil {
|
||||
api.Error(c, http.StatusServiceUnavailable, "SERVICE_UNAVAILABLE", "backend not initialized")
|
||||
return
|
||||
}
|
||||
userID := c.GetString(UserIDKey)
|
||||
id := c.Param("id")
|
||||
if !deviceIDPattern.MatchString(id) {
|
||||
api.Error(c, http.StatusNotFound, "NOT_FOUND", "file not found")
|
||||
return
|
||||
}
|
||||
dto, err := Store.GetFileOcr(userID, id)
|
||||
if err != nil {
|
||||
writeError(c, err)
|
||||
return
|
||||
}
|
||||
api.OK(c, dto)
|
||||
}
|
||||
|
||||
func FilesDelete(c *gin.Context) {
|
||||
if Store == nil {
|
||||
api.Error(c, http.StatusServiceUnavailable, "SERVICE_UNAVAILABLE", "backend not initialized")
|
||||
|
||||
Reference in New Issue
Block a user