Skip to content

Instantly share code, notes, and snippets.

@stephen-masters
Last active August 29, 2015 14:14
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 stephen-masters/cf6db31dd6f643da4c19 to your computer and use it in GitHub Desktop.
Save stephen-masters/cf6db31dd6f643da4c19 to your computer and use it in GitHub Desktop.
@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