Documentation
¶
Overview ¶
Package category provides business logic for category operations. It includes service layer functionality for category management with Redis caching.
Index ¶
- type CategoryService
- func (s *CategoryService) CreateCategory(ctx context.Context, category model.CreateCategoryRequest) (int64, error)
- func (s *CategoryService) DeleteCategory(ctx context.Context, id int) error
- func (s *CategoryService) GetCategoryByID(ctx context.Context, id int) (*sqlModel.Category, error)
- func (s *CategoryService) UpdateCategory(ctx context.Context, id int, category model.UpdateCategoryRequest) error
- type CategoryServiceInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
func (*CategoryService) CreateCategory ¶
func (s *CategoryService) CreateCategory(ctx context.Context, category model.CreateCategoryRequest) (int64, error)
func (*CategoryService) DeleteCategory ¶
func (s *CategoryService) DeleteCategory(ctx context.Context, id int) error
func (*CategoryService) GetCategoryByID ¶
func (*CategoryService) UpdateCategory ¶
func (s *CategoryService) UpdateCategory(ctx context.Context, id int, category model.UpdateCategoryRequest) error
type CategoryServiceInterface ¶
type CategoryServiceInterface interface { CreateCategory(ctx context.Context, category model.CreateCategoryRequest) (int64, error) GetCategoryByID(ctx context.Context, id int) (*sqlModel.Category, error) UpdateCategory(ctx context.Context, id int, category model.UpdateCategoryRequest) error DeleteCategory(ctx context.Context, id int) error }
func NewCategoryService ¶
func NewCategoryService(repo repository.DBRepository, logger *logger.Logger, cache *cache.Cache) CategoryServiceInterface
Click to show internal directories.
Click to hide internal directories.