REST - API for our Service-Manager
The optional request parameter boolean address
indicates whether the address should be included or not.
- GET returns all services in form of ServiceResources
- POST adds a service from the request body in form of a ServiceDto and returns the the saved ServiceResource
- DELETE deletes all services and returns them in form of ServiceResources
- GET skips the first
skip
services and then returns theamount
following services in form of ServiceResources
- GET returns the service with the specified
id
in form of a ServiceResource - PUT saves the service from the request body, in form of a ServiceDto, with the specified
id
and returns the old service with the specifiedid
in form of a ServiceResource - DELETE removes the service with the specified
id
and returns it in form of a ServiceResource
- GET returns the number of available services
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 EmployeeResource {
private int id;
private String name;
private AddressResource address;
private String latitude;
private String longitude;
}
public class ServiceDto {
private String name;
private int employeeId;
private Date date;
private String address;
}
public class ServiceResource {
private int id;
private String name;
private EmployeeResource employee;
private Date date;
private AddressResource address;
private String latitude;
private String longitude;
}