biz

package
v0.0.0-...-fa05059 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCodeDuplicateEmailNumber              uint16 = 1062
	ErrDuplicateEmail                               = errors.New("duplicate email")
	ErrUserNotFound                                 = errors.New("user not found")
	ErrInvalidUserOrPassword                        = errors.New("username or password is incorrect")
	ErrNewPasswordAndConfirmPasswordNotMatch        = errors.New("two passwords do not match")
)
View Source
var ProviderSet = wire.NewSet(NewUserBiz)

ProviderSet is biz providers.

Functions

This section is empty.

Types

type UserBiz

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

func NewUserBiz

func NewUserBiz(ui UserInteractive, l *zap.Logger) *UserBiz

func (*UserBiz) ChangePassword

func (uu *UserBiz) ChangePassword(ctx context.Context, email string, password string, newPassword string, confirmPassword string) error

func (*UserBiz) DeleteUser

func (uu *UserBiz) DeleteUser(ctx context.Context, email string, password string, uid int64) error

func (*UserBiz) GetProfileByUserID

func (uu *UserBiz) GetProfileByUserID(ctx context.Context, UserID int64) (profile domain.Profile, err error)

func (*UserBiz) Login

func (uu *UserBiz) Login(ctx context.Context, email string, password string) (domain.User, error)

func (*UserBiz) SignUp

func (uu *UserBiz) SignUp(ctx context.Context, u domain.User) error

func (*UserBiz) UpdateProfile

func (uu *UserBiz) UpdateProfile(ctx context.Context, profile domain.Profile) (err error)

type UserInteractive

type UserInteractive interface {
	CreateUser(ctx context.Context, u domain.User) error
	FindByID(ctx context.Context, id int64) (domain.User, error)
	FindByPhone(ctx context.Context, phone string) (domain.User, error)
	FindByEmail(ctx context.Context, email string) (domain.User, error)
	ChangePassword(ctx context.Context, email string, newPassword string) error
	DeleteUser(ctx context.Context, email string, uid int64) error
	UpdateProfile(ctx context.Context, profile domain.Profile) error
	GetProfile(ctx context.Context, userId int64) (domain.Profile, error)
}

Jump to

Keyboard shortcuts

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