This commit is contained in:
André Roth
2024-11-02 18:09:43 +01:00
parent c055611914
commit 8f8de4bd29
17 changed files with 107 additions and 86 deletions

View File

@@ -67,10 +67,13 @@ func apiFilesListDirs(c *gin.Context) {
c.JSON(200, list)
}
// @Summary TODO
// @Description **ToDo**
// @Summary Upload file glaa
// @Description **Upload a file to a directory**
// @Description To Do
// @Tags Files
// @Accept multipart/form-data
// @Param dir path string true "Directory to upload files to"
// @Param files formData file true "Files to upload"
// @Produce json
// @Success 200 {object} string "msg"
// @Failure 404 {object} Error "Not Found"

View File

@@ -399,10 +399,13 @@ func apiReposPackagesDelete(c *gin.Context) {
})
}
// @Summary TODO
// @Description **ToDo**
// @Summary Add packages
// @Description **Add package file**
// @Description To Do
// @Tags Repos
// @Param name path string true "Repository name"
// @Param dir path string true "Directory of packages"
// @Param file path string false "Filename (optional)"
// @Produce json
// @Success 200 {object} string "msg"
// @Failure 404 {object} Error "Not Found"
@@ -427,7 +430,7 @@ func apiReposPackageFromFile(c *gin.Context) {
// @Failure 400 {object} Error "wrong file"
// @Failure 404 {object} Error "Repository not found"
// @Failure 500 {object} Error "Error adding files"
// @Router /api/repos/{name}/{dir} [post]
// @Router /api/repos/{name}/file/{dir} [post]
func apiReposPackageFromDir(c *gin.Context) {
forceReplace := c.Request.URL.Query().Get("forceReplace") == "1"
noRemove := c.Request.URL.Query().Get("noRemove") == "1"

View File

@@ -187,10 +187,18 @@ func apiSnapshotsCreate(c *gin.Context) {
})
}
// @Summary TODO
// @Description **ToDo**
type snapshotRepositoryParams struct {
Name string `binding:"required"`
Description string
}
// @Summary Snapshot Repository
// @Description **Create a sbalshot of a repository**
// @Description To Do
// @Tags Snapshots
// @Param name path string true "Repository name"
// @Consume json
// @Param request body snapshotRepositoryParams true "Parameters"
// @Produce json
// @Success 200 {object} string "msg"
// @Failure 404 {object} Error "Not Found"
@@ -200,13 +208,9 @@ func apiSnapshotsCreateFromRepository(c *gin.Context) {
err error
repo *deb.LocalRepo
snapshot *deb.Snapshot
b snapshotRepositoryParams
)
var b struct {
Name string `binding:"required"`
Description string
}
if c.Bind(&b) != nil {
return
}
@@ -305,10 +309,11 @@ func apiSnapshotsUpdate(c *gin.Context) {
})
}
// @Summary TODO
// @Description **ToDo**
// @Summary Get snapshot information
// @Description **Get information about a snapshot**
// @Description To Do
// @Tags Snapshots
// @Param name path string true "Name of the snapshot"
// @Produce json
// @Success 200 {object} string "msg"
// @Failure 404 {object} Error "Not Found"