A comprehensive project for managing employee information, including adding, removing, updating, and retrieving employee details via a RESTful API.
- Java 11 or later
- Maven
- VS Code
- MySQL database
- Postman
- VS Code Extensions:
- Extension Pack for Java
- Spring Boot Extension Pack
-
Clone the repository from GitHub:
git clone https://github.com/your-repo/EmployeeManagementSystem.git
-
Navigate to the project directory:
cd EmployeeManagementSystem
-
Build the project:
mvn clean install
-
Create a MySQL database and update the database configuration in the
application.properties
file located insrc/main/resources
:spring.datasource.url=jdbc:mysql://your-mysql-host:your-mysql-port/your-database-name spring.datasource.username=your-database-username spring.datasource.password=your-database-password # Note: Password is removed from the project
-
Run the application:
mvn spring-boot:run
The following are the API endpoints available in this project:
Description: Get the welcome message for the Employee Management API.
Response:
Welcome to Employee Management
Description: Add a new employee to the database.
Request Body:
{
"name": "John Doe",
"designation": "Software Engineer",
"salary": 50000.0
}
Response:
Status: 201 Created
{
"id": 1,
"name": "John Doe",
"designation": "Software Engineer",
"salary": 50000.0
}
Description: Remove an existing employee from the database by ID.
Path Variable: ID
- The ID of the employee to be removed.
Response:
Status: 202 Accepted
"Remove Successfully"
Description: Find an employee by their ID.
Path Variable: ID
- The ID of the employee to be found.
Response:
Status: 202 Accepted
{
"id": 1,
"name": "John Doe",
"designation": "Software Engineer",
"salary": 50000.0
}
Description: Get a list of all employees.
Response:
Status: 202 Accepted
[
{
"id": 1,
"name": "John Doe",
"designation": "Software Engineer",
"salary": 50000.0
},
{
"id": 2,
"name": "Jane Smith",
"designation": "Senior Developer",
"salary": 60000.0
},
...
]
Description: Update an existing employee's information.
Path Variable: ID
- The ID of the employee to be updated.
Request Body:
{
"name": "Updated Employee",
"designation": "Updated Designation",
"salary": 70000.0
}
Response:
Status: 201 Created
{
"id": 1,
"name": "Updated Employee",
"designation": "Updated Designation",
"salary": 70000.0
}