usercontroller

package
v0.0.0-...-aa00036 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserController

type UserController struct {
	// users being binded in ValidateAndBind()
	User                     usermodel.UserModel
	UserDeleteModel          usermodel.UserDeleteModel
	UserWithIDFormIDModel    usermodel.UserWithIDFormIDModel
	UserWithoutPasswordModel usermodel.UserWithoutPasswordModel
	UserFilterModel          usermodel.UserFilterModel
	UserUpdateModel          usermodel.UserUpdateModel
	Service                  userservice.UserService
	AuthService              authservice.AuthService
}

func (*UserController) Create

func (uController *UserController) Create(ginCtx *gin.Context)

@Tags Users @Summary New user @Description Creates new user @ID create-user @Accept json @Produce json @Security BearerAuth @Success 200 {object} usermodel.UserWithToken @Param request body usermodel.UserSwaggerParams true "query params" @Param Accept-Language header string false "Language preference"

@Router /api/v1/user/create [post]

func (*UserController) Delete

func (uController *UserController) Delete(ginCtx *gin.Context)

@Tags Users @Summary Delete user @Description Deletes a user by given user id @ID Delete-User @Accept json @Produce json @Security BearerAuth @Success 200 {object} translator.TranslationSwaggerResponse @Param request body usermodel.UserDeleteModel true "query params" @Param Accept-Language header string false "Language preference"

@Router /api/v1/user/delete [delete]

func (*UserController) Fetch

func (uController *UserController) Fetch(ginCtx *gin.Context)

@Tags Users @Summary Get User @Description Get user details by id @ID get-user-by-id @Produce json @Security BearerAuth @Success 200 {object} usermodel.UserWithoutPasswordModel @Param id query string true "user id" Format(ObjectID) @Param Accept-Language header string false "Language preference"

@Router /api/v1/user/fetch [GET]

func (*UserController) FetchAll

func (uController *UserController) FetchAll(ginCtx *gin.Context)

@Tags Users @Summary List All Records @Description Get user details by id @ID fetch-all-users @Produce json @Security BearerAuth @Success 200 {object} usermodel.UserWithoutPasswordModel @Param page query string true "page number" int @Param limit query string true "limit number" int @Param Accept-Language header string false "Language preference"

@Router /api/v1/user/fetch-all [GET]

func (*UserController) Update

func (uController *UserController) Update(ginCtx *gin.Context)

@Tags Users @Summary Update User @Description Updates user informations by giving the Id @ID update-user-informations @Accept json @Produce json @Success 200 {object} usermodel.UserSwaggerParams @Param request body usermodel.UserUpdateSwaggerModel true "query params" @Param Accept-Language header string false "Language preference"

@Router /api/v1/user/update [put]

Jump to

Keyboard shortcuts

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