barter

package
v0.0.0-...-0e0a2a2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BarterService

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

func NewBarterService

func NewBarterService(_ context.Context, param BarterServiceParam) *BarterService

func (*BarterService) ExchangeGoods

func (s *BarterService) ExchangeGoods(ctx context.Context, param ExchangeGoodsParam) common.Error

func (*BarterService) ListMyGoods

func (s *BarterService) ListMyGoods(ctx context.Context, param ListMyGoodsParam) ([]barter.Good, common.Error)

func (*BarterService) ListOthersGoods

func (s *BarterService) ListOthersGoods(ctx context.Context, param ListOthersGoodsParam) ([]barter.Good, common.Error)

func (*BarterService) PostGood

func (s *BarterService) PostGood(ctx context.Context, param PostGoodParam) (*barter.Good, common.Error)

func (*BarterService) RemoveMyGood

func (s *BarterService) RemoveMyGood(ctx context.Context, param RemoveGoodParam) common.Error

type BarterServiceParam

type BarterServiceParam struct {
	GoodRepo GoodRepository
}

type ExchangeGoodsParam

type ExchangeGoodsParam struct {
	Trader        barter.Trader
	RequestGoodID int
	TargetGoodID  int
}

type GoodRepository

type GoodRepository interface {
	CreateGood(ctx context.Context, param barter.Good) (*barter.Good, common.Error)
	GetGoodByID(ctx context.Context, id int) (*barter.Good, common.Error)
	ListGoods(ctx context.Context) ([]barter.Good, common.Error)
	ListGoodsByOwner(ctx context.Context, ownerID int) ([]barter.Good, common.Error)
	UpdateGoods(ctx context.Context, goods []barter.Good) ([]barter.Good, common.Error)
	DeleteGoodByID(ctx context.Context, id int) common.Error
}

type ListMyGoodsParam

type ListMyGoodsParam struct {
	Trader barter.Trader
}

type ListOthersGoodsParam

type ListOthersGoodsParam struct {
	Trader barter.Trader
}

type PostGoodParam

type PostGoodParam struct {
	Trader   barter.Trader
	GoodName string
}

type RemoveGoodParam

type RemoveGoodParam struct {
	Trader barter.Trader
	GoodID int
}

Directories

Path Synopsis
Package automock is a generated GoMock package.
Package automock is a generated GoMock package.

Jump to

Keyboard shortcuts

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