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.
|
// AlbumCover returns an album cover image.
|
||||||
//
|
//
|
||||||
// The request parameters are:
|
// @Summary returns an album cover image
|
||||||
//
|
// @Id AlbumCover
|
||||||
// - uid: string album uid
|
// @Produce image/jpeg
|
||||||
// - token: string security token (see config)
|
// @Produce image/svg+xml
|
||||||
// - size: string thumb type, see photoprism.ThumbnailTypes
|
// @Tags Images, Albums
|
||||||
//
|
// @Failure 403 {file} image/svg+xml
|
||||||
// GET /api/v1/albums/:uid/t/:token/:size
|
// @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) {
|
func AlbumCover(router *gin.RouterGroup) {
|
||||||
router.GET("/albums/:uid/t/:token/:size", func(c *gin.Context) {
|
router.GET("/albums/:uid/t/:token/:size", func(c *gin.Context) {
|
||||||
if InvalidPreviewToken(c) {
|
if InvalidPreviewToken(c) {
|
||||||
@@ -136,13 +141,18 @@ func AlbumCover(router *gin.RouterGroup) {
|
|||||||
|
|
||||||
// LabelCover returns a label cover image.
|
// LabelCover returns a label cover image.
|
||||||
//
|
//
|
||||||
// The request parameters are:
|
// @Summary returns a label cover image
|
||||||
//
|
// @Id LabelCover
|
||||||
// - uid: string label uid
|
// @Produce image/jpeg
|
||||||
// - token: string security token (see config)
|
// @Produce image/svg+xml
|
||||||
// - size: string thumb type, see photoprism.ThumbnailTypes
|
// @Tags Images, Labels
|
||||||
//
|
// @Failure 403 {file} image/svg+xml
|
||||||
// GET /api/v1/labels/:uid/t/:token/:size
|
// @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) {
|
func LabelCover(router *gin.RouterGroup) {
|
||||||
router.GET("/labels/:uid/t/:token/:size", func(c *gin.Context) {
|
router.GET("/labels/:uid/t/:token/:size", func(c *gin.Context) {
|
||||||
if InvalidPreviewToken(c) {
|
if InvalidPreviewToken(c) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -24,10 +24,13 @@ import (
|
|||||||
// @Id GetThumb
|
// @Id GetThumb
|
||||||
// @Produce image/jpeg
|
// @Produce image/jpeg
|
||||||
// @Tags Images, Files
|
// @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 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 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"
|
// @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/{hash}/{token}/{size} [get]
|
// @Router /api/v1/t/{thumb}/{token}/{size} [get]
|
||||||
func GetThumb(router *gin.RouterGroup) {
|
func GetThumb(router *gin.RouterGroup) {
|
||||||
router.GET("/t/:thumb/:token/:size", func(c *gin.Context) {
|
router.GET("/t/:thumb/:token/:size", func(c *gin.Context) {
|
||||||
if InvalidPreviewToken(c) {
|
if InvalidPreviewToken(c) {
|
||||||
|
|||||||
Reference in New Issue
Block a user