@@ -164,6 +164,7 @@ private List<SearchRes> sortedCongestion(List<MemberPlace> memberPlaceEntities,
164164
165165 List <SearchRes > result = new ArrayList <>();
166166
167+ log .info (String .valueOf (memberPlaceEntities .size ()));
167168
168169 for (MemberPlace memberPlace : memberPlaceEntities ) {
169170
@@ -180,6 +181,9 @@ private List<SearchRes> sortedCongestion(List<MemberPlace> memberPlaceEntities,
180181 if (latestMember != null ) {
181182 result .add (SearchRes .of (memberPlace .getId (), memberPlace .getName (), latestMember .getCreatedAt (),
182183 latestMember .getCongestionLevel ().getName (), memberPlace .getAddress (), memberPlace .getImageUrl (), PlaceType .MEMBER_PLACE , favoriteFlag ));
184+ }else {
185+ result .add (SearchRes .of (memberPlace .getId (), memberPlace .getName (), memberPlace .getCreatedAt (),
186+ null , memberPlace .getAddress (), memberPlace .getImageUrl (), PlaceType .MEMBER_PLACE , favoriteFlag ));
183187 }
184188 }
185189
@@ -196,13 +200,10 @@ private List<SearchRes> sortedCongestion(List<MemberPlace> memberPlaceEntities,
196200 OfficialCongestion latestOfficial =
197201 officialCongestionRepository .findTopByOfficialPlaceIdOrderByObservedAtDesc (official .getId ()).orElse (null );
198202
199- // 혼잡도 정보 때문에 즉 붐빔 키워드랑 최신 반영 날짜 때문에 하지만 사용자가 올린거랑 다르게 null 도 존재함 애초에 공식 장소라
203+ // 혼잡도 정보 때문에 즉 붐빔 키워드랑 최신 반영 날짜 때문에
200204 if (latestOfficial != null ) {
201205 result .add (SearchRes .of (official .getId (), official .getName (), latestOfficial .getObservedAt (),
202206 latestOfficial .getCongestionLevel ().getName (), null , official .getImageUrl (), PlaceType .OFFICIAL_PLACE , favoriteFlag ));
203- } else {
204- result .add (SearchRes .of (official .getId (), official .getName (), null ,
205- null , null , official .getImageUrl (), PlaceType .OFFICIAL_PLACE , favoriteFlag ));
206207 }
207208 }
208209
0 commit comments