Documentation ¶
Index ¶
- func CreateUserHandler(ctx *gin.Context)
- func DeleteUserHandler(ctx *gin.Context)
- func InitializeHandler()
- func ListUsersHandler(ctx *gin.Context)
- func LoginUserHandler(ctx *gin.Context)
- func RecoveryPasswordHandler(ctx *gin.Context)
- func SendCodeForMailHandler(ctx *gin.Context)
- func ShowUserHandler(ctx *gin.Context)
- func UpdateUserHandler(ctx *gin.Context)
- type CreateUserRequest
- type CreateUserResponse
- type DeleteUserResponse
- type ErrorResponse
- type ListUsersResponse
- type LoginUserRequest
- type LoginUserResponse
- type RecoveryPasswordRequest
- type RecoveryPasswordResponse
- type SendCodeForMailRequest
- type SendCodeForMailResponse
- type ShowUserResponse
- type UpdateUserRequest
- type UpdateUserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUserHandler ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ListUsersResponse ¶
type ListUsersResponse struct { Message string `json:"message"` Data []schemas.UserResponse `json:"data"` }
type LoginUserRequest ¶
func (*LoginUserRequest) Validate ¶
func (r *LoginUserRequest) Validate() error
type LoginUserResponse ¶
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"` }