Spring Boot RestFull application with MongoDB.
- Download The Project
- Go to the project folder
- Run following command
mvn eclipse:eclipse
mvn clean compile
mvn spring-boot:run
Request Type - GET Request URL :
http://localhost:8888/users/[email protected]&userName=Bhupesh SIngh Padiyar&password=welcome1&role=Admin
Response -
{
"user": {
"id": "5bc6aebb99af53197c230297",
"userId": "[email protected]",
"userName": "Bhupesh SIngh Padiyar",
"password": "welcome1",
"role": "Admin",
"createdDate": "2018-10-17T03:38:35.675+0000",
"updateDate": null
},
"message": "User created successfully",
"status": "1"
}
Request Type - GET Request URL :
http://localhost:8888/users/read?id=5bc6aebb99af53197c230297
Response:
{
"message": "User found successfully",
"user": {
"id": "5bc6aebb99af53197c230297",
"userId": "[email protected]",
"userName": "Bhupesh SIngh Padiyar",
"password": "welcome1",
"role": "Admin",
"createdDate": "2018-10-17T03:38:35.675+0000",
"updateDate": null
},
"status": "1"
}
Request Type - GET Request URL :
http://localhost:8888/users/read-all
Response:
{
"message": "Users found successfully",
"users": [
{
"id": "5bc6aebb99af53197c230297",
"userId": "[email protected]",
"userName": "Bhupesh SIngh Padiyar",
"password": "welcome1",
"role": "Admin",
"createdDate": "2018-10-17T03:38:35.675+0000",
"updateDate": null
},
{
"id": "5bc6b38199af5309d029d54b",
"userId": "[email protected]",
"userName": "Ram",
"password": "welcome2",
"role": "User",
"createdDate": "2018-10-17T03:58:57.214+0000",
"updateDate": null
}
],
"status": "1"
}
Request Type - GET Request URL :
http://localhost:8888/users/delete?id=5bc6b38199af5309d029d54b
Response:
{
"message": "User deleted successfully",
"status": "1"
}