Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.showcase.synapse.sales
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
com.showcase.synapse
com.showcase.synapse.sales
Commits
cd37e104
Commit
cd37e104
authored
Sep 13, 2023
by
lemin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
2cb2a4a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
SalesQueryHandler.java
...owcase/synapse/sales/query/handler/SalesQueryHandler.java
+13
-4
ProductRepository.java
.../showcase/synapse/sales/repository/ProductRepository.java
+8
-0
No files found.
src/main/java/com/showcase/synapse/sales/query/handler/SalesQueryHandler.java
View file @
cd37e104
...
@@ -5,8 +5,10 @@ import java.util.List;
...
@@ -5,8 +5,10 @@ import java.util.List;
import
org.axonframework.queryhandling.QueryHandler
;
import
org.axonframework.queryhandling.QueryHandler
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
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.GetSalesQuery
;
import
com.showcase.synapse.sales.query.GetSalesQuery
;
import
com.showcase.synapse.sales.repository.ProductRepository
;
import
com.showcase.synapse.sales.repository.SalesRepository
;
import
com.showcase.synapse.sales.repository.SalesRepository
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
...
@@ -17,12 +19,19 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -17,12 +19,19 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@Slf4j
public
class
SalesQueryHandler
{
public
class
SalesQueryHandler
{
private
final
SalesRepository
productRepository
;
private
final
SalesRepository
salesRepository
;
private
final
ProductRepository
productRepository
;
@QueryHandler
@QueryHandler
protected
List
<
SalesEntity
>
on
(
GetSalesQuery
query
)
{
protected
List
<
SalesEntity
>
getSalesList
(
GetSalesQuery
query
)
{
log
.
info
(
"---product query---"
);
log
.
info
(
"---getSalesList query---"
);
return
productRepository
.
findAll
();
return
salesRepository
.
findAll
();
}
@QueryHandler
protected
List
<
ProductEntity
>
getProducts
(
GetSalesQuery
query
)
{
log
.
info
(
"---getProducts query---"
);
return
productRepository
.
findAll
();
}
}
}
}
src/main/java/com/showcase/synapse/sales/repository/ProductRepository.java
0 → 100644
View file @
cd37e104
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
>
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment