Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question - You are required to create a Employee Management Rest Api based Web application, where you will be developing CRUD ( Create , Read,Update

Question-
You are required to create a Employee Management Rest Api based Web application, where you will be developing CRUD(Create,Read,Update and Delete) functionality along with Sorting and some concepts of security.
Your Rest Api should be secure.And should have different endpoints for different operations-
1.Your application should be able to add roles in the database dynamically in the db.
Ex-
{
"name":"USER"
}
Where name specifies a role which can be assigned to a user that will be used for authentication purposes while interacting with the api.
2. Your application should be able to add Users in the db which can be used for authentication purposes.
Ex-
{
"username":"temp",
"password":"12345",
"roles":[{
"id":2,
"name":"USER"
}]
}
3. Now Your application should be able to add employees data in the db if and only if the authenticated user is ADMIN-
Ex-
{
"firstName":"gl",
"lastName":"postman",
"email":"postman@gamil.com"
}
4. Your application should provide an endpoint to list all the employees stored in the database.
Ex-
Response Body-
[
{
"id": 1,
"firstName": "Ujjawal",
"lastName": "Sharma",
"email": "fdfdfd@gmail.com"
},
{
"id": 2,
"firstName": "temp",
"lastName": "kaushik",
"email": "jdfdkfdjj@gmail.com"
},
{
"id": 3,
"firstName": "postman",
"lastName": "postman",
"email": "postman@gamil.com"
}
]
5. Your application should provide endpoint to fetch or get an employee record specifically based on the id of that employee-
Ex- Url- http://localhost:8080/api/employees/3
Response Body-
{
"id": 3,
"firstName": "postman",
"lastName": "postman",
"email": "postman@gamil.com"
}
6. Your application should provide an endpoint to update an existing employee record with the given updated json object.
Ex-
Object to be updated(raw->Json)-
{
"id":1,
"firstName":"postman",
"lastName":"postman",
"email":"postman@gamil.com"
}
Response Body after updation-
{
"id": 1,
"firstName": "postman",
"lastName": "postman",
"email": "postman@gamil.com"
}
7. Your application should also provide an endpoint to delete an existing employee record based on the id of the employee-
Ex-
Url- http://localhost:8080/api/employees/4
Response Body-
"Deleted employee id -4
8. Your application should provide an endpoint to fetch an employee by his/her first name and if found more than one record then list them all-
Ex-
Url- http://localhost:8080/api/employees/search/gl
Response Body-
[
{
"id": 11,
"firstName": "gl",
"lastName": "postman",
"email": "postman@gamil.com"
}
]
9. Your application should be able to list all employee records sorted on their first name in either ascending order or descending order .
Ex-
Url- http://localhost:8080/api/employees/sort?order=asc
OR
Url- http://localhost:8080/api/employees/sort?order=desc
------------------------------------------------------------------------------------------------------------------
Important instructions
i) You should use the MySQL for the whole project along with Spring JPA and Spring Security.
ii) Provide Screenshots of the operations(PostMan/Browser) along with code submission. (note -> Screenshots will one of the criterias while grading)
iii) You can also record your screen while demonstrating CRUD operation, upload on the drive and share the drive link along with code.
iv) Spring Boot Application must follow the standard project structure .
v) Code should follow naming conventions along with proper indentations. vi) You are free to choose any Rest client to interact with api while implementation.(Prefer PostMan)
Please follow all the instructions properly and I want complete code with CRUD and sorting with dao authentications.please go through the steps.add role dynamically in db as mention in step 1 and follow other steps.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

How does selection differ from recruitment ?

Answered: 1 week ago