API: Add Swagger annotations #2132

This commit is contained in:
graciousgrey
2024-11-19 16:58:41 +01:00
parent 9d67f6f609
commit 076a400868
2 changed files with 16 additions and 4 deletions

View File

@@ -30,8 +30,14 @@ const (
// StartImport imports media files from a directory and converts/indexes them as needed. // StartImport imports media files from a directory and converts/indexes them as needed.
// //
// @Tags Library // @Summary start import
// @Router /api/v1/import/{path} [post] // @Id StartImport
// @Tags Library
// @Produce json
// @Success 200 {object} i18n.Response
// @Failure 400,401,403 {object} i18n.Response
// @Param options body form.ImportOptions true "import options"
// @Router /api/v1/import/ [post]
func StartImport(router *gin.RouterGroup) { func StartImport(router *gin.RouterGroup) {
router.POST("/import/*path", func(c *gin.Context) { router.POST("/import/*path", func(c *gin.Context) {
s := AuthAny(c, acl.ResourceFiles, acl.Permissions{acl.ActionManage, acl.ActionUpload}) s := AuthAny(c, acl.ResourceFiles, acl.Permissions{acl.ActionManage, acl.ActionUpload})

View File

@@ -21,8 +21,14 @@ import (
// StartIndexing indexes media files in the "originals" folder. // StartIndexing indexes media files in the "originals" folder.
// //
// @Tags Library // @Summary start indexing
// @Router /api/v1/index [post] // @Id StartIndexing
// @Tags Library
// @Produce json
// @Success 200 {object} i18n.Response
// @Failure 400,401,403,429,500 {object} i18n.Response
// @Param options body form.IndexOptions true "index options"
// @Router /api/v1/index [post]
func StartIndexing(router *gin.RouterGroup) { func StartIndexing(router *gin.RouterGroup) {
router.POST("/index", func(c *gin.Context) { router.POST("/index", func(c *gin.Context) {
s := Auth(c, acl.ResourcePhotos, acl.ActionUpdate) s := Auth(c, acl.ResourcePhotos, acl.ActionUpdate)