Skip to content

Instantly share code, notes, and snippets.

@jmsalcido
Created February 9, 2016 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmsalcido/4617784a79e585b32ad7 to your computer and use it in GitHub Desktop.
Save jmsalcido/4617784a79e585b32ad7 to your computer and use it in GitHub Desktop.
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