handlers

package
v0.0.0-...-d702761 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentHandler

type CommentHandler struct {
	// contains filtered or unexported fields
}

func (*CommentHandler) Create

func (co *CommentHandler) Create(c *gin.Context)

Comment Create godoc @Summary Create comment @Description Create comment @Tags comments @Accept json,mpfd @Produce json @Param photoId path string true "create comment associated with the photo id" @Param models.CommentCreateInput body models.CommentCreateInputSwagger{} true "create comment" @Param Authorization header string true "format: Bearer token-here" @Success 201 {object} models.CommentCreateOutput{} @Failure 400 {object} models.ErrorResponse{} @Router /api/v1/photos/{photoId}/comments [post]

func (*CommentHandler) Delete

func (co *CommentHandler) Delete(c *gin.Context)

Comment Delete godoc @Summary Delete comment @Description Delete comment @Tags comments @Produce json @Param photoId path string true "delete comment associated with the photo id" @Param commentId path string true "delete comment by id" @Param Authorization header string true "format: Bearer token-here" @Success 200 {object} models.DeleteResponse{} @Failure 403 {object} models.ErrorResponse{} @Failure 404 {object} models.ErrorResponse{} @Router /api/v1/photos/{photoId}/comments/{commentId} [delete]

func (*CommentHandler) GetAll

func (co *CommentHandler) GetAll(c *gin.Context)

Comments GetAll godoc @Summary Get all comments associated with the photo id @Description Get all comments associated with the photo id @Tags comments @Param photoId path string true "get comment associated with the photo id" @Param Authorization header string true "format: Bearer token-here" @Produce json @Success 200 {object} []models.CommentGetOutput{} @Failure 400 {object} models.ErrorResponse{} @Router /api/v1/photos/{photoId}/comments [get]

func (*CommentHandler) GetOneById

func (co *CommentHandler) GetOneById(c *gin.Context)

Comment GetOneById godoc @Summary Get one comment by id @Description Get one comment by id @Tags comments @Param photoId path string true "get comment associated with the photo id" @Param commentId path string true "get comment by id" @Param Authorization header string true "format: Bearer token-here" @Produce json @Success 200 {object} models.CommentGetOutput{} @Failure 404 {object} models.ErrorResponse{} @Router /api/v1/photos/{photoId}/comments/{commentId} [get]

func (*CommentHandler) Update

func (co *CommentHandler) Update(c *gin.Context)

Comment Update godoc @Summary Update comment @Description Update comment @Tags comments @Accept json,mpfd @Produce json @Param photoId path string true "update comment associated with the photo id" @Param commentId path string true "update comment by id" @Param models.CommentUpdateInput body models.CommentUpdateInputSwagger{} true "update comment" @Param Authorization header string true "format: Bearer token-here" @Success 200 {object} models.CommentUpdateOutput{} @Failure 403 {object} models.ErrorResponse{} @Failure 404 {object} models.ErrorResponse{} @Router /api/v1/photos/{photoId}/comments/{commentId} [put]

type CommentHdlInterface

type CommentHdlInterface interface {
	GetAll(c *gin.Context)
	GetOneById(c *gin.Context)
	Create(c *gin.Context)
	Update(c *gin.Context)
	Delete(c *gin.Context)
}

func NewCommentHdl

func NewCommentHdl(commentSvc services.CommentSvcInterface) CommentHdlInterface

type PhotoHandler

type PhotoHandler struct {
	// contains filtered or unexported fields
}

func (*PhotoHandler) Create

func (p *PhotoHandler) Create(c *gin.Context)

Photo Create godoc @Summary Create photos @Description Create photos @Tags photos @Accept mpfd @Produce json @Param models.PhotoCreateInput formData models.PhotoCreateInputSwagger true "create photo" @Param photo formData file true "upload photo" @Param Authorization header string true "format: Bearer token-here" @Success 201 {object} models.PhotoCreateOutput{} @Failure 400 {object} models.ErrorResponse{} @Failure 413 {object} models.ErrorResponse{} @Router /api/v1/photos [post]

func (*PhotoHandler) Delete

func (p *PhotoHandler) Delete(c *gin.Context)

Photo Delete godoc @Summary Delete photo @Description Delete photo @Tags photos @Produce json @Param photoId path string true "delete photo by id" @Param Authorization header string true "format: Bearer token-here" @Success 200 {object} models.DeleteResponse{} @Failure 403 {object} models.ErrorResponse{} @Failure 404 {object} models.ErrorResponse{} @Router /api/v1/photos/{photoId} [delete]

func (*PhotoHandler) GetAll

func (p *PhotoHandler) GetAll(c *gin.Context)

Photo GetAll godoc @Summary Get all photos @Description Get all photos @Tags photos @Param Authorization header string true "format: Bearer token-here" @Produce json @Success 200 {object} []models.PhotoGetOutput{} @Failure 400 {object} models.ErrorResponse{} @Router /api/v1/photos [get]

func (*PhotoHandler) GetOneById

func (p *PhotoHandler) GetOneById(c *gin.Context)

Photo GetOneById godoc @Summary Get one photo by id @Description Get one photo by id @Tags photos @Param photoId path string true "get photo by id" @Param Authorization header string true "format: Bearer token-here" @Produce json @Success 200 {object} models.PhotoGetOutput{} @Failure 404 {object} models.ErrorResponse{} @Router /api/v1/photos/{photoId} [get]

func (*PhotoHandler) Update

func (p *PhotoHandler) Update(c *gin.Context)

Photo Update godoc @Summary Update photo @Description Update photo @Tags photos @Accept json,mpfd @Produce json @Param photoId path string true "update photo by id" @Param models.PhotoUpdateInput formData models.PhotoUpdateInputSwagger true "update photo" @Param photo formData file false "upload photo" @Param Authorization header string true "format: Bearer token-here" @Success 200 {object} models.PhotoUpdateOutput{} @Failure 400 {object} models.ErrorResponse{} @Failure 403 {object} models.ErrorResponse{} @Router /api/v1/photos/{photoId} [put]

type PhotoHdlInterface

type PhotoHdlInterface interface {
	GetAll(c *gin.Context)
	GetOneById(c *gin.Context)
	Create(c *gin.Context)
	Update(c *gin.Context)
	Delete(c *gin.Context)
}

func NewPhotoHdl

func NewPhotoHdl(photoSvc services.PhotoSvcInterface) PhotoHdlInterface

type SocialMediaHandler

type SocialMediaHandler struct {
	// contains filtered or unexported fields
}

func (*SocialMediaHandler) Create

func (s *SocialMediaHandler) Create(c *gin.Context)

Social Media Create godoc @Summary Create social media @Description Create social media @Tags socialMedias @Accept json,mpfd @Produce json @Param models.SocialMediaCreateInput body models.SocialMediaCreateInputSwagger{} true "create social media" @Param Authorization header string true "format: Bearer token-here" @Success 201 {object} models.SocialMediaCreateOutput{} @Failure 400 {object} models.ErrorResponse{} @Router /api/v1/social-medias [post]

func (*SocialMediaHandler) Delete

func (s *SocialMediaHandler) Delete(c *gin.Context)

Social Media Delete godoc @Summary Delete social media @Description Delete social media @Tags socialMedias @Produce json @Param socialMediaId path string true "delete social media by id" @Param Authorization header string true "format: Bearer token-here" @Success 200 {object} models.DeleteResponse{} @Failure 403 {object} models.ErrorResponse{} @Failure 404 {object} models.ErrorResponse{} @Router /api/v1/social-medias/{socialMediaId} [delete]

func (*SocialMediaHandler) GetAll

func (s *SocialMediaHandler) GetAll(c *gin.Context)

Social Media GetAll godoc @Summary Get all social media @Description Get all social media @Tags socialMedias @Param Authorization header string true "format: Bearer token-here" @Produce json @Success 200 {object} []models.SocialMediaGetOutput{} @Failure 400 {object} models.ErrorResponse{} @Router /api/v1/social-medias [get]

func (*SocialMediaHandler) GetOneById

func (s *SocialMediaHandler) GetOneById(c *gin.Context)

Social Media GetOneById godoc @Summary Get one social media by id @Description Get one social media by id @Tags socialMedias @Param socialMediaId path string true "get social media by id" @Param Authorization header string true "format: Bearer token-here" @Produce json @Success 200 {object} models.SocialMediaGetOutput{} @Failure 404 {object} models.ErrorResponse{} @Router /api/v1/social-medias/{socialMediaId} [get]

func (*SocialMediaHandler) Update

func (s *SocialMediaHandler) Update(c *gin.Context)

Social Media Update godoc @Summary Update social media @Description Update social media @Tags socialMedias @Accept json,mpfd @Produce json @Param socialMediaId path string true "update social media by id" @Param models.SocialMediaUpdateInput body models.SocialMediaUpdateInputSwagger{} true "update social media" @Param Authorization header string true "format: Bearer token-here" @Success 200 {object} models.SocialMediaUpdateOutput{} @Failure 403 {object} models.ErrorResponse{} @Failure 404 {object} models.ErrorResponse{} @Router /api/v1/social-medias/{socialMediaId} [put]

type SocialMediaHdlInterface

type SocialMediaHdlInterface interface {
	GetAll(c *gin.Context)
	GetOneById(c *gin.Context)
	Create(c *gin.Context)
	Update(c *gin.Context)
	Delete(c *gin.Context)
}

func NewSocialMediaHdl

func NewSocialMediaHdl(socialMediaSvc services.SocialMediaSvcInterface) SocialMediaHdlInterface

type UserHandler

type UserHandler struct {
	// contains filtered or unexported fields
}

func (*UserHandler) Login

func (u *UserHandler) Login(c *gin.Context)

User Login godoc @Summary User login @Description User login @Tags users @Accept json,mpfd @Produce json @Param models.UserLoginInput body models.UserLoginInput{} true "login user" @Success 201 {object} models.UserLoginOutput{} @Failure 401 {object} models.ErrorResponse{} @Router /api/v1/users/login [post]

func (*UserHandler) Register

func (u *UserHandler) Register(c *gin.Context)

User Register godoc @Summary Register new user @Description Register new user @Tags users @Accept json,mpfd @Produce json @Param models.UserRegisterInput body models.UserRegisterInput{} true "register user" @Success 201 {object} models.UserRegisterOutput{} @Failure 400 {object} models.ErrorResponse{} @Router /api/v1/users/register [post]

type UserHdlInterface

type UserHdlInterface interface {
	Register(c *gin.Context)
	Login(c *gin.Context)
}

func NewUserHdl

func NewUserHdl(userSvc services.UserSvcInterface) UserHdlInterface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL