Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@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
You can’t perform that action at this time.