services

package
v0.0.0-...-daa638b Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeService

type AttributeService struct {
	// contains filtered or unexported fields
}

func NewAttributeService

func NewAttributeService(repository interfaces.IAttributeRepository) *AttributeService

func (*AttributeService) Create

func (*AttributeService) Delete

func (s *AttributeService) Delete(ctx context.Context, id int) error

func (*AttributeService) Fetch

func (s *AttributeService) Fetch(ctx context.Context, page int, size int, sortBy string, orderBy string) (*dtos.AttributePaginatedDto, error)

func (*AttributeService) GetByID

func (s *AttributeService) GetByID(ctx context.Context, id int) (res *dtos.AttributeDto, err error)

func (*AttributeService) Search

func (s *AttributeService) Search(ctx context.Context, q string, page int, size int, sortBy string, orderBy string) (*dtos.AttributePaginatedDto, error)

func (*AttributeService) Update

type CategoryService

type CategoryService struct {
	// contains filtered or unexported fields
}

func NewCategoryService

func NewCategoryService(repository interfaces.ICategoryRepository) *CategoryService

func (*CategoryService) Create

func (*CategoryService) Delete

func (s *CategoryService) Delete(ctx context.Context, id int) error

func (*CategoryService) Fetch

func (s *CategoryService) Fetch(ctx context.Context, page int, size int, sortBy string, orderBy string) (*dtos.CategoryPaginatedDto, error)

func (*CategoryService) GetByID

func (s *CategoryService) GetByID(ctx context.Context, id int) (res *dtos.CategoryDto, err error)

func (*CategoryService) GetProducts

func (s *CategoryService) GetProducts(ctx context.Context, id int, page int, size int, sortBy string, orderBy string) (*dtos.CategoryProductsPaginatedDto, error)

func (*CategoryService) Search

func (s *CategoryService) Search(ctx context.Context, q string, page int, size int, sortBy string, orderBy string) (*dtos.CategoryPaginatedDto, error)

func (*CategoryService) Update

type ImageService

type ImageService struct {
	// contains filtered or unexported fields
}

func NewImageService

func NewImageService(repository interfaces.IImageRepository) *ImageService

func (*ImageService) Remove

func (s *ImageService) Remove(ctx context.Context, imageID int) error

func (*ImageService) Save

func (s *ImageService) Save(ctx context.Context, id int, fileheader *multipart.FileHeader) (int, error)

type ProductService

type ProductService struct {
	// contains filtered or unexported fields
}

func NewProductService

func NewProductService(repository interfaces.IProductRepository, imageService interfaces.IImageService) *ProductService

func (*ProductService) AddAttribute

func (*ProductService) AddImage

func (s *ProductService) AddImage(ctx context.Context, id int, fileheader *multipart.FileHeader) error

func (*ProductService) Create

func (*ProductService) CreateVariant

func (s *ProductService) CreateVariant(ctx context.Context, dto *dtos.CreateProductVariantDto) error

func (*ProductService) Delete

func (s *ProductService) Delete(ctx context.Context, id int) error

func (*ProductService) DeleteVariant

func (s *ProductService) DeleteVariant(ctx context.Context, id int, variantID int) error

func (*ProductService) Fetch

func (s *ProductService) Fetch(ctx context.Context, page int, size int, sortBy string, orderBy string) (*dtos.ProductPaginatedDto, error)

func (*ProductService) FetchVariants

func (s *ProductService) FetchVariants(ctx context.Context, id int, page int, size int, sortBy string, orderBy string) (*dtos.ProductVariantPaginatedDto, error)

func (*ProductService) GetAttributes

func (s *ProductService) GetAttributes(ctx context.Context, id int, variantID int) ([]*dtos.AttributeDto, error)

func (*ProductService) GetByID

func (s *ProductService) GetByID(ctx context.Context, id int) (res *dtos.ProductDto, err error)

func (*ProductService) GetImages

func (s *ProductService) GetImages(ctx context.Context, id int) ([]*dtos.ImageDto, error)

func (*ProductService) GetVariantByID

func (s *ProductService) GetVariantByID(ctx context.Context, id int, variantID int) (*dtos.ProductVariantDto, error)

func (*ProductService) RemoveAttribute

func (s *ProductService) RemoveAttribute(ctx context.Context, id int, variantID int, attributeID int) error

func (*ProductService) RemoveImage

func (s *ProductService) RemoveImage(ctx context.Context, id int, imageID int) error

func (*ProductService) Search

func (s *ProductService) Search(ctx context.Context, q string, page int, size int, sortBy string, orderBy string) (*dtos.ProductPaginatedDto, error)

func (*ProductService) SearchVariants

func (s *ProductService) SearchVariants(ctx context.Context, q string, id int, page int, size int, sortBy string, orderBy string, attrs []*dtos.AttributeSearchQueryDto) (*dtos.ProductVariantPaginatedDto, error)

func (*ProductService) Update

func (*ProductService) UpdateVariant

func (s *ProductService) UpdateVariant(ctx context.Context, dto *dtos.UpdateProductVariantDto) error

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(repository interfaces.IUserRepository, hasher hasher.Hasher) *UserService

func (*UserService) ChangePassword

func (s *UserService) ChangePassword(ctx context.Context, username string, dto *dtos.ChangePasswordDto) error

func (*UserService) ChangeUsername

func (s *UserService) ChangeUsername(ctx context.Context, username string, dto *dtos.ChangeUsernameDto) error

func (*UserService) Delete

func (s *UserService) Delete(ctx context.Context, username string) error

func (*UserService) Me

func (s *UserService) Me(ctx context.Context, username string) (res *dtos.UserDto, err error)

func (*UserService) Signin

func (s *UserService) Signin(ctx context.Context, dto *dtos.SigninDto) (token string, err error)

func (*UserService) Signup

func (s *UserService) Signup(ctx context.Context, dto *dtos.SignupDto) error

Jump to

Keyboard shortcuts

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