Class AccountContactService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.wfm.accounts.rs1.contact.AccountContactService
@RestController
@RequestMapping("assets/accounts/r1/accounts/{accountId}/contacts")
@Resource(logging=true)
public class AccountContactService
extends PrivateService
Services to manage the account contacts.
- Since:
- 16.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<DTOAccountContact> get(Long accountId, Long contactId, Collection<String> fields) Retrieves the requiredDTOAccountContactby calling from theAccountContactLoadEvent.org.springframework.http.ResponseEntity<PageResponse<DTOAccountContact>> getCollection(Long accountId, @Valid Page page, Collection<String> fields, String order, @Valid DTOAccountContactFilter filter) Returns the collection of all the stored account contacts by calling theAccountContactSearchEvent.org.springframework.http.ResponseEntity<Void> patch(Long accountId, Long contactId, @Valid DTOAccountContactUpdate dto) Update a contact by calling theAccountContactUpdateEvent.org.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(Long accountId, @Valid DTOAccountContactInsert input) Create a new account contact by calling theAccountContactInsertEvent.
-
Constructor Details
-
AccountContactService
public AccountContactService()
-
-
Method Details
-
getCollection
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTOAccountContact>> getCollection(@PathVariable("accountId") Long accountId, @RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,name="_fields") Collection<String> fields, @RequestParam(required=false,name="_order") String order, @Valid @Valid DTOAccountContactFilter filter) throws DAValidateException, DAException Returns the collection of all the stored account contacts by calling theAccountContactSearchEvent.- Parameters:
accountId- the account idpage- thePagethat will contain the paginated resultfields- the collection of fields the response will containorder- the ordering fieldfilter- the filterDTOAccountContactFilter- Returns:
- the collection of
DTOAccountContact - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
get
@GetMapping(value="{contactId:[0-9]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTOAccountContact> get(@PathVariable("accountId") Long accountId, @PathVariable("contactId") Long contactId, @RequestParam(required=false,name="_fields") Collection<String> fields) throws DAValidateException, DAException Retrieves the requiredDTOAccountContactby calling from theAccountContactLoadEvent.- Parameters:
accountId- the account idcontactId- the account contact idfields- the collection of fields the response will contain- Returns:
- the DTO response containing the loaded
DTOAccountContact - 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(@PathVariable("accountId") Long accountId, @Valid @RequestBody @Valid DTOAccountContactInsert input) throws DAValidateException, DAException Create a new account contact by calling theAccountContactInsertEvent.- Parameters:
accountId- the account idinput- theDTOAccountContactInsert- Returns:
- the standard response containing the new contact id
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
patch
@PatchMapping(value="{contactId:[0-9]+}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patch(@PathVariable("accountId") Long accountId, @PathVariable("contactId") Long contactId, @Valid @RequestBody @Valid DTOAccountContactUpdate dto) throws DAValidateException, DAException Update a contact by calling theAccountContactUpdateEvent.- Parameters:
accountId- the account idcontactId- the contact iddto- theDTOAccountContactUpdate- Returns:
- the standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-