user

package
v0.0.0-...-692bca9 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUserServiceImpl

func NewUserServiceImpl(
	userRepository user.UserRepository,
	threadRepository thread.ThreadRepository,
	idGenerator generator.IDGenerator,
	passwordGenerator generator.PasswordGenerator,
	tokenGenerator generator.TokenGenerator,
) *userServiceImpl

Types

type UserService

type UserService interface {
	Register(ctx context.Context, p payload.Register) (id string, err error)

	Login(ctx context.Context, p payload.Login) (r response.Login, err error)

	GetAll(
		ctx context.Context,
		accessorUserID,
		orderBy,
		status string,
		page,
		limit uint,
		keyword string,
	) (r response.Pagination[response.User], err error)

	GetOwn(
		ctx context.Context,
		accessorUserID,
		accessorUsername string,
	) (r response.User, err error)

	GetByUsername(
		ctx context.Context,
		accessorUserID,
		username string,
	) (r response.User, err error)

	ChangeBannedState(
		ctx context.Context,
		accessorRole string,
		username string,
	) (err error)

	ChangeFollowingState(
		ctx context.Context,
		accessorUserID,
		usernameToFollow string,
	) (err error)

	GetAllThreadByUsername(
		ctx context.Context,
		accessorUserID,
		username string,
		page uint,
		limit uint,
	) (rs response.Pagination[response.ManyThread], err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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