Basic boot application to handle reviews for hotels
Microservices:
- Hotel
- User
- Reviews
DBMS: MySql
Junit Tests:
- Two Junit test cases for the controller of the Hotel. ( To display the concept )
Steps to run:
- Unzip the project
- Run the services on specified ports
- Add new hotel:
curl --location --request POST 'localhost:8000/hotel/add' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":6,
"name":"t3aj",
"city":"panjim",
"dateAvailable" : "09/09/2022",
"roomsRequired":2,
"star":5,
"cost":12,
"facility":{
"id":10,
"wifi":true
}
}'
- Update hotel:
curl --location --request PUT 'localhost:8000/hotel/update/6' \
--header 'Content-Type: application/json' \
--data-raw '{
"name":"taj",
"city":"panjim",
"dateAvailable" : "09/09/2022",
"roomsRequired":2,
"star":5,
"cost":12,
"facility":{
"id":0,
"wifi":true
}
}'
- Delete Hotel
curl --location --request DELETE 'localhost:8000/hotel/delete/6' \
--header 'Content-Type: application/json' \
}'
- Search Hotel ( query parameters include: city, date, rooms, stars, facilities(array) ) - response in sorted order:
curl --location --request GET 'localhost:8000/hotel/search?city=panjim'
- Add User
curl --location --request POST 'localhost:8080/user/add' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":1,
"name":"tom",
"city":"delhi"
}
'
- Update user
curl --location --request PUT 'localhost:8080/user/update/5' \
--header 'Content-Type: application/json' \
--data-raw '{
"name":"pom",
"city":"mumbai"
}
'
- Add review
curl --location --request POST 'localhost:8888/review/add' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":33,
"comment":"very nice",
"rating":"2",
"hotel":{
"id":6
},
"user":{
"id":1
}
}'
- Search Review ( query parameters include : hotelName, city, gender, rating):
curl --location --request GET 'localhost:8888/review/search?hotelName=taj&city=pune' \
--header 'Content-Type: application/json' \