feat: add auth to swagerr add middleware for check admin
This commit is contained in:
@@ -95,6 +95,7 @@ func (h *PostHandlers) GetPost(c *gin.Context) {
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param post body storage.PostCreate true "Post data"
|
||||
// @Security Bearer
|
||||
// @Success 200 {object} models.SuccessResponse{data=storage.Post}
|
||||
// @Failure 400 {object} models.ErrorResponse "Invalid request"
|
||||
// @Router /posts [post]
|
||||
@@ -127,6 +128,7 @@ func (h *PostHandlers) CreatePost(c *gin.Context) {
|
||||
// @Param id path int true "Post ID"
|
||||
// @Param post body storage.PostCreate true "Post data"
|
||||
// @Produce json
|
||||
// @Security Bearer
|
||||
// @Success 200 {object} models.SuccessResponse{data=storage.PostCreate}
|
||||
// @Failure 400 {object} models.ErrorResponse "Invalid ID format"
|
||||
// @Failure 500 {object} models.ErrorResponse "Internal server error"
|
||||
@@ -162,6 +164,7 @@ func (h *PostHandlers) UpdatePost(c *gin.Context) {
|
||||
// @Param id path int true "Post ID"
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security Bearer
|
||||
// @Failure 404 {object} models.ErrorResponse "Post not found"
|
||||
// @Failure 400 {object} models.ErrorResponse "Invalid ID format"
|
||||
// @Failure 500 {object} models.ErrorResponse "Internal server error"
|
||||
|
||||
Reference in New Issue
Block a user