handler

package
v0.0.0-...-db83385 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserEchoHandler

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

func NewUserEchoHandler

func NewUserEchoHandler(userUsecase user.Usecase, validate *validator.Validate) *UserEchoHandler

func (*UserEchoHandler) CreateOneUser

func (h *UserEchoHandler) CreateOneUser(c echo.Context) error

CreateOneUser create one user

@Id				CreateOneUser
@Summary		Create a user based on provided data
@Description	Create a user based on provided data. When the user is created, the response will return the newly generated user ID.
@Tags			users
@Accept			json
@Produce		json
@Param			body	body		userdto.CreateOneUserRequest	true	"The request should follow the CreateOneUserRequest model"
@Success		200		{object}	userdto.CreateOneUserResponse
@Failure		400		{object}	dto.HttpResponse
@Failure		500		{object}	dto.HttpResponse
@Router			/users [post]

func (*UserEchoHandler) GetAllUsers

func (h *UserEchoHandler) GetAllUsers(c echo.Context) error

GetAllUsers gets all users

@Id				GetAllUsers
@Summary		Get all users
@Description	Get all users data
@Tags			users
@Accept			json
@Produce		json
@Success		200	{object}	userdto.GetAllUsersResponse
@Failure		500	{object}	dto.HttpResponse
@Router			/users [get]

func (*UserEchoHandler) GetOneUserById

func (h *UserEchoHandler) GetOneUserById(c echo.Context) error

GetOneUserById gets one user by id

@Id				GetOneUserById
@Summary		Get One User By ID
@Description	Retrieving a user by ID
@Tags			users
@Accept			json
@Produce		json
@Param			user_id	path		int	true	"User ID"
@Success		200		{object}	userdto.GetOneUserByIdResponse
@Failure		400		{object}	dto.HttpResponse
@Failure		404		{object}	dto.HttpResponse
@Failure		500		{object}	dto.HttpResponse
@Router			/users/{user_id} [get]

Jump to

Keyboard shortcuts

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