Package com.mt.ecommerce.product.service
Class CategoryService
java.lang.Object
com.mt.ecommerce.product.service.CategoryService
Service class for managing product categories.
Provides methods for adding, updating, deleting, and retrieving categories.
-
Constructor Summary
ConstructorsConstructorDescriptionCategoryService
(CategoryRepository categoryRepository, ImageCategoryRepository imageCategoryRepository, ImageRepository imageRepository) -
Method Summary
Modifier and TypeMethodDescriptionaddCategory
(CategoryBO categoryBO, String userName) Adds a new category.void
deleteCategory
(UUID categoryId, UUID vendorId) Deletes a category.getCategory
(UUID vendorId, int pageNo, int size) Retrieves categories for a specific vendor with pagination.void
updateCategory
(CategoryBO categoryBO, String userName) Updates an existing category.
-
Constructor Details
-
CategoryService
public CategoryService(CategoryRepository categoryRepository, ImageCategoryRepository imageCategoryRepository, ImageRepository imageRepository)
-
-
Method Details
-
addCategory
Adds a new category.- Parameters:
categoryBO
- the category information to adduserName
- the username of the user adding the category- Returns:
- the added CategoryBO
-
getCategory
Retrieves categories for a specific vendor with pagination.- Parameters:
vendorId
- the ID of the vendor whose categories are to be retrievedpageNo
- the page number for paginationsize
- the number of records per page- Returns:
- a list of CategoryBO objects representing the vendor's categories
-
updateCategory
Updates an existing category.- Parameters:
categoryBO
- the category information to updateuserName
- the username of the user updating the category
-
deleteCategory
Deletes a category.- Parameters:
categoryId
- the ID of the category to deletevendorId
- the ID of the vendor
-