You should develop an API which has this features:
- Should be a DispatcherServlet
- Should use Spring 3 (3.1 or 3.2)
- Should have a filter for only logged routes (described below)
- Only login page could be accessible without login
- Hibernate is optional but is a suggestion
- Should use maven (v3.0.5)
API should follow patterns as REST API, using HTTP methods as POST, PUT, DELETE, GET, etc. Should use default request like:
- Get all employees, route should be: GET /employees
- Get a single employee, route should be: GET /employee/1
- Get object using filters: GET /employees?limit=10&offset=10&sort=desc
REST [https://en.wikipedia.org/wiki/Representational_state_transfer]
- Objects must be persisted into a PostgreSQL database after each change;
- Objects need to be represented by a single entity object;
Entity: id(pk), name, responsibility(fk), wage(double), active(bool), responsible(fk)(optional)
Entity: id(pk), name(varchar), description(varchar)
Entity: id(pk), username(varchar), password(md5(varchar)), active(bool)
- Get a list of employees from a business;
- Get a list of actives/inactives employees (using query filter '?')
- Get a list of employees by responsibility;
- Add/update a single employee/responsibility (PUT/POST);
- Soft-delete an employee (solf-delete should turn false/true active field);
- Associate an employee to his responsible (using column pk responsible);
- Get a list of employees who I am responsible for;
- When DELETE a responsible, server should turn empty all employees which had this one as responsible;
- API must only respond when request is authorized using Basic Authentication (using user table for username and password);
- Otherwise API must respond with a 401 - Unauthorized;
- The only column possible null for entities is responsible into entity Employee. Every others are required;
- Rules described above should be implemented;
- Rules which are missing could be "created" by you and documented in some place;