Class AccountService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.wfm.accounts.rs1.account.AccountService
@RestController
@RequestMapping("assets/accounts/r1/accounts")
@Resource(logging=true)
public class AccountService
extends PrivateService
Service to manage accounts
- Since:
- 16.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<List<DTOIdentifier<Long>>> Create a a list of accounts by calling theAccountInsertBatchEventorg.springframework.http.ResponseEntity<DTOAccount> get(Long accountId, Collection<String> fields) Retrieves the requiredDTOAccountby calling theAccountLoadEvent.org.springframework.http.ResponseEntity<PageResponse<DTOAccount>> getCollection(@Valid Page page, Collection<String> fields, String order, @Valid DTOAccountFilter filter) Returns the collection of all the stored accounts by calling theAccountSearchEvent.org.springframework.http.ResponseEntity<Void> patch(Long accountId, @Valid DTOAccountUpdate dto) Update an account by calling theAccountUpdateEventorg.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(@Valid DTOAccountInsert dto) Create a new account by calling theAccountInsertEvent
-
Constructor Details
-
AccountService
public AccountService()
-
-
Method Details
-
getCollection
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTOAccount>> getCollection(@RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,name="_fields") Collection<String> fields, @RequestParam(required=false,name="_order") String order, @Valid @Valid DTOAccountFilter filter) throws DAValidateException, DAException Returns the collection of all the stored accounts by calling theAccountSearchEvent.- Parameters:
page- thePagethat will contain the paginated resultfields- the collection of fields the response will containorder- the ordering fieldfilter- theDTOAccountFilter- Returns:
- the collection of
DTOAccount - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
get
@GetMapping(value="{accountId:[0-9]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTOAccount> get(@PathVariable("accountId") Long accountId, @RequestParam(required=false,name="_fields") Collection<String> fields) throws DAValidateException, DAException Retrieves the requiredDTOAccountby calling theAccountLoadEvent.- Parameters:
accountId- the account idfields- the collection of fields the response will contain- Returns:
- the response containing the loaded account
- 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 DTOAccountInsert dto) throws DAValidateException, DAException Create a new account by calling theAccountInsertEvent- Parameters:
dto- theDTOAccountInsert- Returns:
- the standard response containing the new account id
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
patch
@PatchMapping(value="{accountId:[0-9]+}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patch(@PathVariable("accountId") Long accountId, @Valid @RequestBody @Valid DTOAccountUpdate dto) throws DAValidateException, DAException Update an account by calling theAccountUpdateEvent- Parameters:
accountId- the account iddto- theDTOAccountUpdate- Returns:
- the 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<DTOAccountBatchInsert> dtos) throws DAValidateException, DAException Create a a list of accounts by calling theAccountInsertBatchEvent- Parameters:
dtos- the list ofDTOAccountBatchInsert- Returns:
- the standard response containing the list of new account ids
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-