Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPersonHandler ¶
func NewPersonHandler(routerGroup *gin.Engine, us domain.PersonUseCase)
Types ¶
type PersonHandler ¶
type PersonHandler struct {
PUseCase domain.PersonUseCase
}
func (*PersonHandler) CreatePerson ¶
func (h *PersonHandler) CreatePerson(c *gin.Context)
CreatePerson godoc @Summary Route to create person @Description Create person @Tags Person @Accept json @Produce json @Param Payload body domain.PersonRequest true "Payload" @Success 201 {object} string @Failure 400 {object} domain.ErrorResponse @Failure 422 {object} domain.ErrorResponse @Router /v1/person [POST]
func (*PersonHandler) GetAllPerson ¶
func (h *PersonHandler) GetAllPerson(c *gin.Context)
GetAllPerson godoc @Summary Route to return all people @Description All people @Tags Person @Accept json @Produce json @Success 200 {object} []domain.Person @Failure 400 {object} domain.ErrorResponse @Router /v1/person/all [GET]
func (*PersonHandler) GetByID ¶
func (h *PersonHandler) GetByID(c *gin.Context)
GetByID godoc @Summary Route to fetch person by ID @Description Fetch person @Tags Person @Accept json @Produce json @Param personId path int true "Person ID" @Success 200 {object} domain.Person @Failure 400 {object} domain.ErrorResponse @Router /v1/person/{personId} [GET]