update
This commit is contained in:
@@ -31,3 +31,13 @@ func (s *productSvc) GetProductsByIDs(ctx mycontext.Context, ids []int64, partne
|
||||
|
||||
return products, nil
|
||||
}
|
||||
|
||||
func (s *productSvc) GetProductsByPartnerID(ctx mycontext.Context, search entity.ProductSearch) ([]*entity.Product, int64, error) {
|
||||
products, total, err := s.repo.GetProductsByPartnerID(ctx, search)
|
||||
|
||||
if err != nil {
|
||||
return nil, 0, errors.Wrap(err, "failed to get products by partner ID")
|
||||
}
|
||||
|
||||
return products, total, nil
|
||||
}
|
||||
|
||||
@@ -8,11 +8,13 @@ import (
|
||||
type Repository interface {
|
||||
GetProductsByIDs(ctx mycontext.Context, ids []int64, partnerID int64) ([]*entity.Product, error)
|
||||
GetProductDetails(ctx mycontext.Context, productIDs []int64, partnerID int64) (*entity.ProductDetails, error)
|
||||
GetProductsByPartnerID(ctx mycontext.Context, req entity.ProductSearch) ([]*entity.Product, int64, error)
|
||||
}
|
||||
|
||||
type Service interface {
|
||||
GetProductsByIDs(ctx mycontext.Context, ids []int64, partnerID int64) ([]*entity.Product, error)
|
||||
GetProductDetails(ctx mycontext.Context, productIDs []int64, partnerID int64) (*entity.ProductDetails, error)
|
||||
GetProductsByPartnerID(ctx mycontext.Context, search entity.ProductSearch) ([]*entity.Product, int64, error)
|
||||
}
|
||||
|
||||
type productSvc struct {
|
||||
|
||||
Reference in New Issue
Block a user