25 lines
511 B
Go
25 lines
511 B
Go
package storage
|
|
|
|
import (
|
|
crm "cake_crm/proto"
|
|
"context"
|
|
)
|
|
|
|
type Product struct {
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
// todo
|
|
}
|
|
|
|
type Breadcrumb struct {
|
|
Name string `json:"name"`
|
|
URL string `json:"url"`
|
|
}
|
|
|
|
type IStorage interface {
|
|
GetAllProducts(ctx context.Context) ([]Product, error)
|
|
GetProductByID(ctx context.Context, id int) (Product, error)
|
|
GetBreadcrumbs(ctx context.Context, id int) ([]Breadcrumb, error)
|
|
GetCatalog(ctx context.Context) ([]*crm.CatalogRsp_Category, error)
|
|
}
|