controllers

package
v0.0.0-...-4b80146 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeUser

type SafeUser struct {
	Id           int
	UserName     string
	FullName     string
	RoleId       int
	CreationDate string
}

type UpdateReporter

type UpdateReporter struct {
	AppPath    string
	ConfigPath string
	ConfStruct globals.Config
}

func (*UpdateReporter) ChangeAccountPassword

func (u *UpdateReporter) ChangeAccountPassword(c *gin.Context)

ChangeAccountPassowrd Change an account's password

@Summary		Change password
@Description	Change password
@Tags			user
@Accept			json
@Produce		json
@Param			name	path	string	true	"User name"
@Param			changePassword	body	model.PasswordChange	true	"Password data"
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/user/name/{name} [patch]

func (*UpdateReporter) CreateRole

func (u *UpdateReporter) CreateRole(c *gin.Context)

CreateUser Register a role for user rights assignment

@Summary		Register role
@Description	Add a new role
@Tags			role
@Accept			json
@Produce		json
@Param			role	body	model.Role	true	"Role data"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/role [post]

func (*UpdateReporter) CreateUser

func (u *UpdateReporter) CreateUser(c *gin.Context)

CreateUser Register a user for authentication and authorization

@Summary		Register user
@Description	Add a new user
@Tags			user
@Accept			json
@Produce		json
@Param			user	body	model.ProposedUser	true	"User Data"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/user [post]

func (*UpdateReporter) DeleteRole

func (u *UpdateReporter) DeleteRole(c *gin.Context)

DeleteRole Remove a role

@Summary		Delete role
@Description	Delete a role
@Tags			role
@Accept			json
@Produce		json
@Param			roleId	path	int	true	"Role Id"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/role/{roleId} [delete]

func (*UpdateReporter) DeleteUser

func (u *UpdateReporter) DeleteUser(c *gin.Context)

DeleteUser Remove a user for authentication and authorization

@Summary		Delete user
@Description	Delete a user
@Tags			user
@Accept			json
@Produce		json
@Param			name	path	string	true	"User name"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/user/name/{name} [delete]

func (*UpdateReporter) GetHealth

func (u *UpdateReporter) GetHealth(c *gin.Context)

GetHealth Retrieve the health of the service

@Summary		Retrieve overall health of the service
@Description	Retrieve overall health of the service
@Tags			serviceHealth
@Produce		json
@Success		200	{object}	model.HealthCheck
@Failure		500	{object}	model.HealthCheck
@Router			/health [get]

func (*UpdateReporter) GetRoleById

func (u *UpdateReporter) GetRoleById(c *gin.Context)

GetRoleById Retrieve a role by its Id

@Summary		Retrieve a role by its Id
@Description	Retrieve a role by its Id
@Tags			role
@Produce		json
@Param			roleId	path int true "Role ID"
@Security		BasicAuth
@Success		200	{object}	model.Role
@Failure		400	{object}	model.FailureMsg
@Router			/role/id/{roleId} [get]

func (*UpdateReporter) GetRoleByName

func (u *UpdateReporter) GetRoleByName(c *gin.Context)

GetRoleByName Retrieve a role by its role name

@Summary		Retrieve a role by its role name
@Description	Retrieve a role by its role name
@Tags			role
@Produce		json
@Param			roleName	path string true "Role Name"
@Security		BasicAuth
@Success		200	{object}	model.Role
@Failure		400	{object}	model.FailureMsg
@Router			/role/name/{roleName} [get]

func (*UpdateReporter) GetRoles

func (u *UpdateReporter) GetRoles(c *gin.Context)

GetRoles Retrieve list of all roles

@Summary		Retrieve list of all roles
@Description	Retrieve list of all roles
@Tags			role
@Produce		json
@Security		BasicAuth
@Success		200	{object}	model.RolesList
@Failure		400	{object}	model.FailureMsg
@Router			/roles [get]

func (*UpdateReporter) GetUserById

func (u *UpdateReporter) GetUserById(c *gin.Context)

GetUserById Retrieve a user by their Id

@Summary		Retrieve a user by their Id
@Description	Retrieve a user by their Id
@Tags			user
@Produce		json
@Param			id	path int true "User ID"
@Success		200	{object}	SafeUser
@Failure		400	{object}	model.FailureMsg
@Router			/user/id/{id} [get]

func (*UpdateReporter) GetUserByUserName

func (u *UpdateReporter) GetUserByUserName(c *gin.Context)

GetUserByName Retrieve a user by their UserName

@Summary		Retrieve a user by their UserName
@Description	Retrieve a user by their UserName
@Tags			user
@Produce		json
@Param			name	path	string	true	"User name"
@Success		200	{object}	SafeUser
@Failure		400	{object}	model.FailureMsg
@Router			/user/name/{name} [get]

func (*UpdateReporter) GetUserId

func (u *UpdateReporter) GetUserId(c *gin.Context) (model.User, bool)

func (*UpdateReporter) GetUserStatus

func (u *UpdateReporter) GetUserStatus(c *gin.Context)

GetUserStatus Retrieve the active status of a user. Can be either 'enabled' or 'locked'

@Summary		Retrieve a user's active status. Can be either 'enabled' or 'locked'
@Description	Retrieve a user's active status
@Tags			user
@Accept			json
@Produce		json
@Param			name	path	string	true	"User name"
@Security		BasicAuth
@Success		200	{object}	model.UserStatusMsg
@Failure		400	{object}	model.FailureMsg
@Router			/user/name/{name}/status [get]

func (*UpdateReporter) GetUsers

func (u *UpdateReporter) GetUsers(c *gin.Context)

GetUsers Retrieve list of all users

@Summary		Retrieve list of all users
@Description	Retrieve list of all users
@Tags			user
@Produce		json
@Security		BasicAuth
@Success		200	{object}	model.UsersList
@Failure		400	{object}	model.FailureMsg
@Router			/users [get]

func (*UpdateReporter) GetUsersByRoleId

func (u *UpdateReporter) GetUsersByRoleId(c *gin.Context)

GetUsersByRoleId Retrieve list of users by role Id

@Summary        Retrieve list of users by role Id
@Description    Retrieve list of users by role Id
@Tags           user
@Produce        json
@Param          roleId	path int true "Role Id"
@Security	BasicAuth
@Success        200 {object}	model.UsersList
@Failure	400 {object}	model.FailureMsg
@Router		/users/roleId/{roleId} [get]

func (*UpdateReporter) SetUserRoleId

func (u *UpdateReporter) SetUserRoleId(c *gin.Context)

SetUserRoleId Set the role Id of a user

@Summary		Set a user's role Id
@Description	Set a user's role Id
@Tags			user
@Accept			json
@Produce		json
@Param			roleId	body	model.UserRoleId	true	"Role Id"
@Param			name	path	string	true	"User name"
@Security		BasicAuth
@Success		200 {object}	model.UserRoleIdMsg
@Failure		400 {object}	model.FailureMsg
@Router			/user/name/{name}/roleId [patch]

func (*UpdateReporter) SetUserStatus

func (u *UpdateReporter) SetUserStatus(c *gin.Context)

SetUserStatus Set the active status of a user. Can be either 'enabled' or 'locked'

@Summary		Set a user's active status. Can be either 'enabled' or 'locked'
@Description	Set a user's active status
@Tags			user
@Accept			json
@Produce		json
@Param			user	body	model.UserStatus	true	"User Data"
@Param			name	path	string	true "User name"
@Security		BasicAuth
@Success		200	{object}	model.UserStatusMsg
@Failure		400	{object}	model.FailureMsg
@Router			/user/name/{name}/status [patch]

Jump to

Keyboard shortcuts

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