Esempio n. 1
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));
 }
Esempio n. 2
0
  @RequestMapping(
      method = RequestMethod.GET,
      params = {"fromDate", "toDate"})
  public List<AuditEvent> getByDates(
      @RequestParam(value = "fromDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
          LocalDate fromDate,
      @RequestParam(value = "toDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
          LocalDate toDate) {

    return auditEventService.findByDates(fromDate.atTime(0, 0), toDate.atTime(23, 59));
  }
Esempio n. 3
0
 @RequestMapping(method = RequestMethod.GET)
 public List<AuditEvent> getAll() {
   return auditEventService.findAll();
 }