swag fmt
This commit is contained in:
@@ -10,12 +10,12 @@ import (
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
// @Summary Get all resources
|
||||
// @Tags acl/resources
|
||||
// @Produce json
|
||||
// @Success 200 {array} getResourcesResponse
|
||||
// @Failure 500 {object} ProblemDetails
|
||||
// @Router /api/acl/resources [get]
|
||||
// @Summary Get all resources
|
||||
// @Tags acl/resources
|
||||
// @Produce json
|
||||
// @Success 200 {object} getResourcesResponse
|
||||
// @Failure 500 {object} ProblemDetails
|
||||
// @Router /api/acl/resources [get]
|
||||
func (h *aclAdminHandler) getResources(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
@@ -44,15 +44,15 @@ func (h *aclAdminHandler) getResources(w http.ResponseWriter, r *http.Request) {
|
||||
_ = json.NewEncoder(w).Encode(resp)
|
||||
}
|
||||
|
||||
// @Summary Get resource by ID
|
||||
// @Tags acl/resources
|
||||
// @Produce json
|
||||
// @Param resourceId path int true "Resource ID" example(1)
|
||||
// @Success 200 {object} getResourceResponse
|
||||
// @Failure 400 {object} ProblemDetails
|
||||
// @Failure 404 {object} ProblemDetails
|
||||
// @Failure 500 {object} ProblemDetails
|
||||
// @Router /api/acl/resources/{resourceId} [get]
|
||||
// @Summary Get resource by ID
|
||||
// @Tags acl/resources
|
||||
// @Produce json
|
||||
// @Param resourceId path int true "Resource ID" example(1)
|
||||
// @Success 200 {object} getResourceResponse
|
||||
// @Failure 400 {object} ProblemDetails
|
||||
// @Failure 404 {object} ProblemDetails
|
||||
// @Failure 500 {object} ProblemDetails
|
||||
// @Router /api/acl/resources/{resourceId} [get]
|
||||
func (h *aclAdminHandler) getResource(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
@@ -83,16 +83,16 @@ func (h *aclAdminHandler) getResource(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// @Summary Create resource
|
||||
// @Tags acl/resources
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param request body createResourceRequest true "Resource"
|
||||
// @Success 201 {object} createResourceResponse
|
||||
// @Failure 400 {object} ProblemDetails
|
||||
// @Failure 409 {object} ProblemDetails
|
||||
// @Failure 500 {object} ProblemDetails
|
||||
// @Router /api/acl/resources [post]
|
||||
// @Summary Create resource
|
||||
// @Tags acl/resources
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param request body createResourceRequest true "Resource"
|
||||
// @Success 201 {object} createResourceResponse
|
||||
// @Failure 400 {object} ProblemDetails
|
||||
// @Failure 409 {object} ProblemDetails
|
||||
// @Failure 500 {object} ProblemDetails
|
||||
// @Router /api/acl/resources [post]
|
||||
func (h *aclAdminHandler) createResource(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
@@ -127,18 +127,18 @@ func (h *aclAdminHandler) createResource(w http.ResponseWriter, r *http.Request)
|
||||
})
|
||||
}
|
||||
|
||||
// @Summary Update resource
|
||||
// @Tags acl/resources
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param resourceId path int true "Resource ID" example(1)
|
||||
// @Param request body updateResourceRequest true "Resource"
|
||||
// @Success 200 {object} updateResourceResponse
|
||||
// @Failure 400 {object} ProblemDetails
|
||||
// @Failure 404 {object} ProblemDetails
|
||||
// @Failure 409 {object} ProblemDetails
|
||||
// @Failure 500 {object} ProblemDetails
|
||||
// @Router /api/acl/resources/{resourceId} [patch]
|
||||
// @Summary Update resource
|
||||
// @Tags acl/resources
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param resourceId path int true "Resource ID" example(1)
|
||||
// @Param request body updateResourceRequest true "Resource"
|
||||
// @Success 200 {object} updateResourceResponse
|
||||
// @Failure 400 {object} ProblemDetails
|
||||
// @Failure 404 {object} ProblemDetails
|
||||
// @Failure 409 {object} ProblemDetails
|
||||
// @Failure 500 {object} ProblemDetails
|
||||
// @Router /api/acl/resources/{resourceId} [patch]
|
||||
func (h *aclAdminHandler) updateResource(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
@@ -181,16 +181,16 @@ func (h *aclAdminHandler) updateResource(w http.ResponseWriter, r *http.Request)
|
||||
})
|
||||
}
|
||||
|
||||
// @Summary Delete resource
|
||||
// @Tags acl/resources
|
||||
// @Produce json
|
||||
// @Param resourceId path int true "Resource ID" example(1)
|
||||
// @Success 200
|
||||
// @Failure 400 {object} ProblemDetails
|
||||
// @Failure 404 {object} ProblemDetails
|
||||
// @Failure 409 {object} ProblemDetails
|
||||
// @Failure 500 {object} ProblemDetails
|
||||
// @Router /api/acl/resources/{resourceId} [delete]
|
||||
// @Summary Delete resource
|
||||
// @Tags acl/resources
|
||||
// @Produce json
|
||||
// @Param resourceId path int true "Resource ID" example(1)
|
||||
// @Success 200
|
||||
// @Failure 400 {object} ProblemDetails
|
||||
// @Failure 404 {object} ProblemDetails
|
||||
// @Failure 409 {object} ProblemDetails
|
||||
// @Failure 500 {object} ProblemDetails
|
||||
// @Router /api/acl/resources/{resourceId} [delete]
|
||||
func (h *aclAdminHandler) deleteResource(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user