Last active
August 29, 2015 14:14
-
-
Save stephen-masters/cf6db31dd6f643da4c19 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@RestController | |
public class BusPassController { | |
private static Logger log = LoggerFactory.getLogger(BusPassController.class); | |
private final BusPassService busPassService; | |
@Autowired | |
public BusPassController(BusPassService busPassService) { | |
this.busPassService = busPassService; | |
} | |
@RequestMapping(value = "/buspass", | |
method = RequestMethod.GET, produces = "application/json") | |
public BusPass getBusPass( | |
@RequestParam(required = true) String name, | |
@RequestParam(required = true) int age) { | |
Person person = new Person(name, age); | |
log.debug("Bus pass request received for: " + person); | |
BusPass busPass = busPassService.getBusPass(person); | |
return busPass; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment