Created
February 9, 2016 06:29
-
-
Save jmsalcido/4617784a79e585b32ad7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeController { | |
// pretend that UserService is here injected | |
@RequestMapping(value = "/some-request", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) | |
public ResponseEntity<Response<SomeRequest> > getSomeRequest(HttpSession session) { | |
// remove NOT needed logic | |
SomeRequest someRequest = this.someBusinessService.createSomeRequest(session.getId()); | |
this.userService.processSomeEx(someRequest); | |
boolean isSaved = this.userService.handleConfigTurnedOn(someRequest); | |
if (!isSaved) { | |
// I still dont know why we return the BAD Request... but yeah. | |
return this.data(someRequest, HttpStatus.BAD_REQUEST); | |
} | |
this.differentPaymentService.handleDifferentPaymentOnRequest(someRequest); | |
return data(someRequest); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment