initial commit
This commit is contained in:
23
internal/entity/repository.go
Normal file
23
internal/entity/repository.go
Normal file
@ -0,0 +1,23 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user