user

package
v0.0.0-...-dbbbfb2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginBody

type LoginBody struct {
	Login    string
	Password string
}

type UpdateUserData

type UpdateUserData struct {
	ID           uint
	Login        *string
	Password     *string
	AccessRights *models.AccessRight
}

type User

type User struct{}

func (*User) Create

func (u *User) Create() gin.HandlerFunc

Get @Summary Create user @Description Создает пользователя. Доступен только админу @Tags User @Param data body UserData true "Данные пользователя для создания" @Produce json @Success 200 {object} map[string]models.User @Failure 404 {object} string @Router /user [post]

func (*User) Delete

func (u *User) Delete() gin.HandlerFunc

Get @Summary Delete user @Description Удаляет пользователя. Доступен только админу @Tags User @Param id path int true "id User" @Produce json @Success 200 {object} map[string]models.User @Failure 404 {object} string @Router /user/{id} [delete]

func (*User) Get

func (a *User) Get() gin.HandlerFunc

Get @Summary Get list of user ids @Description Возращает список id всех доступных user @Tags User @Produce json @Success 200 {object} map[string][]uint @Failure 500 {object} string @Failure 404 {object} string @Router /user [get]

func (*User) GetId

func (a *User) GetId() gin.HandlerFunc

Get @Summary Get concrete Action @Description Возращает Action соответсвующую указанному ID @Tags Actions @Param id path int true "id Action" @Produce json @Success 200 {object} map[string]models.User @Failure 404 {object} string @Router /user/{id} [get]

func (*User) Login

func (a *User) Login() gin.HandlerFunc

Get @Summary LOGIN @Description login @Tags Actions @Param data body LoginBody true "id Action" @Produce json @Success 200 {object} map[string]models.User @Failure 404 {object} string @Router /user/login [post]

func (*User) Update

func (u *User) Update() gin.HandlerFunc

Get @Summary Update user @Description Обновляет пользователя. Доступен только админу @Tags User @Param data body UpdateUserData true "Данные пользователя для обновления" @Produce json @Success 200 {object} map[string]models.User @Failure 404 {object} string @Router /user [put]

func (*User) WriteRoutes

func (u *User) WriteRoutes(rg *gin.RouterGroup)

type UserData

type UserData struct {
	Login        string             `validate:"required"`
	Password     string             `validate:"required"`
	AccessRights models.AccessRight `validate:"required"`
}

Jump to

Keyboard shortcuts

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