handler

package
v0.0.0-...-565acca Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUserHandler

func CreateUserHandler(ctx *gin.Context)

@Summary Create User @Description Create a new user @Tags User @Accept json @Producer json @Param request body CreateUserRequest true "Request body" @Success 201 {object} CreateUserResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /user [post]

func DeleteUserHandler

func DeleteUserHandler(ctx *gin.Context)

@Summary Delete User @Description Delete a user @Tags User @Accept json @Producer json @Security ApiKeyAuth @param Authorization header string true "Authorization" @Param id query string true "User identification" @Success 200 {object} DeleteUserResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Router /user [delete]

func InitializeHandler

func InitializeHandler()

func ListUsersHandler

func ListUsersHandler(ctx *gin.Context)

@Summary List Users @Description List all Users @Tags User @Accept json @Producer json @Security ApiKeyAuth @param Authorization header string true "Authorization" @Success 200 {object} ListUsersResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Router /users [get]

func LoginUserHandler

func LoginUserHandler(ctx *gin.Context)

@Summary Login User @Description Login a user @Tags Auth @Accept json @Producer json @Param request body LoginUserRequest true "Request body" @Success 201 {object} LoginUserResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /login [post]

func RecoveryPasswordHandler

func RecoveryPasswordHandler(ctx *gin.Context)

@Summary Recovery Password @Description Recovery Password @Tags Auth @Accept json @Produce json @Param request body RecoveryPasswordRequest true "Request body" @Success 200 {object} RecoveryPasswordResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /auth/recovery-password [post]

func SendCodeForMailHandler

func SendCodeForMailHandler(ctx *gin.Context)

@Summary Send Code For Mail @Description Send Code For Mail @Tags Auth @Accept json @Produce json @Param request body SendCodeForMailRequest true "Request body" @Success 200 {object} SendCodeForMailResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /auth/send-code-for-mail [post]

func ShowUserHandler

func ShowUserHandler(ctx *gin.Context)

@Summary Show User @Description Show a user @Tags User @Accept json @Producer json @Security ApiKeyAuth @param Authorization header string true "Authorization" @Param id query string true "User identification" @Success 200 {object} ShowUserResponse @Failure 404 {object} ErrorResponse @Router /user [get]

func UpdateUserHandler

func UpdateUserHandler(ctx *gin.Context)

@Summary Update User @Description Update a new user @Tags User @Accept json @Producer json @Security ApiKeyAuth @param Authorization header string true "Authorization" @Param id query string true "User identification" @Param request body UpdateUserRequest true "Request body" @Success 201 {object} UpdateUserResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /user [put]

Types

type CreateUserRequest

type CreateUserRequest struct {
	Name      string `json:"name"`
	Address   string `json:"address"`
	Phone     string `json:"phone"`
	Email     string `json:"email"`
	Password  string `json:"password"`
	CompanyId uint   `json:"companyId"`
	Type      string `json:"type"`
}

func (*CreateUserRequest) Validate

func (r *CreateUserRequest) Validate() error

type CreateUserResponse

type CreateUserResponse struct {
	Message string               `json:"message"`
	Data    schemas.UserResponse `json:"data"`
}

type DeleteUserResponse

type DeleteUserResponse struct {
	Message string               `json:"message"`
	Data    schemas.UserResponse `json:"data"`
}

type ErrorResponse

type ErrorResponse struct {
	Message   string `json:"message"`
	ErrorCode string `json:"errorCode"`
}

type ListUsersResponse

type ListUsersResponse struct {
	Message string                 `json:"message"`
	Data    []schemas.UserResponse `json:"data"`
}

type LoginUserRequest

type LoginUserRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

func (*LoginUserRequest) Validate

func (r *LoginUserRequest) Validate() error

type LoginUserResponse

type LoginUserResponse struct {
	Message string `json:"message"`
	Token   string `json:"token"`
}

type RecoveryPasswordRequest

type RecoveryPasswordRequest struct {
	Code            string `json:"code"`
	Password        string `json:"password"`
	NewPassword     string `json:"new_password"`
	PasswordConfirm string `json:"password_confirm"`
}

func (*RecoveryPasswordRequest) Validate

func (r *RecoveryPasswordRequest) Validate() error

type RecoveryPasswordResponse

type RecoveryPasswordResponse struct {
	Message string `json:"message"`
}

type SendCodeForMailRequest

type SendCodeForMailRequest struct {
	Email string `json:"email"`
}

func (*SendCodeForMailRequest) Validate

func (r *SendCodeForMailRequest) Validate() error

type SendCodeForMailResponse

type SendCodeForMailResponse struct {
	Message string `json:"message"`
}

type ShowUserResponse

type ShowUserResponse struct {
	Message string               `json:"message"`
	Data    schemas.UserResponse `json:"data"`
}

type UpdateUserRequest

type UpdateUserRequest struct {
	Name      string `json:"name"`
	Address   string `json:"address"`
	Phone     string `json:"phone"`
	Email     string `json:"email"`
	Password  string `json:"password"`
	CompanyId uint   `json:"companyId"`
	Type      string `json:"type"`
}

func (*UpdateUserRequest) Validate

func (r *UpdateUserRequest) Validate() error

type UpdateUserResponse

type UpdateUserResponse struct {
	Message string               `json:"message"`
	Data    schemas.UserResponse `json:"data"`
}

Jump to

Keyboard shortcuts

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