biz

package
v0.0.0-...-acbaf2f Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT, MIT Imports: 3 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 RegUser

type RegUser struct {
	Username     string
	PasswordHash string
}

注册用户信息的时候使用

type UpdateUser

type UpdateUser struct {
	PasswordHash string
}

更新用户信息的时候使用

type User

type User struct {
	Id       int64
	Username string
}

获取用户信息的时候使用

type UserRepo

type UserRepo interface {
	GetUser(ctx context.Context, id int64) (*User, error)
	CreateUser(ctx context.Context, user *RegUser) (id int64, err error)
	UpdateUser(ctx context.Context, id int64, user *UpdateUser) error
	DeleteUser(ctx context.Context, id int64) error
}

type UserUsecase

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

func NewUserUsecase

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

func (*UserUsecase) Create

func (uc *UserUsecase) Create(ctx context.Context, user *RegUser) (id int64, err error)

func (*UserUsecase) Delete

func (uc *UserUsecase) Delete(ctx context.Context, id int64) error

func (*UserUsecase) Get

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

func (*UserUsecase) Update

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

Jump to

Keyboard shortcuts

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