mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
API: Add Swagger annotations #2132
This commit is contained in:
@@ -23,13 +23,18 @@ const (
|
||||
|
||||
// AlbumCover returns an album cover image.
|
||||
//
|
||||
// The request parameters are:
|
||||
//
|
||||
// - uid: string album uid
|
||||
// - token: string security token (see config)
|
||||
// - size: string thumb type, see photoprism.ThumbnailTypes
|
||||
//
|
||||
// GET /api/v1/albums/:uid/t/:token/:size
|
||||
// @Summary returns an album cover image
|
||||
// @Id AlbumCover
|
||||
// @Produce image/jpeg
|
||||
// @Produce image/svg+xml
|
||||
// @Tags Images, Albums
|
||||
// @Failure 403 {file} image/svg+xml
|
||||
// @Failure 200 {file} image/svg+xml
|
||||
// @Success 200 {file} image/jpg
|
||||
// @Param uid path string true "Album 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/albums/{uid}/t/{token}/{size} [get]
|
||||
func AlbumCover(router *gin.RouterGroup) {
|
||||
router.GET("/albums/:uid/t/:token/:size", func(c *gin.Context) {
|
||||
if InvalidPreviewToken(c) {
|
||||
@@ -136,13 +141,18 @@ func AlbumCover(router *gin.RouterGroup) {
|
||||
|
||||
// LabelCover returns a label cover image.
|
||||
//
|
||||
// The request parameters are:
|
||||
//
|
||||
// - uid: string label uid
|
||||
// - token: string security token (see config)
|
||||
// - size: string thumb type, see photoprism.ThumbnailTypes
|
||||
//
|
||||
// GET /api/v1/labels/:uid/t/:token/:size
|
||||
// @Summary returns a label cover image
|
||||
// @Id LabelCover
|
||||
// @Produce image/jpeg
|
||||
// @Produce image/svg+xml
|
||||
// @Tags Images, Labels
|
||||
// @Failure 403 {file} image/svg+xml
|
||||
// @Failure 200 {file} image/svg+xml
|
||||
// @Success 200 {file} image/jpg
|
||||
// @Param uid path string true "Label 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/labels/{uid}/t/{token}/{size} [get]
|
||||
func LabelCover(router *gin.RouterGroup) {
|
||||
router.GET("/labels/:uid/t/:token/:size", func(c *gin.Context) {
|
||||
if InvalidPreviewToken(c) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,16 +18,19 @@ import (
|
||||
|
||||
// GetThumb returns a thumbnail image matching the file hash, crop area, and type.
|
||||
//
|
||||
// @Summary returns a thumbnail image with the requested size
|
||||
// @Description Fore more information see:
|
||||
// @Description - https://docs.photoprism.app/developer-guide/api/thumbnails/#image-endpoint-uri
|
||||
// @Id GetThumb
|
||||
// @Produce image/jpeg
|
||||
// @Tags Images, Files
|
||||
// @Param thumb path string true "SHA1 file hash, optionally with a crop area suffixed, e.g. '-016014058037'"
|
||||
// @Param token path string true "user-specific security token provided with session"
|
||||
// @Param size path string true "thumbnail size"
|
||||
// @Router /api/v1/t/{hash}/{token}/{size} [get]
|
||||
// @Summary returns a thumbnail image with the requested size
|
||||
// @Description Fore more information see:
|
||||
// @Description - https://docs.photoprism.app/developer-guide/api/thumbnails/#image-endpoint-uri
|
||||
// @Id GetThumb
|
||||
// @Produce image/jpeg
|
||||
// @Tags Images, Files
|
||||
// @Failure 403 {file} image/svg+xml
|
||||
// @Failure 200 {file} image/svg+xml
|
||||
// @Success 200 {file} image/jpg
|
||||
// @Param thumb path string true "SHA1 file hash, optionally with a crop area suffixed, e.g. '-016014058037'"
|
||||
// @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/t/{thumb}/{token}/{size} [get]
|
||||
func GetThumb(router *gin.RouterGroup) {
|
||||
router.GET("/t/:thumb/:token/:size", func(c *gin.Context) {
|
||||
if InvalidPreviewToken(c) {
|
||||
|
||||
Reference in New Issue
Block a user