fix(flutter): 함께 가기 좋은 곳을 서버 trusted 조건으로 받아 도심에서도 채움

출처와 상관없이 가까운 30곳을 받아 관광공사·확인 장소만 고르던 것을 서버 조건(trusted)으로 바꿨다.
도심에서는 받은 30곳이 모두 상가라 칸이 비었다(봉산서원 0곳 → 6곳, 김광석길 2곳 → 6곳).
자기 자신이 섞여 오므로 보일 수(6)보다 하나 더 받는다.

백엔드 trusted 조건(fix/place-hours-and-nearby)이 먼저 배포되어야 한다 — 모르는 조건은 400 이다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-05 00:00:14 +09:00
parent 4bd2a9b4ad
commit 5caed15482
4 changed files with 68 additions and 12 deletions
@@ -15,10 +15,12 @@ class PlaceRepository {
/// 장소 검색. [near] 를 주면 [radiusM] 안을 거리순으로, 없으면 이름순으로 준다.
/// [categories] 가 비면 전체 분류, [petOnly] 면 반려동물 동반(전 구역·일부 구역) 장소만.
/// [trustedOnly] 면 관광공사 장소와 운영자가 확인한 장소만(확인 안 된 상가정보 매장·추천 안 함 제외).
Future<PlacePage> search({
String? query,
List<PlaceCategory> categories = const [],
bool petOnly = false,
bool trustedOnly = false,
GeoPoint? near,
int? radiusM,
int limit = 20,
@@ -31,6 +33,7 @@ class PlaceRepository {
if (categories.isNotEmpty)
'category': categories.map((c) => c.name).join(','),
if (petOnly) 'pet': 'true',
if (trustedOnly) 'trusted': 'true',
'lat': ?near?.lat,
'lng': ?near?.lng,
'radius': ?radiusM,
@@ -18,9 +18,8 @@ const int kHomePetPlaceLimit = 3;
const int kNearbyEventRadiusM = 5000;
const int kNearbyEventLimit = 3;
/// 장소 상세 '함께 가기 좋은 곳' — 반경 안에서 받아 고른 뒤 이만큼 보인다
/// 장소 상세 '함께 가기 좋은 곳' — 반경 안에서 이만큼 보인다
const int kNearbyPlaceRadiusM = 1500;
const int kNearbyPlaceFetchLimit = 30;
const int kNearbyPlaceLimit = 6;
/// 장소 상세
@@ -66,21 +65,20 @@ typedef NearbyPlaceKey = ({String id, double lat, double lng});
///
/// 확인 안 된 상가정보 매장은 고르지 않는다(관광공사 장소 또는 운영자가 확인한 장소만).
/// 폐업·분위기를 검증할 수 없는 곳을 추천처럼 보이지 않으려는 것이다(2026-11-02 합의).
/// 서버가 거른다(`trusted`) — 앱이 가까운 몇 곳을 받아 거르면 도심처럼 상가가 빽빽한 곳에서는
/// 받은 곳이 모두 상가라 칸이 비었다(2026-11-04 회귀 점검). 자기 자신이 섞여 오므로 하나 더 받는다.
final nearbyPlacesProvider =
FutureProvider.family<List<PlaceItem>, NearbyPlaceKey>((ref, key) async {
final page = await ref
.watch(placeRepositoryProvider)
.search(
trustedOnly: true,
near: (lat: key.lat, lng: key.lng),
radiusM: kNearbyPlaceRadiusM,
limit: kNearbyPlaceFetchLimit,
limit: kNearbyPlaceLimit + 1,
);
return page.items
.where(
(p) =>
p.id != key.id &&
(p.source == PlaceSource.tour || p.verifiedAt != null),
)
.where((p) => p.id != key.id)
.take(kNearbyPlaceLimit)
.toList();
});