biz

package
v0.0.0-...-c4f823d Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT, MIT Imports: 4 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewUserUsecase)

ProviderSet is biz providers.

Functions

This section is empty.

Types

type User

type User struct {
	ID        int64
	Username  string
	Phone     string
	Password  string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type UserRepo

type UserRepo interface {
	Register(ctx context.Context, user *User) (*User, error)
	Login(ctx context.Context, user *User) (*User, error)
	GetUserByPhone(ctx context.Context, phone string) (*User, error)
	UpdateUser(ctx context.Context, id int64, user *User) (*User, error)
}

type UserUsecase

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

func NewUserUsecase

func NewUserUsecase(repo UserRepo, logger log.Logger) *UserUsecase

func (*UserUsecase) GetUserByPhone

func (uc *UserUsecase) GetUserByPhone(ctx context.Context, phone string) (u *User, err error)

func (*UserUsecase) Login

func (uc *UserUsecase) Login(ctx context.Context, user *User) (*User, error)

func (*UserUsecase) Register

func (uc *UserUsecase) Register(ctx context.Context, user *User) (p *User, err error)

func (*UserUsecase) UpdateUser

func (uc *UserUsecase) UpdateUser(ctx context.Context, id int64, user *User) (*User, error)

Jump to

Keyboard shortcuts

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