Welcome to Guest room booking application To access our api calls, kindly follow the below procedure
OS : Linux or Ubuntu Database : MysqlVersion > 5.1 Softwares : gradle & gradlew, Postman Make sure Internet connected for first time run to download gradle dependency files
This REST Api Application was build on Spring BOOT bundled with JPA
Clone or download this repository
Run db_schema.sql file or execute the code line by line in mysql command line
Add your database username, password and dbname in application.properties file under build/resources/main folder
Run below command cd guest-room-app ./gradlew bootRun
Kindly wait for few minutes to download Gradle dependency file Once you see, Completed initialization msg in console Hit and try the available below API Calls
Method Type : POST URL : http://localhost:8080/register DATA JSON : { "name" : "SANKAR", "username" : "sankar", "emailId" : "[email protected]", "mobileNumber" : 9080706050, "password" : ""sankar", "userType" : "HouseOwner" }
Note : userType can be "HouseOwner" | "Customer"
Method Type : GET URL : http://localhost:8080/login DATA JSON : { "username" : "sankar", "password" : "sankar" }
Method Type : GET URL : http://localhost:8080/logout
Method Type : POST URL : http://localhost:8080/addRoom DATA JSON : { "name" : "Room1", "address" : "ABC Street, Thendral Nagar, Sattur", "floorSize" : "240x320ft", "numberOfBeds" : 3, "maximumDays" : 10, "amountPerDay" : 800.00 }
Method Type : GET URL : http://localhost:8080/room RESPONSE SAMPLE : [ { "name" : "Room1", "address" : "ABC Street, Thendral Nagar, Sattur", "floorSize" : "240x320ft", "numberOfBeds" : 3, "maximumDays" : 10, "amountPerDay" : 800.00 }, { "name" : "Room2", "address" : "ABC Street, Thendral Nagar, Sattur", "floorSize" : "240x320ft", "numberOfBeds" : 3, "maximumDays" : 8, "amountPerDay" : 800.00 } ]
Method Type : GET URL : http://localhost:8080/room/{id} RESPONSE SAMPLE : { "name" : "Room1", "address" : "ABC Street, Thendral Nagar, Sattur", "floorSize" : "240x320ft", "numberOfBeds" : 3, "maximumDays" : 10, "amountPerDay" : 800.00 }
Method Type : POST URL : http://localhost:8080/bookRoom DATA JSON : { "roomId" : 1, "startDate" : "15/10/2020", "endDate" : "20/10/2020" }