Skip to content

Commit cc3ec40

Browse files
committed
fix6
1 parent 8c28f1a commit cc3ec40

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

ewm-service/src/main/java/ru/practicum/ewm/event/service/PublicEventServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ private Map<Long, Long> getViewsMap(List<Event> events) {
123123
try {
124124
LocalDateTime start = LocalDateTime.of(2000, 1, 1, 0, 0, 0);
125125
LocalDateTime end = LocalDateTime.now().plusDays(1);
126+
log.info("Requesting stats: start={}, end={}, uris={}, unique={}", start, end, uris, false);
126127
List<ViewStats> stats = statsClient.getStats(start, end, uris, false);
128+
log.info("Received stats: {}", stats);
127129
return stats.stream()
128130
.collect(Collectors.toMap(
129131
vs -> Long.parseLong(vs.getUri().substring(vs.getUri().lastIndexOf('/') + 1)),

statistics/client/src/main/java/ru/practicum/statistics/client/StatsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public void sendHit(EndpointHit hit) {
3535
}
3636

3737
public List<ViewStats> getStats(LocalDateTime start, LocalDateTime end, List<String> uris, boolean unique) {
38-
String startStr = URLEncoder.encode(start.format(DATE_TIME_FORMATTER), StandardCharsets.UTF_8);
39-
String endStr = URLEncoder.encode(end.format(DATE_TIME_FORMATTER), StandardCharsets.UTF_8);
38+
String startStr = start.format(DATE_TIME_FORMATTER);
39+
String endStr = end.format(DATE_TIME_FORMATTER);
4040

4141
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(serverUrl + "/stats")
4242
.queryParam("start", startStr)

0 commit comments

Comments
 (0)