24 lines
618 B
Go
24 lines
618 B
Go
package entity
|
|
|
|
import "context"
|
|
|
|
type GoodsItemRepository interface {
|
|
ListIter(context.Context, int) (<-chan GoodsItem, error)
|
|
List(context.Context) ([]GoodsItem, error)
|
|
Get(context.Context, string) (GoodsItem, error)
|
|
GetByCart(context.Context, int64) (GoodsItem, error)
|
|
|
|
UpsertMany(context.Context, ...GoodsItem) ([]GoodsItem, error)
|
|
}
|
|
|
|
type CategoryRepository interface {
|
|
List(context.Context) ([]Category, error)
|
|
Get(context.Context, int64) (Category, error)
|
|
|
|
Create(ctx context.Context, name string) (Category, error)
|
|
}
|
|
|
|
type Mapper interface {
|
|
CategoryNameToID(context.Context, string) (int64, error)
|
|
}
|