Merge commit 'bf01ad8e00ea68c884f287b89b25393fe2ef8c7c' into wip-customer

* commit 'bf01ad8e00ea68c884f287b89b25393fe2ef8c7c':
  changed return type in POST /customers/{id}/toaccounts endpoint
This commit is contained in:
Andrew Revinsky (DART)
2016-03-23 00:23:08 +03:00

View File

@@ -5,11 +5,11 @@ import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.Cust
import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerResponse;
import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.ToAccountInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import rx.Observable;
/**
* Created by popikyardo on 03.02.16.
*/
@@ -31,9 +31,9 @@ public class CustomerController {
}
@RequestMapping(value = "/{id}/toaccounts", method = RequestMethod.POST)
public Observable<String> addToAccount(@PathVariable String id, @Validated @RequestBody ToAccountInfo request) {
public Observable<ToAccountInfo> addToAccount(@PathVariable String id, @Validated @RequestBody ToAccountInfo request) {
return customerService.addToAccount(id, request)
.map(entityAndEventInfo -> entityAndEventInfo.entityVersion().asString());
.map(entityAndEventInfo -> request);
}
}