V2-4 : placements multi-device (report_bytes, tables 000015, copies UI)

This commit is contained in:
venture
2026-09-25 19:45:33 +02:00
parent 0f90aad938
commit a91ddf7aa8
42 changed files with 714 additions and 25 deletions
+22
View File
@@ -50,3 +50,25 @@ func LinksList(c *gin.Context) {
}
api.OK(c, links)
}
// PlacementsList exposes byte presence of a resource the caller OWNS
// (server entry + device reports, newest first) : GET /files/:id/placements.
// Owner-only (404 otherwise, no enumeration).
func PlacementsList(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
}
placements, err := Store.ListPlacements(userID, id)
if err != nil {
writeError(c, err)
return
}
api.OK(c, placements)
}