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:
@@ -12,11 +12,14 @@ import (
|
||||
|
||||
// GetFile returns file details as JSON.
|
||||
//
|
||||
// The request parameters are:
|
||||
//
|
||||
// - hash (string) SHA-1 hash of the file
|
||||
//
|
||||
// GET /api/v1/files/:hash
|
||||
// @Summary returns file details as JSON
|
||||
// @Id GetFile
|
||||
// @Tags Files
|
||||
// @Produce json
|
||||
// @Success 200 {object} entity.File
|
||||
// @Failure 401,403,404,429 {object} i18n.Response
|
||||
// @Param hash path string true "hash (string) SHA-1 hash of the file"
|
||||
// @Router /api/v1/files/{hash} [get]
|
||||
func GetFile(router *gin.RouterGroup) {
|
||||
router.GET("/files/:hash", func(c *gin.Context) {
|
||||
s := Auth(c, acl.ResourceFiles, acl.ActionView)
|
||||
|
||||
Reference in New Issue
Block a user