示例#1
0
 /** GET /accountings/:id -> get the "id" accounting. */
 @RequestMapping(
     value = "/accountings/{id}",
     method = RequestMethod.GET,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<Accounting> getAccounting(@PathVariable Long id) {
   log.debug("REST request to get Accounting : {}", id);
   return Optional.ofNullable(accountingRepository.findOne(id))
       .map(accounting -> new ResponseEntity<>(accounting, HttpStatus.OK))
       .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
 }