Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //было
- @PostMapping("create")
- public @ResponseBody
- String create(@RequestBody @Valid OutgoingCallTaskServiceLegacy.CreateCallTaskRequest request) {
- return outgoingCallTaskService.create(request).getId();
- }
- //стало
- @PostMapping("create")
- public @ResponseBody
- ResponseEntity<String> create(@RequestBody @Valid OutgoingCallTaskServiceLegacy.CreateCallTaskRequest request) {
- ResponseEntity<String> responseEntity;
- CallTaskController.CallTaskCreatedResponse response = outgoingCallTaskService.create(request);
- if (response.getId() != null) {
- responseEntity = new ResponseEntity<>(response.getId(), HttpStatus.OK);
- } else {
- responseEntity = new ResponseEntity<>(HttpStatus.BAD_REQUEST);
- }
- return responseEntity;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement