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

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Goods

type Goods struct {
	Id    int64
	Title string
	Intro string
}

type GoodsRepo

type GoodsRepo interface {
	GetGoods(ctx context.Context, id int64) (*Goods, error)
}

type GoodsUsecase

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

func NewGoodsUsecase

func NewGoodsUsecase(repo GoodsRepo, logger log.Logger) *GoodsUsecase

func (*GoodsUsecase) Get

func (uc *GoodsUsecase) Get(ctx context.Context, id int64) (*Goods, error)

type OrderGoods

type OrderGoods struct {
	Id         int64
	OrderId    int64
	GoodsTitle string
}

type Orders

type Orders struct {
	Id  int64
	Sn  string
	Uid int64
}

定义表结构体

type OrdersRepo

type OrdersRepo interface {
	GetOrders(ctx context.Context, id int64) (*Orders, error)
	ListOrders(ctx context.Context) (*Orders, error)
	CreateOrders(ctx context.Context, orders Orders) error
	UpdateOrders(ctx context.Context, orders Orders) error
}

定义接口

type OrdersUsecase

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

func NewOrdersUsecase

func NewOrdersUsecase(repo OrdersRepo, logger log.Logger) *OrdersUsecase

定义注入方法

func (*OrdersUsecase) CreateOrders

func (m *OrdersUsecase) CreateOrders(ctx context.Context, orders Orders) error

func (*OrdersUsecase) GetOrders

func (m *OrdersUsecase) GetOrders(ctx context.Context, id int64) (*Orders, error)

提供给service调用的方法

Jump to

Keyboard shortcuts

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