Commit cd37e104 authored by lemin's avatar lemin

commit

parent 2cb2a4a1
......@@ -5,8 +5,10 @@ import java.util.List;
import org.axonframework.queryhandling.QueryHandler;
import org.springframework.stereotype.Component;
import com.showcase.synapse.sales.entity.ProductEntity;
import com.showcase.synapse.sales.entity.SalesEntity;
import com.showcase.synapse.sales.query.GetSalesQuery;
import com.showcase.synapse.sales.repository.ProductRepository;
import com.showcase.synapse.sales.repository.SalesRepository;
import lombok.RequiredArgsConstructor;
......@@ -17,12 +19,19 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class SalesQueryHandler {
private final SalesRepository productRepository;
private final SalesRepository salesRepository;
private final ProductRepository productRepository;
@QueryHandler
protected List<SalesEntity> on(GetSalesQuery query) {
log.info("---product query---");
return productRepository.findAll();
protected List<SalesEntity> getSalesList(GetSalesQuery query) {
log.info("---getSalesList query---");
return salesRepository.findAll();
}
@QueryHandler
protected List<ProductEntity> getProducts(GetSalesQuery query) {
log.info("---getProducts query---");
return productRepository.findAll();
}
}
package com.showcase.synapse.sales.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.showcase.synapse.sales.entity.ProductEntity;
public interface ProductRepository extends JpaRepository<ProductEntity, String> {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment