usecases

package
v0.0.0-...-0e8bb44 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDecodeUser = myerrors.NewErrorBadFormatRequest("Некорректный json пользователя")
)
View Source
var ErrWrongUserID = myerrors.NewErrorBadFormatRequest("Попытка изменить данные другого пользователя")

Functions

func ValidatePartOfUserWithoutPassword

func ValidatePartOfUserWithoutPassword(r io.Reader) (*models.UserWithoutPassword, error)

func ValidateUserWithoutPassword

func ValidateUserWithoutPassword(r io.Reader) (*models.UserWithoutPassword, error)

Types

type IUserStorage

type IUserStorage interface {
	GetUserWithoutPasswordByID(ctx context.Context, id uint64) (*models.UserWithoutPassword, error)
	UpdateUser(ctx context.Context, userID uint64, updateData map[string]interface{}) (*models.UserWithoutPassword, error)
}

type UserService

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

func NewUserService

func NewUserService(userStorage IUserStorage) (*UserService, error)

func (*UserService) GetUserWithoutPasswordByID

func (u *UserService) GetUserWithoutPasswordByID(ctx context.Context,
	userID uint64,
) (*models.UserWithoutPassword, error)

func (*UserService) UpdateUser

func (u *UserService) UpdateUser(ctx context.Context, r io.Reader,
	isPartialUpdate bool, userID uint64,
) (*models.UserWithoutPassword, error)

Jump to

Keyboard shortcuts

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