-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
435 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,5 @@ nbbuild/ | |
dist/ | ||
nbdist/ | ||
.nb-gradle/ | ||
|
||
\.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# trip-management-query | ||
|
||
Trip Management Query serves all the views of trip. It is the query service in CQRS for trip. | ||
|
||
## Features | ||
* Query Trips | ||
* Query by Trip ID | ||
* Query all trips | ||
* Query by User ID | ||
* Query by User ID and status | ||
|
||
# Demo | ||
To run this project from docker: | ||
* Make sure that the Docker daemon is installed and running. | ||
* Assemble this project. | ||
* Run ```docker-compose up --build``` from the root project. | ||
* On another terminal run ```docker ps``` to see which ports were assigned. | ||
|
||
# Development | ||
|
||
## Requirements | ||
* Docker 17.xx.x | ||
* JDK 1.8 | ||
* IntelliJ 2018 | ||
* Mongo 3.4 | ||
|
||
To run this project from docker: | ||
* Make sure that the Docker daemon is installed and running. | ||
* Assemble this project. | ||
* Run ```docker-compose up --build -f docker-compose-dev.yml``` from the root project. | ||
* Run the Gradle task 'application/bootrun' from IntelliJ. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '3' | ||
services: | ||
|
||
mongo: | ||
image: 'mongo:3.4.1' | ||
container_name: 'mongo' | ||
ports: | ||
- '27017:27017' | ||
volumes: | ||
- 'mongo:/data/db' | ||
rabbitmq: | ||
image: rabbitmq:management | ||
container_name: 'rabbitmq' | ||
ports: | ||
- "5672:5672" | ||
- "15672:15672" | ||
trip-management-cmd: | ||
image: aista/trip-management-cmd | ||
container_name: 'trip-management-cmd' | ||
environment: | ||
- RABBIT_HOST=rabbitmq | ||
- MONGO_HOST=mongo | ||
ports: | ||
- "8080" | ||
depends_on: | ||
- rabbitmq | ||
- mongo | ||
- discovery-service | ||
discovery-service: | ||
image: springcloud/eureka | ||
ports: | ||
- "8761:8761" | ||
container_name: eureka-server | ||
|
||
volumes: | ||
mongo: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...org/aitesting/microservices/tripmanagement/query/service/repositories/TripRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
package org.aitesting.microservices.tripmanagement.query.service.repositories; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
import org.aitesting.microservices.tripmanagement.common.events.TripStatus; | ||
import org.aitesting.microservices.tripmanagement.query.domain.models.Trip; | ||
import org.springframework.data.mongodb.repository.MongoRepository; | ||
|
||
public interface TripRepository extends MongoRepository<Trip, UUID> { | ||
List<Trip> findByUserId(UUID userId); | ||
|
||
List<Trip> findByUserIdAndStatus(UUID userId, TripStatus status); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring: | ||
application: | ||
name: trip-management-query | ||
|
||
server: | ||
port: ${APP_PORT:8080} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring: | ||
application: | ||
name: trip-management-query | ||
|
||
server: | ||
port: ${APP_PORT:8080} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.