Skip to content

Commit

Permalink
Change LocalDate with Instant.
Browse files Browse the repository at this point in the history
  • Loading branch information
amusarra committed May 18, 2024
1 parent 22d7a82 commit 51e0b6c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.time.Instant;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -111,7 +111,7 @@ public void filter(ContainerRequestContext requestContext) {
// Applica la logica del filtro in base all'URI
if (requestUriIsFiltered(requestUri)) {
// Aggiungi la data ora di quando la richiesta arriva al filtro
requestContext.setProperty(LOCAL_DATE_TIME_IN, LocalDateTime.now());
requestContext.setProperty(LOCAL_DATE_TIME_IN, Instant.now());

/*
* Se l'URI richiesto è presente nell'elenco delle URI da filtrare
Expand Down Expand Up @@ -290,7 +290,7 @@ private JsonObject prepareMessage(ContainerResponseContext responseContext) {
return new JsonObject()
.put(CORRELATION_ID_HEADER,
responseContext.getHeaders().get(CORRELATION_ID_HEADER).getFirst())
.put(LOCAL_DATE_TIME_OUT, LocalDateTime.now().toString())
.put(LOCAL_DATE_TIME_OUT, Instant.now())
.put("status", responseContext.getStatus())
.put("status-info-family-name", responseContext.getStatusInfo().getFamily().name())
.put("status-info-reason", responseContext.getStatusInfo().getReasonPhrase())
Expand Down

0 comments on commit 51e0b6c

Please sign in to comment.