Documentation ¶
Index ¶
- type ProductSearchService
- func (s *ProductSearchService) Find(ctx context.Context, searchRequest *application.SearchRequest) (*SearchResult, error)
- func (s *ProductSearchService) FindBy(ctx context.Context, attributeCode string, values []string, ...) (*SearchResult, error)
- func (s *ProductSearchService) Inject(searchService domain.SearchService, ...) *ProductSearchService
- type SearchResult
- type URLService
- func (s *URLService) Get(product domain.BasicProduct, variantCode string) (string, error)
- func (s *URLService) GetAbsolute(r *web.Request, product domain.BasicProduct, variantCode string) (string, error)
- func (s *URLService) GetNameParam(product domain.BasicProduct, variantCode string) string
- func (s *URLService) GetURLParams(product domain.BasicProduct, variantCode string) map[string]string
- func (s *URLService) Inject(r *web.Router, c ...) *URLService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProductSearchService ¶
type ProductSearchService struct {
// contains filtered or unexported fields
}
ProductSearchService - Application service that offers a more explicit way to search for product results - on top of the domain.ProductSearchService
func (*ProductSearchService) Find ¶
func (s *ProductSearchService) Find(ctx context.Context, searchRequest *application.SearchRequest) (*SearchResult, error)
Find return SearchResult with matched products - based on given input
func (*ProductSearchService) FindBy ¶
func (s *ProductSearchService) FindBy(ctx context.Context, attributeCode string, values []string, searchRequest *application.SearchRequest) (*SearchResult, error)
FindBy return SearchResult with matched products filtered by the given attribute - based on given input
func (*ProductSearchService) Inject ¶ added in v3.5.0
func (s *ProductSearchService) Inject( searchService domain.SearchService, paginationInfoFactory *utils.PaginationInfoFactory, logger flamingo.Logger, cfg *struct { DefaultPageSize float64 `inject:"config:commerce.product.pagination.defaultPageSize,optional"` }, ) *ProductSearchService
Inject dependencies
type SearchResult ¶
type SearchResult struct { Suggestions []searchdomain.Suggestion Products []domain.BasicProduct SearchMeta searchdomain.SearchMeta Facets searchdomain.FacetCollection PaginationInfo utils.PaginationInfo Promotions []searchdomain.Promotion Actions []searchdomain.Action }
SearchResult - much like the corresponding struct in search package, just that instead "Hits" we have a list of matching Products
type URLService ¶
type URLService struct {
// contains filtered or unexported fields
}
URLService to manage product urls
func (*URLService) Get ¶
func (s *URLService) Get(product domain.BasicProduct, variantCode string) (string, error)
Get a product variant url
func (*URLService) GetAbsolute ¶
func (s *URLService) GetAbsolute(r *web.Request, product domain.BasicProduct, variantCode string) (string, error)
GetAbsolute url for a product variant url
func (*URLService) GetNameParam ¶
func (s *URLService) GetNameParam(product domain.BasicProduct, variantCode string) string
GetNameParam retrieve the proper name parameter
func (*URLService) GetURLParams ¶
func (s *URLService) GetURLParams(product domain.BasicProduct, variantCode string) map[string]string
GetURLParams get product url params
func (*URLService) Inject ¶
func (s *URLService) Inject( r *web.Router, c *struct { GenerateSlug bool `inject:"config:commerce.product.generateSlug,optional"` SlugAttributecode string `inject:"config:commerce.product.slugAttributeCode,optional"` }, ) *URLService
Inject dependencies