This is a simple Spring Boot application that demonstrates how to generate an Excel file from a list of users and download it using a RESTful API endpoint.
- Java
- Spring Boot
- Spring Data JPA
- Apache POI
- Lombok
- Add a new user
- Export all users to an Excel file
- Download the Excel file
-
Clone the repository:
git clone https://github.com/your-username/excel-file-generation.git
-
Navigate to the project folder:
cd excel-file-generation
-
Build the project:
If you're using Maven:
mvn clean package
If you're using Gradle:
./gradlew build
-
Run the application:
java -jar target/excel-file-generation-0.0.1-SNAPSHOT.jar
Once the application is up and running, you can access the following endpoints:
-
Add a new user:
POST /api/v1/newUser
-
Export all users to an Excel file
GET /api/v1/exportUsersToExcel
-
Add a new user:
POST /api/v1/newUser
Request Body
{ "userName": "John Doe", "city": "New York", "email": "john.doe@example.com" }
-
Export all users to an Excel file
GET /api/v1/exportUsersToExcel
This endpoint will export all users to an Excel file and download it.