This project is an API gives Employee information hosted at Heroku, and using MOCK data provided from Mockaroo.
API is using Quarkus framework.
Dev Note: Please note that this is a learner project may not have best practices but aim to help you to figure out some issues.
Database: heroku.com / Postgres
Data: Mock data from https://www.mockaroo.com/
Entity: Panache
This project uses Heroku Database. After creating a heroku account and database you can import the following heroku database to run this project. Load the dump into your local database using the pg_restore tool. If objects exist in a local copy of the database already, you might run into inconsistencies when doing a pg_restore. Please, visit this link for further help.
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
You can run your application in dev mode that enables live coding using:
./mvnw compile quarkus:dev
@GET
/employees?page={id}&limit={limit}&orderBy={columnName}&sortBy={asc|desc}&filterByDepartment={department}
Lists all employees from Employees table. application/json
page: activepage
limit: rows per page
orderBy: order data by provided columnname, default: id
sortBy: sort data by ascending or descending default: asc
filterByDepartment: filter data by provided department name\
curl -X -GET http://localhost:8080/employees?page={id}&limit={limit}&sortBy={id}
@GET
Lists all employees in a specific department from Employees table. application/json
page: activepage
limit: rows per page
department: department name
curl -X -GET http://localhost:8080/employees/department/{limit}/{page}/{department}
@GET
Returns employee detail by id. application/json
curl -X -GET http://localhost:8080/employees/{id}
@GET
Returns employee detail by e-mail. application/json
curl -X -GET http://localhost:8080/employees/email/{email}
@GET
Returns employee detail by e-mail. application/json
curl -X -GET http://localhost:8080/employees/jobtitle/{jobtitle}
@DELETE
Deletes employee by id.
curl -X -DELETE http://localhost:8080/employees/{id}
@DELETE
Deletes multiple employees by ids at once.
curl -X -DELETE http://localhost:8080/employees?ids=77,78,79
@POST
Creates new employee.
curl -X POST -H "Content-Type: application/json" \
-d '{"firstName": "John", "lastName": "Doe", "email": "[email protected]", status: 1, "dateOfBirth": "10/10/1988", "jobTitle": "Front End Developer", "department": "Finance"}' \
http://localhost:8080/employees