The Employee Management System is a Java Spring Boot application designed to manage employees within an organization. It provides functionalities to add, retrieve, update, and delete employee records, as well as sending email notifications for certain actions.
To run the Employee Management System, you'll need:
- Java Development Kit (JDK) version 8 or higher
- Apache Maven
- MySQL or another compatible database
Follow these steps to set up the project:
# Clone the repository to your local machine:
git clone https://github.com/your/repository.git
# Navigate to the project directory:
cd employee-management-system
# Build the project using Maven:
mvn clean install
Update the database configuration in the application.properties file with your database credentials:
spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name
spring.datasource.username=your_username
spring.datasource.password=your_password
Run the application:
mvn clean spring-boot:run
Once the application is running, you can interact with it using HTTP requests. Below are the available endpoints:
To add an employee, send a POST request to the following endpoint:
POST /employees
To retrieve information about a specific employee, send a GET request to the following endpoint, replacing {id}
with the employee's ID:
GET /employees/{id}
To retrieve a list of all employees, send a GET request to the following endpoint. You can paginate the results by providing optional query parameters:
GET /employees?page={pageNumber}&size={pageSize}&sort={sortBy}
To update information about a specific employee, send a PUT request to the following endpoint, replacing {id}
with the employee's ID:
PUT /employees/{id}
To delete a specific employee, send a DELETE request to the following endpoint, replacing {id}
with the employee's ID:
DELETE /employees/{id}
To retrieve the Nth manager of a specific employee, send a GET request to the following endpoint, replacing {id}
with the employee's ID and {n}
with the level of the manager:
GET /employees/{id}/manager?level={n}
Make sure to replace {id}
, {pageNumber}
, {pageSize}
, {sortBy}
, and {n}
with the appropriate values when making requests.
Contributions to the Employee Management System are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name
). - Make your changes.
- Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature-name
). - Create a new Pull Request.