Commit 651a2112 authored by lemin's avatar lemin

commit

parent cd37e104
package com.showcase.synapse.sales.query;
public class GetProductsQuery {
}
...@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component; ...@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
import com.showcase.synapse.sales.entity.ProductEntity; import com.showcase.synapse.sales.entity.ProductEntity;
import com.showcase.synapse.sales.entity.SalesEntity; import com.showcase.synapse.sales.entity.SalesEntity;
import com.showcase.synapse.sales.query.GetProductsQuery;
import com.showcase.synapse.sales.query.GetSalesQuery; import com.showcase.synapse.sales.query.GetSalesQuery;
import com.showcase.synapse.sales.repository.ProductRepository; import com.showcase.synapse.sales.repository.ProductRepository;
import com.showcase.synapse.sales.repository.SalesRepository; import com.showcase.synapse.sales.repository.SalesRepository;
...@@ -29,7 +30,7 @@ public class SalesQueryHandler { ...@@ -29,7 +30,7 @@ public class SalesQueryHandler {
} }
@QueryHandler @QueryHandler
protected List<ProductEntity> getProducts(GetSalesQuery query) { protected List<ProductEntity> getProducts(GetProductsQuery query) {
log.info("---getProducts query---"); log.info("---getProducts query---");
return productRepository.findAll(); return productRepository.findAll();
} }
......
...@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service; ...@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
import com.showcase.synapse.sales.command.CreateSalesCommand; import com.showcase.synapse.sales.command.CreateSalesCommand;
import com.showcase.synapse.sales.entity.ProductEntity; import com.showcase.synapse.sales.entity.ProductEntity;
import com.showcase.synapse.sales.entity.SalesEntity; import com.showcase.synapse.sales.entity.SalesEntity;
import com.showcase.synapse.sales.query.GetProductsQuery;
import com.showcase.synapse.sales.query.GetSalesQuery; import com.showcase.synapse.sales.query.GetSalesQuery;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -44,7 +45,7 @@ public class SalesService { ...@@ -44,7 +45,7 @@ public class SalesService {
} }
public List<ProductEntity> getProducts() throws ExecutionException, InterruptedException { public List<ProductEntity> getProducts() throws ExecutionException, InterruptedException {
return queryGateway.query(new GetSalesQuery(), return queryGateway.query(new GetProductsQuery(),
ResponseTypes.multipleInstancesOf(ProductEntity.class)).get(); ResponseTypes.multipleInstancesOf(ProductEntity.class)).get();
} }
......
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