REST - API for our Service-Manager
The optional request parameter boolean address
indicates whether the address should be included or not.
- GET returns all employees in form of EmployeeResources
- POST adds the employee from the request body in form of a EmployeeDto and returns the saved EmployeeResource
- DELETE deletes all employees and returns them in form of EmployeeResources
- GET skips the first
skip
employees and then returns theamount
following employees in form of EmployeeResources
- GET returns the employee with the specified
id
in form of a EmployeeResource - PUT saves the employee from the request body, in form of a EmployeeDto, with the specified
id
and returns the old employee with the specified id in form of a EmployeeResource - DELETE removes the employee with the specified
id
and returns him in form of a EmployeeResource
- GET returns the number of available employees
Address from LocationIQ
public class AddressResource {
private String house_number;
private String road;
private String hamlet;
private String village;
private String county;
private String state;
private String postcode;
private String country;
private String country_code;
private String town;
private String street;
private String city;
}
public class EmployeeDto {
private String name;
private String address;
}
public class EmployeeResource {
private int id;
private String name;
private AddressResource address;
private String latitude;
private String longitude;
}