Documentation ¶
Index ¶
- type BarterService
- func (s *BarterService) ExchangeGoods(ctx context.Context, param ExchangeGoodsParam) common.Error
- func (s *BarterService) ListMyGoods(ctx context.Context, param ListMyGoodsParam) ([]barter.Good, common.Error)
- func (s *BarterService) ListOthersGoods(ctx context.Context, param ListOthersGoodsParam) ([]barter.Good, common.Error)
- func (s *BarterService) PostGood(ctx context.Context, param PostGoodParam) (*barter.Good, common.Error)
- func (s *BarterService) RemoveMyGood(ctx context.Context, param RemoveGoodParam) common.Error
- type BarterServiceParam
- type ExchangeGoodsParam
- type GoodRepository
- type ListMyGoodsParam
- type ListOthersGoodsParam
- type PostGoodParam
- type RemoveGoodParam
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 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 ListOthersGoodsParam ¶
type PostGoodParam ¶
type RemoveGoodParam ¶
Click to show internal directories.
Click to hide internal directories.