コード例 #1
0
 @RequestMapping(
     value = "/{id}",
     produces = MediaType.APPLICATION_JSON_VALUE,
     method = RequestMethod.GET)
 public ResponseEntity getMessageForId(@PathVariable Integer id) {
   return new ResponseEntity<>(service.getMessage(id), HttpStatus.OK);
 }
コード例 #2
0
 @RequestMapping(
     value = "/",
     produces = MediaType.APPLICATION_JSON_VALUE,
     method = RequestMethod.GET)
 public ResponseEntity getDefaultMessage() {
   return new ResponseEntity<>(service.getMessage(1), HttpStatus.OK);
 }