A simple API endpoint developed using Java Spring Boot to display Employees' Salary.
- Use Case
- QuickStart
- Java Version
- Architecture
- Database
- Design Consideration
- Coding Style and Standard
- The user of
SalaryViewer
can update "users" by uploading a csv file to/users
via POST request. - The user of
SalaryViewer
can view "users" by accessing to/users
via GET request.
- Clone this repository.
- Run
.\gradlew bootrun
on a terminal. - Navigate to http://localhost:8080/swagger-ui.html
- Try out the APIs with the webpage similar as below:
Java 12
User -> **Controller** -> **Service** -> **DAO** -> Database
**Controller**
: Used to handle web requests.**Service**
: Services that handle business logics.**DAO**
: Spring Data JPA Feature, create repository implementations automatically, at runtime, from a repository interface.
h2 Database (in memory database)
-
The maximum file upload limit is 2MB as a csv file containing 100,000 users is approximately 1MB file size.
-
User CSV File has the following specifications:
- The file must have headers
name
andsalary
. - Column
salary
must be a number between 0 to 4000. - Column
name
must not be empty. - Each row must have same amount of columns.
- Fields with embedded line breaks must be quoted.
- Fields with embedded coma breaks must be quoted.
- Double quotes can only be used to quote the fields, they are not allowed to be embedded inside the field.
- The file must have headers
- Google Coding Style (eclipse-java-google-style.xml)
- Codacy