Class AddressService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.wfm.locations.rs1.address.AddressService
@RestController
@RequestMapping("territory/locations/r1/addresses")
@Resource(logging=true)
public class AddressService
extends PrivateService
Services to manage addresses.
- Since:
- 16.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> batchPatch(@Size(min=1,max=200) @Valid List<DTOAddressBatchUpdate> batchInput) Update a batch of addresses by calling theAddressUpdateBatchEventorg.springframework.http.ResponseEntity<List<DTOIdentifier<Long>>> Create a batch of addresses by calling theAddressInsertBatchEventorg.springframework.http.ResponseEntity<Void> Geocodes the given address by calling theAddressGeocodeEventorg.springframework.http.ResponseEntity<Void> geocodingBatchSave(@Size(min=1,max=10) Collection<Long> ids) Geocodes the given set of addresses by calling theAddressGeocodingBatchSaveEventorg.springframework.http.ResponseEntity<DTOAddress> get(Long id, Collection<String> fields) Retrieves the required address.org.springframework.http.ResponseEntity<PageResponse<DTOAddress>> getCollection(@Valid Page page, Collection<String> fields, String order, @Valid DTOAddressSearchFilter filter) Retrieve the all stored addresses.org.springframework.http.ResponseEntity<Void> patch(Long id, @Valid DTOAddressUpdate input) Modifies the required address.org.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(@Valid DTOAddressInsert input) Create a new address.
-
Constructor Details
-
AddressService
public AddressService()
-
-
Method Details
-
getCollection
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTOAddress>> getCollection(@RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,name="_fields") Collection<String> fields, @RequestParam(required=false,name="_order") String order, @Valid @Valid DTOAddressSearchFilter filter) throws DAValidateException, DAException Retrieve the all stored addresses.AddressSearchEvent- Parameters:
page- the required result pagefields- the collection of fields the response will containorder- the ordering fieldfilter- the specifiedDTOAddressSearchFilter- Returns:
- the response containing the current result page
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
get
@GetMapping(value="{addressId:[0-9]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTOAddress> get(@PathVariable("addressId") Long id, @RequestParam(required=false,name="_fields") Collection<String> fields) throws DAValidateException, DAException Retrieves the required address.AddressLoadEvent- Parameters:
id- address idfields- the collection of fields the response will contain- Returns:
- the response containing the required address
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
post
@PostMapping(consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(@Valid @RequestBody @Valid DTOAddressInsert input) throws DAValidateException, DAException Create a new address.AddressInsertEvent- Parameters:
input- theDTOAddressInsert- Returns:
- the standard response containing the new address id
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
geocode
@PostMapping(value="{addressId:[0-9]+}/geocoding", produces="application/json") public org.springframework.http.ResponseEntity<Void> geocode(@PathVariable("addressId") Long id) throws DAValidateException, DAException Geocodes the given address by calling theAddressGeocodeEvent- Parameters:
id- the address id- Returns:
- a standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
patch
@PatchMapping(value="{addressId:[0-9]+}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patch(@PathVariable("addressId") Long id, @Valid @RequestBody @Valid DTOAddressUpdate input) throws DAValidateException, DAException Modifies the required address.AddressUpdateEvent- Parameters:
id- the address idinput- the address updateDTOAddressUpdate- Returns:
- a standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
batchPost
@PostMapping(value="/batch", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<List<DTOIdentifier<Long>>> batchPost(@Size(min=1,max=200) @Valid @RequestBody @Size(min=1,max=200) @Valid List<DTOAddressInsert> batchInput) throws DAValidateException, DAException Create a batch of addresses by calling theAddressInsertBatchEvent- Parameters:
batchInput- a list ofDTOAddressInsert- Returns:
- the standard response containing the list of new address ids
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
batchPatch
@PatchMapping(value="/batch", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> batchPatch(@Size(min=1,max=200) @Valid @RequestBody @Size(min=1,max=200) @Valid List<DTOAddressBatchUpdate> batchInput) throws DAValidateException, DAException Update a batch of addresses by calling theAddressUpdateBatchEvent- Parameters:
batchInput- a list ofDTOAddressBatchUpdate- Returns:
- the standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
geocodingBatchSave
@PostMapping(value="/geocoding/batch", produces="application/json") public org.springframework.http.ResponseEntity<Void> geocodingBatchSave(@Size(min=1,max=10) @RequestParam(name="ids") @Size(min=1,max=10) Collection<Long> ids) throws DAValidateException, DAException Geocodes the given set of addresses by calling theAddressGeocodingBatchSaveEvent- Parameters:
ids- the set of address ids- Returns:
- a standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-