application

package
v3.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 10 Imported by: 7

Documentation

Index

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL