Add GET /api/v1/character/details with each image's change time
Returns every character image with when it was last changed, in Unix seconds, so clients can cache the images and download only the ones that changed.
This commit is contained in:
1 parent
76a1b946eb
commit
c62b65d7cd
5 files changed
+72
No files matched your search
@@ -57,6 +57,12 @@ func (s *Server) registerMisc(a huma.API) {
|
||||
func(ctx context.Context, _ *struct{}) (*jsonBody[[]string], error) {
|
||||
return ok(s.characters.List())
|
||||
})
|
||||
register(s, a, route{op: get("list-character-details", "/character/details", "characters",
|
||||
"List characters with change times",
|
||||
"Returns every character image with the time it was last changed, so clients can cache images and download only the changed ones.")},
|
||||
func(ctx context.Context, _ *struct{}) (*jsonBody[[]backend.CharacterDetails], error) {
|
||||
return ok(s.characters.ListDetails())
|
||||
})
|
||||
image := get("get-character", "/character", "characters", "Character image",
|
||||
"Returns a character image.", http.StatusBadRequest, http.StatusNotFound)
|
||||
image.Responses = fileResponses("The image", "image/png", "image/jpeg")
|
||||
|
||||
Reference in new issue
Block a user