File tree Expand file tree Collapse file tree
src/main/java/com/example/talky/domain/statics Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ services:
3838 - TZ=Asia/Seoul
3939 volumes :
4040 - ./nginx/conf.d:/etc/nginx/conf.d
41- - /etc/letsencrypt/live/43.200.236.115.nip.io/fullchain.pem:/etc/letsencrypt/live/43.200.236.115.nip.io /fullchain.pem
42- - /etc/letsencrypt/live/43.200.236.115.nip.io/privkey.pem:/etc/letsencrypt/live/43.200.236.115.nip.io /privkey.pem
41+ - /etc/letsencrypt/live/43.200.236.115.nip.io/fullchain.pem:/etc/nginx/certs /fullchain.pem
42+ - /etc/letsencrypt/live/43.200.236.115.nip.io/privkey.pem:/etc/nginx/certs /privkey.pem
4343 restart : always
4444 networks :
4545 - talky-network
Original file line number Diff line number Diff line change @@ -64,6 +64,13 @@ public StaticsRes getNormalUsersStatics(Long normalId) {
6464 .filter (s -> s .getCreatedAt ().toLocalDate ().isEqual (LocalDateTime .now ().toLocalDate ()))
6565 .collect (Collectors .groupingBy (Speech ::getPlace , Collectors .counting ()));
6666
67+ List <StaticsRes .Places > places = usedPlace .entrySet ().stream ()
68+ .map (p -> new StaticsRes .Places (
69+ p .getKey (),
70+ p .getValue ()
71+ ))
72+ .toList ();
73+
6774 // 사용한 시각과 같은 날짜의 사용 시간대를 커스텀 함수로 변환
6875 Map <String , Long > usedWhen = pickSpeech .stream ()
6976 .filter (s -> s .getCreatedAt ().toLocalDate ().isEqual (LocalDateTime .now ().toLocalDate ()))
@@ -73,6 +80,13 @@ public StaticsRes getNormalUsersStatics(Long normalId) {
7380 ), Collectors .counting ()
7481 ));
7582
83+ List <StaticsRes .Times > times = usedWhen .entrySet ().stream ()
84+ .map (t -> new StaticsRes .Times (
85+ t .getKey (),
86+ t .getValue ()
87+ ))
88+ .toList ();
89+
7690 // 긴급호출 사용 이력을 조회
7791 // 단, 모든 기록을 조회할 시, 쿼리 시간이 길어짐을 생각하여 최근 7일만 조회
7892 List <EmergencyHistory > userEmergencyHistories = ehRepository .findAllByNormalId (normalId , LocalDateTime .now ());
@@ -92,8 +106,8 @@ public StaticsRes getNormalUsersStatics(Long normalId) {
92106 return new StaticsRes (
93107 howManyUsedCount ,
94108 top5Favorites ,
95- usedPlace ,
96- usedWhen ,
109+ places ,
110+ times ,
97111 parsedEmergencyHistory
98112 );
99113 }
Original file line number Diff line number Diff line change 11package com .example .talky .domain .statics .web .dto ;
22
3- import com .example .talky .domain .favorites .entity .Favorite ;
43
54import java .util .List ;
6- import java .util .Map ;
75
86public record StaticsRes (
97 List <UsedCount > howManyUsed ,
108 List <Favorites > top5Used ,
11- Map < String , Long > usedPlace ,
12- Map < String , Long > usedWhen ,
9+ List < Places > usedPlace ,
10+ List < Times > usedWhen ,
1311 List <History > histories
1412) {
1513 public record Favorites (
@@ -21,6 +19,17 @@ public record UsedCount(
2119 String date ,
2220 Long value
2321 ) {}
22+
23+ public record Places (
24+ String place ,
25+ Long count
26+ ) {}
27+
28+ public record Times (
29+ String when ,
30+ Long count
31+ ) {}
32+
2433 public record History (
2534 String date ,
2635 String time ,
You can’t perform that action at this time.
0 commit comments