API: Add Swagger annotations #2132

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-07-16 12:05:55 +02:00
parent f1f4853190
commit 428d57e71e
26 changed files with 100 additions and 52 deletions

View File

@@ -18,13 +18,13 @@ import (
// GetThumb returns a thumbnail image matching the file hash, crop area, and type.
//
// The request parameters are:
//
// - thumb: string sha1 file hash plus optional crop area
// - token: string url security token, see config
// - size: string thumb type, see thumb.Sizes
//
// GET /api/v1/t/:thumb/:token/:size
// @Summary "returns a thumbnail image matching the file hash, crop area, and type"
// @Produce "image/jpeg"
// @Tags Thumbnails
// @Param thumb path string true "SHA1 file hash plus optional crop area"
// @Param token path string true "user-specific security token provided with session"
// @Param size path string true "thumbnail size"
// @Route /api/v1/t/{thumb}/{token}/{size} [get]
func GetThumb(router *gin.RouterGroup) {
router.GET("/t/:thumb/:token/:size", func(c *gin.Context) {
if InvalidPreviewToken(c) {