controllers

package
v0.0.0-...-aef14cd Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Unlicense Imports: 11 Imported by: 0

Documentation

Overview

Package controllers REST-ful (endpoints) конечные точки REST веб-сервиса.

Package controllers REST-ful (endpoints) конечные точки REST веб-сервиса.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func GetAuthController

func GetAuthController(prop env.Properties) *Auth

GetAuthController — потокобезопасное (thread-safe) создание REST веб-сервиса аутентификации.

func (*Auth) SignInUser

func (a *Auth) SignInUser(c *fiber.Ctx) error

SignInUser handler

@Summary		аутентификация
@Description	аутентификация пользователя
@Tags			Auth
@Accept			json
@Produce		json
@Security		none
@Param			request			body		dto.SignInRequest	true	"Формат запроса JSON (body)"
@Success		200				{object}	dto.SignInRequest	"пользователь успешно аутентифицирован"
@Failure		400				{object}	dto.SignInRequest	"неверный формат запроса"
@Failure		401				{object}	dto.SignInRequest	"неверная пара логин/пароль"
@Failure		500				{string}	string			"Internal Server Error"
@Router			/api/auth/login	[post]

type Favorites

type Favorites struct {
	// contains filtered or unexported fields
}

func GetFavoritesController

func GetFavoritesController(prop env.Properties) *Favorites

GetFavoritesController — потокобезопасное (thread-safe) создание REST веб-сервиса основной бизнес логики.

func (*Favorites) Get

func (f *Favorites) Get(c *fiber.Ctx) error

Get handler

@Summary		избранное
@Description	избранное получения инструмента для пользователя
@Tags			Favorites
@Accept			json
@Produce		json
@Security		none
@Param			request			body		dto.Favorites	true	"Формат запроса JSON (body)"
@Success		200				{object}	dto.Favorites	"получение инструмента"
@Failure		400				{object}	string	"неверный формат запроса"
@Failure		401				{object}	string	"пользователь не авторизован"
@Failure		500				{string}	string	"Internal Server Error"
@Router			/api/favorites/get	[post]

func (*Favorites) GetForUser

func (f *Favorites) GetForUser(c *fiber.Ctx) error

GetForUser handler

@Summary		избранное
@Description	избранное получения инструментов для пользователя
@Security	Bearer
@Tags			Favorites
@Accept			json
@Produce		json
@Security		BearerAuth
@Success		200				{array}		[]dto.Favorites	"успешная обработка запроса"
@Failure		401				{object}	string	"пользователь не авторизован"
@Failure		500				{string}	string	"Internal Server Error"
@Router			/api/favorites/get 	[get]

func (*Favorites) Set

func (f *Favorites) Set(c *fiber.Ctx) error

Set handler

@Summary		избранное
@Description	избранное сохранение инструмента для пользователя
@Tags			Favorites
@Accept			json
@Produce		json
@Security		none
@Param			request			body		dto.Favorites	true	"Формат запроса JSON (body)"
@Success		200				{object}	dto.Favorites	"получение инструмента"
@Failure		400				{object}	string	"неверный формат запроса"
@Failure		401				{object}	string	"пользователь не авторизован"
@Failure		500				{string}	string	"Internal Server Error"
@Router			/api/favorites/set	[post]

Directories

Path Synopsis
Package dto TODO.
Package dto TODO.

Jump to

Keyboard shortcuts

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