biz

package
v0.0.0-...-1018313 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 12 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound is user not found.
	ErrUserNotFound = errors.NotFound(v1.ErrorReason_USER_NOT_FOUND.String(), "user not found")
)

ProviderSet is biz providers.

Functions

This section is empty.

Types

type CarBiz

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

func NewCarBiz

func NewCarBiz(storage CarStorage) *CarBiz

func (*CarBiz) Create

func (this *CarBiz) Create(ctx context.Context, data map[string]interface{}) (id int, err error)

func (*CarBiz) Query

func (this *CarBiz) Query(ctx context.Context, req *common.QueryRequest) (*pbcar.CarQueryResponse, error)

type CarStorage

type CarStorage interface {
	Create(ctx context.Context, data map[string]interface{}) (id int, err error)
	Query(ctx context.Context, query *common.QueryRequest) (records []*curd.Car, count int, err error)
}

type DeptBiz

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

func NewDeptBiz

func NewDeptBiz(storage DeptStorage) *DeptBiz

func (*DeptBiz) Create

func (this *DeptBiz) Create(ctx context.Context, data map[string]interface{}) (id int, err error)

func (*DeptBiz) Query

func (this *DeptBiz) Query(ctx context.Context, req *common.QueryRequest) (*pbdept.DeptQueryResponse, error)

type DeptStorage

type DeptStorage interface {
	Create(ctx context.Context, data map[string]interface{}) (id int, err error)
	Query(ctx context.Context, query *common.QueryRequest) (records []*curd.Dept, count int, err error)
}

type Greeter

type Greeter struct {
	Hello string
}

Greeter is a Greeter model.

type GreeterRepo

type GreeterRepo interface {
	Save(context.Context, *Greeter) (*Greeter, error)
	Update(context.Context, *Greeter) (*Greeter, error)
	FindByID(context.Context, int64) (*Greeter, error)
	ListByHello(context.Context, string) ([]*Greeter, error)
	ListAll(context.Context) ([]*Greeter, error)
}

GreeterRepo is a Greater repo.

type GreeterUsecase

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

GreeterUsecase is a Greeter usecase.

func NewGreeterUsecase

func NewGreeterUsecase(repo GreeterRepo, logger log.Logger) *GreeterUsecase

NewGreeterUsecase new a Greeter usecase.

func (*GreeterUsecase) CreateGreeter

func (uc *GreeterUsecase) CreateGreeter(ctx context.Context, g *Greeter) (*Greeter, error)

CreateGreeter creates a Greeter, and returns the new Greeter.

type UserBiz

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

func NewUserBiz

func NewUserBiz(storage UserStorage) *UserBiz

func (*UserBiz) Create

func (this *UserBiz) Create(ctx context.Context, data map[string]interface{}) (id int, err error)

func (*UserBiz) Query

func (this *UserBiz) Query(ctx context.Context, req *common.QueryRequest) (*pbuser.UserQueryResponse, error)

type UserStorage

type UserStorage interface {
	Create(ctx context.Context, data map[string]interface{}) (id int, err error)
	Query(ctx context.Context, query *common.QueryRequest) (records []*curd.User, count int, err error)
}

Jump to

Keyboard shortcuts

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