diff options
author | romaingimbert <romain.gimbert@orange.com> | 2019-01-31 14:43:57 +0100 |
---|---|---|
committer | romaingimbert <romain.gimbert@orange.com> | 2019-01-31 14:43:57 +0100 |
commit | 2afa1a1b9b020c0ada15581658268e98b7219a64 (patch) | |
tree | 40e8a73f96aa278a4b99e064c894588d0a4ac9c8 /src/main | |
parent | cd65ca359cee4d5c46ca61df2c4d022f15ec08b6 (diff) |
return hub after creation
-change hubresource
Change-Id: I0a9f52ac3e4bebb20c4ef468c3f9d263cdc961c0
Issue-ID: EXTAPI-195
Signed-off-by: romaingimbert <romain.gimbert@orange.com>
Diffstat (limited to 'src/main')
-rwxr-xr-x | src/main/java/org/onap/nbi/apis/hub/HubResource.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/main/java/org/onap/nbi/apis/hub/HubResource.java b/src/main/java/org/onap/nbi/apis/hub/HubResource.java index d9ee2e5..6383265 100755 --- a/src/main/java/org/onap/nbi/apis/hub/HubResource.java +++ b/src/main/java/org/onap/nbi/apis/hub/HubResource.java @@ -60,18 +60,13 @@ public class HubResource extends ResourceManagement { MultiCriteriaRequestBuilder multiCriteriaRequestBuilder; @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity<Subscriber> createEventSubscription(@RequestBody Subscription subscription) { + public ResponseEntity<Object> createEventSubscription(@RequestBody Subscription subscription, + @RequestParam MultiValueMap<String, String> params) { logger.debug("POST request for subscription : {}", subscription); - subscription.setId(null); Subscriber subscriber = subscriptionService.createSubscription(subscription); + JsonRepresentation filter = new JsonRepresentation(params); + return this.createResponse(Subscription.createFromSubscriber(subscriber), filter); - URI location = ServletUriComponentsBuilder - .fromCurrentRequest() - .path("/{id}") - .buildAndExpand(subscriber.getId()) - .toUri(); - - return ResponseEntity.created(location).build(); } @GetMapping(value = "/{subscriptionId}", produces = MediaType.APPLICATION_JSON_VALUE) |