Service for handling all customer related operations
- Authentication-Authorization Service
- MongoDB instance
Functionality | REST Endpoint | Parameters | Body | Response |
---|---|---|---|---|
Get Customer Information | GET /user/customer |
email - String | JSON string | |
Add Customer | POST /user/customer |
JSON string | JSON string | |
Edit Customer | PUT /user/customer |
JSON string | JSON string | |
Disable Customer | DELETE /user/customer |
JSON string | JSON string | |
Enable Customer | PATCH /user/customer |
JSON string | JSON string |
Edit the properties of application.yml file
# Eureka properties
eureka:
client:
fetch-registry: true
register-with-eureka: true
service-url:
defaultZone: address of the eureka server (Eg: http://localhost:8761/eureka)
instance:
hostname: specify the hostname of service here (Eg: localhost)
# Server properties
server:
port: port in which the customer service is to run (Eg: 8091)
# Application properties
spring:
application:
name: name of the application (Eg: CUSTOMER-SERVICE)
# MongoDB properties
data:
mongodb:
database: mongoDB database name (Eg: testWorkingDB)
host: name of mongoDB host (Eg: localhost)
port: port in which mongoDB is being run (Eg: 27017)
Service Registry should be started for successful execution of all queries.
In application.yml file, change the properties
Property | Value | Example |
---|---|---|
eureka_hostname | hostname of eureka server | service-registry |
service_hostname | hostname of service (try to use the same as in docker-compose) | customer-service |
mongodb_hostname | hostname of mongodb | customer-db |
mongodb_database_name | database name | customerDB |
Create docker bridge network: docker network create -d bridge pigihi-network
docker-compose can be used to run the application and the corresponding mongodb instance
- Go to project folder
- Open terminal and run
docker-compose up
- The application can be accessed at localhost:8091 (port 8091 is set in docker-compose)
- MongoDB port is set to 27016
To run only the application
- Go to project folder
- Open terminal and run
docker build .
- Run
docker run -p 8091:8091 docker_image_name
- The application can be accessed at localhost:8091
MongoDB should be run seperately and the configurations should be updated in application.yml
- Go to project folder
- Open terminal and run
./gradlew build
- Run
./gradlew bootRun