biz

package
v0.0.0-...-c8c1909 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0, MIT Imports: 6 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotFound = errors.New("server not found")
)

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Address

type Address struct {
	Id       int64
	Name     string
	Mobile   string
	Address  string
	PostCode string
}

Address 结构体定义

type AddressRepo

type AddressRepo interface {
	CreateAddress(ctx context.Context, a *Address) (*Address, error)
	GetAddress(ctx context.Context, id int64) (*Address, error)
	ListAddress(ctx context.Context, uid int64) ([]*Address, error)
}

AddressRepo 接口定义

type AddressUseCase

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

func NewAddressUseCase

func NewAddressUseCase(repo AddressRepo, logger log.Logger) *AddressUseCase

func (*AddressUseCase) Create

func (uc *AddressUseCase) Create(ctx context.Context, uid int64, a *Address) (*Address, error)

func (*AddressUseCase) Get

func (uc *AddressUseCase) Get(ctx context.Context, id int64) (*Address, error)

func (*AddressUseCase) List

func (uc *AddressUseCase) List(ctx context.Context, uid int64) ([]*Address, error)

type Card

type Card struct {
	Id      int64
	CardNo  string
	CCV     string
	Expires string
}

Card 结构体定义

type CardRepo

type CardRepo interface {
	CreateCard(ctx context.Context, c *Card) (*Card, error)
	GetCard(ctx context.Context, id int64) (*Card, error)
	ListCard(ctx context.Context, uid int64) ([]*Card, error)
}

CardRepo 接口定义

type CardUseCase

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

func NewCardUseCase

func NewCardUseCase(repo CardRepo, logger log.Logger) *CardUseCase

func (*CardUseCase) Create

func (uc *CardUseCase) Create(ctx context.Context, c *Card) (*Card, error)

func (*CardUseCase) Get

func (uc *CardUseCase) Get(ctx context.Context, id int64) (*Card, error)

func (*CardUseCase) ListCard

func (uc *CardUseCase) ListCard(ctx context.Context, uid int64) ([]*Card, error)

type User

type User struct {
	Id       int64  `json:"id"`
	Username string `json:"username"`
	Password string
}

type UserRepo

type UserRepo interface {
	CreateUser(ctx context.Context, u *User) (*User, error)
	GetUser(ctx context.Context, id int64) (*User, error)
	VerifyPassword(ctx context.Context, u *User) (bool, error)
	FindByUsername(ctx context.Context, username string) (*User, 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, u *User) (*User, error)

func (*UserUseCase) Get

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

func (*UserUseCase) GetByUserName

func (*UserUseCase) Save

func (*UserUseCase) VerifyPassword

func (uc *UserUseCase) VerifyPassword(ctx context.Context, u *User) (bool, error)

Jump to

Keyboard shortcuts

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