Class CatalogService

java.lang.Object
org.mybatis.jpetstore.service.CatalogService

@Service public class CatalogService extends Object
The Class CatalogService.
Author:
Eduardo Macarron
  • Constructor Details

    • CatalogService

      public CatalogService(CategoryMapper categoryMapper, ItemMapper itemMapper, ProductMapper productMapper)
      Instantiates a new catalog service.
      Parameters:
      categoryMapper - the category mapper
      itemMapper - the item mapper
      productMapper - the product mapper
  • Method Details

    • getCategoryList

      public List<Category> getCategoryList()
      Gets the category list.
      Returns:
      the category list
    • getCategory

      public Category getCategory(String categoryId)
      Get category.
      Parameters:
      categoryId - the category id
      Returns:
      the category
    • getProduct

      public Product getProduct(String productId)
      Get product.
      Parameters:
      productId - the product id
      Returns:
      the product
    • getProductListByCategory

      public List<Product> getProductListByCategory(String categoryId)
      Get product list by category.
      Parameters:
      categoryId - the category id
      Returns:
      the list
    • searchProductList

      public List<Product> searchProductList(String keywords)
      Search product list.
      Parameters:
      keywords - the keywords
      Returns:
      the list
    • getItemListByProduct

      public List<Item> getItemListByProduct(String productId)
      Get item list by product.
      Parameters:
      productId - the product id
      Returns:
      the list
    • getItem

      public Item getItem(String itemId)
      Get item.
      Parameters:
      itemId - the item id
      Returns:
      the item
    • isItemInStock

      public boolean isItemInStock(String itemId)
      Is item in stock.
      Parameters:
      itemId - the item id
      Returns:
      true, if successful