ProductService

@Service
class ProductService(mongoTemplate: MongoTemplate)

Example service demonstrating Konduct usage

Constructors

Link copied to clipboard
constructor(mongoTemplate: MongoTemplate)

Functions

Link copied to clipboard

Count active products

Link copied to clipboard

Find product by ID

Link copied to clipboard

Get all active products

Link copied to clipboard

Get out of stock products

Link copied to clipboard

Get premium products (price 1000 and rating 4.5)

Link copied to clipboard
fun getProductsByPriceRange(minPrice: Double, maxPrice: Double): List<Product>

Get products in a price range

Link copied to clipboard

Get products by tags

Link copied to clipboard
fun getTopRatedProducts(limit: Int = 10): List<Product>

Get top rated products

Link copied to clipboard
fun searchProductsByCategory(category: String, page: Int, pageSize: Int): List<Product>

Search products by category with pagination