From 4f7b4a8662275f02ccd5bf253f12de754f80d6a4 Mon Sep 17 00:00:00 2001 From: gsd Date: Tue, 26 Sep 2023 18:34:02 +0300 Subject: [PATCH] hype 3 --- src/main/java/app/services/db/DetectService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/app/services/db/DetectService.java b/src/main/java/app/services/db/DetectService.java index d23c1f3..29cb460 100644 --- a/src/main/java/app/services/db/DetectService.java +++ b/src/main/java/app/services/db/DetectService.java @@ -6,7 +6,9 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import org.springframework.stereotype.Service; +import java.util.Arrays; import java.util.List; +import java.util.Map; @Service public class DetectService { @@ -23,7 +25,7 @@ public class DetectService { public List getAttachedDiscordAccountPerSteam(SteamID steamID) { return entityManager.createNativeQuery("SELECT `discord_id`, UNIX_TIMESTAMP(`timestamp`) as utime, `active` FROM `steam2discord` WHERE `steam_id` LIKE ?1 GROUP BY `discord_id`") .setParameter(1, steamID.steam2) - .getResultList(); + .getResultStream().map(d -> Map.of("discord_id", ((Object[]) d)[0], "utime", ((Object[]) d)[1], "active", ((Object[]) d)[2])).toList(); } //SELECT CONCAT(SUBSTRING_INDEX(connect_ip,'.', 1),'.',SUBSTRING_INDEX(SUBSTRING_INDEX(connect_ip,'.', 2),'.',-1),'.',SUBSTRING_INDEX(SUBSTRING_INDEX(connect_ip,'.', 3),'.',-1),'.','%') FROM `all_users_con_2` WHERE `steam_id` LIKE 'STEAM_0:1:768781968'; }