API: Add Swagger annotations #2132

This commit is contained in:
graciousgrey
2024-09-03 16:47:29 +02:00
parent d6482815ae
commit 7792abf9a8
7 changed files with 486 additions and 27 deletions

View File

@@ -21,13 +21,18 @@ const (
// FolderCover returns a folder cover image.
//
// The request parameters are:
//
// - uid: string folder uid
// - token: string url security token, see config
// - size: string thumb type, see thumb.Sizes
//
// GET /api/v1/folders/t/:hash/:token/:size
// @Summary returns a folder cover image
// @Id FolderCover
// @Produce image/jpeg
// @Produce image/svg+xml
// @Tags Images, Folders
// @Failure 403 {file} image/svg+xml
// @Failure 200 {file} image/svg+xml
// @Success 200 {file} image/jpg
// @Param uid path string true "folder uid"
// @Param token path string true "user-specific security token provided with session or 'public' when running PhotoPrism in public mode"
// @Param size path string true "thumbnail size" Enums(tile_50, tile_100, left_224, right_224, tile_224, tile_500, fit_720, tile_1080, fit_1280, fit_1600, fit_1920, fit_2048, fit_2560, fit_3840, fit_4096, fit_7680)
// @Router /api/v1/folders/t/{uid}/{token}/{size} [get]
func FolderCover(router *gin.RouterGroup) {
router.GET("/folders/t/:uid/:token/:size", func(c *gin.Context) {
if InvalidPreviewToken(c) {