コード例 #1
0
 @RequestMapping(
     method = RequestMethod.GET,
     params = {"fromDate", "toDate"})
 public List<AuditEvent> getByDates(
     @RequestParam(value = "fromDate") LocalDateTime fromDate,
     @RequestParam(value = "toDate") LocalDateTime toDate) {
   return auditEventService.findByDates(fromDate, toDate);
 }
コード例 #2
0
  @RequestMapping(value = "/{id:.+}", method = RequestMethod.GET)
  public ResponseEntity<AuditEvent> get(@PathVariable Long id) {

    return auditEventService
        .find(id)
        .map((entity) -> new ResponseEntity<>(entity, HttpStatus.OK))
        .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
  }
コード例 #3
0
 @RequestMapping(method = RequestMethod.GET)
 public List<AuditEvent> getAll() {
   return auditEventService.findAll();
 }