The activity.file_views table existed but nothing ever wrote to it. Add a
POST /files/{id}/views endpoint: FileRepo.RecordView inserts a history row,
FileService.RecordView enforces view ACL first. The file viewer fires it
(fire-and-forget) when a file is opened, including while paging prev/next.
Documented in openapi.yaml; covered by TestRecordFileView (204 on view,
repeatable, 404 for unknown file).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -407,6 +407,18 @@ paths:
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFound'
|
||||
|
||||
/files/{file_id}/views:
|
||||
post:
|
||||
tags: [Files]
|
||||
summary: Record that the current user viewed the file
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/file_id'
|
||||
responses:
|
||||
'204':
|
||||
description: View recorded
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFound'
|
||||
|
||||
/files/{file_id}/restore:
|
||||
post:
|
||||
tags: [Files]
|
||||
|
||||
Reference in New Issue
Block a user