From 8289a0b1097f02a99d62f4f7750e6b46a54a54fc Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 9 Feb 2024 16:02:43 +0300 Subject: Append IDEA code suggestions --- src/main/java/com/juick/service/InfoService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/juick/service/InfoService.java') diff --git a/src/main/java/com/juick/service/InfoService.java b/src/main/java/com/juick/service/InfoService.java index b10e325e..9540243e 100644 --- a/src/main/java/com/juick/service/InfoService.java +++ b/src/main/java/com/juick/service/InfoService.java @@ -58,9 +58,9 @@ public class InfoService { UserStats userStats = new UserStats(); userStats.setTotal(jdbcTemplate.queryForObject("SELECT COUNT(*) FROM users WHERE banned=0", Integer.class)); userStats.setActiveMonth(jdbcTemplate.queryForObject("SELECT COUNT(*) FROM users WHERE banned=0 AND last_seen > ?", - Integer.class, ZonedDateTime.now().minus(1, ChronoUnit.MONTHS).toLocalDateTime())); + Integer.class, ZonedDateTime.now().minusMonths(1).toLocalDateTime())); userStats.setActiveHalfyear(jdbcTemplate.queryForObject("SELECT COUNT(*) FROM users WHERE banned=0 AND last_seen > ?", - Integer.class, ZonedDateTime.now().minus(6, ChronoUnit.MONTHS).toLocalDateTime())); + Integer.class, ZonedDateTime.now().minusMonths(6).toLocalDateTime())); Usage usage = new Usage(); usage.setUsers(userStats); usage.setLocalPosts(jdbcTemplate.queryForObject("SELECT COUNT(*) FROM messages WHERE privacy=1", -- cgit v1.2.3