Documentation ¶
Index ¶
- Variables
- type Order
- type OrderQueueReceiverRepo
- type OrderQueueReceiverUsecase
- type OrderQueueRepo
- type OrderQueueUsecase
- type OrderRepo
- type OrderUsecase
- type SeckillGoods
- type SeckillGoodsRepo
- type SeckillGoodsUsecase
- func (g SeckillGoodsUsecase) DecrGoodsStock(ctx context.Context, id int64) error
- func (g SeckillGoodsUsecase) GetSeckillGoods(ctx context.Context, id int64) (*SeckillGoods, error)
- func (g SeckillGoodsUsecase) GetSeckillGoodsOver(ctx context.Context, id int64) bool
- func (g SeckillGoodsUsecase) SetSeckillGoodsOver(ctx context.Context, id int64) error
- type SeckillOrder
- type SeckillOrderRepo
- type SeckillOrderUsecase
- func (uc *SeckillOrderUsecase) CreateSeckillOrder(ctx context.Context, o *SeckillOrder) error
- func (uc *SeckillOrderUsecase) GetOrder(ctx context.Context, id int64) (*SeckillOrder, error)
- func (uc *SeckillOrderUsecase) PostOrder(ctx context.Context, o *SeckillOrder) error
- func (uc *SeckillOrderUsecase) SendKafka(ctx context.Context, order *SeckillOrder) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewOrderUsecase, NewSeckillOrderUsecase, NewOrderQueueUsecase, NewSeckillGoodsUsecase, NewOrderQueueReceiverUsecase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type OrderQueueReceiverRepo ¶
type OrderQueueReceiverUsecase ¶
type OrderQueueReceiverUsecase struct {
// contains filtered or unexported fields
}
func NewOrderQueueReceiverUsecase ¶
func NewOrderQueueReceiverUsecase(repo OrderQueueReceiverRepo, logger log.Logger) *OrderQueueReceiverUsecase
func (*OrderQueueReceiverUsecase) CreateQueue ¶
func (uc *OrderQueueReceiverUsecase) CreateQueue(ctx context.Context) error
type OrderQueueRepo ¶
type OrderQueueUsecase ¶
type OrderQueueUsecase struct {
// contains filtered or unexported fields
}
func NewOrderQueueUsecase ¶
func NewOrderQueueUsecase(repo OrderQueueRepo, logger log.Logger) *OrderQueueUsecase
func (*OrderQueueUsecase) CreateQueue ¶
func (uc *OrderQueueUsecase) CreateQueue(ctx context.Context) error
type OrderUsecase ¶
type OrderUsecase struct {
// contains filtered or unexported fields
}
func NewOrderUsecase ¶
func NewOrderUsecase(repo OrderRepo, logger log.Logger) *OrderUsecase
type SeckillGoods ¶
type SeckillGoods struct { GoodsId int64 SeckillPrice float64 StockCount int64 StartDate time.Time EndDate time.Time }
SeckillGoods 定义对应数据库实体
type SeckillGoodsRepo ¶
type SeckillGoodsRepo interface { GetGoods(ctx context.Context, id int64) (*SeckillGoods, error) DecrGoodsStock(ctx context.Context, id int64) error GetGoodsOver(ctx context.Context, GoodsId int64) bool SetGoodsOver(ctx context.Context, GoodsId int64) error }
SeckillGoodsRepo 定义方法
type SeckillGoodsUsecase ¶
type SeckillGoodsUsecase struct {
// contains filtered or unexported fields
}
func NewSeckillGoodsUsecase ¶
func NewSeckillGoodsUsecase(repo SeckillGoodsRepo, logger log.Logger) *SeckillGoodsUsecase
func (SeckillGoodsUsecase) DecrGoodsStock ¶
func (g SeckillGoodsUsecase) DecrGoodsStock(ctx context.Context, id int64) error
func (SeckillGoodsUsecase) GetSeckillGoods ¶
func (g SeckillGoodsUsecase) GetSeckillGoods(ctx context.Context, id int64) (*SeckillGoods, error)
func (SeckillGoodsUsecase) GetSeckillGoodsOver ¶
func (g SeckillGoodsUsecase) GetSeckillGoodsOver(ctx context.Context, id int64) bool
func (SeckillGoodsUsecase) SetSeckillGoodsOver ¶
func (g SeckillGoodsUsecase) SetSeckillGoodsOver(ctx context.Context, id int64) error
type SeckillOrder ¶
type SeckillOrderRepo ¶
type SeckillOrderRepo interface { CreateSeckillOrder(ctx context.Context, seckillOrder *SeckillOrder) error PostSeckillOrder(ctx context.Context, seckillOrder *SeckillOrder) error GetSeckillOrder(ctx context.Context, id int64) (*SeckillOrder, error) SendKafkaOrder(ctx context.Context, order *SeckillOrder) error }
type SeckillOrderUsecase ¶
type SeckillOrderUsecase struct {
// contains filtered or unexported fields
}
func NewSeckillOrderUsecase ¶
func NewSeckillOrderUsecase(repo SeckillOrderRepo, logger log.Logger) *SeckillOrderUsecase
func (*SeckillOrderUsecase) CreateSeckillOrder ¶
func (uc *SeckillOrderUsecase) CreateSeckillOrder(ctx context.Context, o *SeckillOrder) error
func (*SeckillOrderUsecase) GetOrder ¶
func (uc *SeckillOrderUsecase) GetOrder(ctx context.Context, id int64) (*SeckillOrder, error)
func (*SeckillOrderUsecase) PostOrder ¶
func (uc *SeckillOrderUsecase) PostOrder(ctx context.Context, o *SeckillOrder) error
func (*SeckillOrderUsecase) SendKafka ¶
func (uc *SeckillOrderUsecase) SendKafka(ctx context.Context, order *SeckillOrder) error
Click to show internal directories.
Click to hide internal directories.