generated from ttipo/project-base
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:
@@ -12,6 +12,7 @@ import 'package:wandergo/features/location/data/location_service.dart';
|
||||
import 'package:wandergo/features/location/domain/base_location.dart';
|
||||
import 'package:wandergo/features/place/data/models/place_models.dart';
|
||||
import 'package:wandergo/features/place/data/repositories/place_repository.dart';
|
||||
import 'package:wandergo/features/place/presentation/providers/place_providers.dart';
|
||||
|
||||
/// 2026-11-04(수) 한국 정오 — 이번 주말은 11-07~11-08
|
||||
final DateTime _now = DateTime.utc(2026, 11, 4, 3);
|
||||
@@ -113,7 +114,15 @@ class _FakePlaceRepository implements PlaceRepository {
|
||||
|
||||
final List<PlaceItem> places;
|
||||
final List<PlaceItem> petPlaces;
|
||||
final List<({String? query, List<PlaceCategory> categories, bool petOnly})>
|
||||
final List<
|
||||
({
|
||||
String? query,
|
||||
List<PlaceCategory> categories,
|
||||
bool petOnly,
|
||||
bool trustedOnly,
|
||||
int limit,
|
||||
})
|
||||
>
|
||||
calls = [];
|
||||
|
||||
@override
|
||||
@@ -121,13 +130,29 @@ class _FakePlaceRepository implements PlaceRepository {
|
||||
String? query,
|
||||
List<PlaceCategory> categories = const [],
|
||||
bool petOnly = false,
|
||||
bool trustedOnly = false,
|
||||
GeoPoint? near,
|
||||
int? radiusM,
|
||||
int limit = 20,
|
||||
String? cursor,
|
||||
}) async {
|
||||
calls.add((query: query, categories: categories, petOnly: petOnly));
|
||||
final items = petOnly ? petPlaces : places;
|
||||
calls.add((
|
||||
query: query,
|
||||
categories: categories,
|
||||
petOnly: petOnly,
|
||||
trustedOnly: trustedOnly,
|
||||
limit: limit,
|
||||
));
|
||||
// 서버처럼 trusted 면 관광공사·운영자 확인 장소만 주고, limit 만큼 자른다
|
||||
final items = (petOnly ? petPlaces : places)
|
||||
.where(
|
||||
(p) =>
|
||||
!trustedOnly ||
|
||||
p.source == PlaceSource.tour ||
|
||||
p.verifiedAt != null,
|
||||
)
|
||||
.take(limit)
|
||||
.toList();
|
||||
return PlacePage(items: items, hasNext: false, total: items.length);
|
||||
}
|
||||
|
||||
@@ -389,4 +414,33 @@ void main() {
|
||||
expect(find.text('Need help? Call 1330'), findsOneWidget);
|
||||
expect(_text('Hours not confirmed · check before you go'), findsOneWidget);
|
||||
});
|
||||
|
||||
// 2026-11-04 회귀 점검: 앱이 가까운 30곳을 받아 거르면 도심에서는 모두 상가라 칸이 비었다
|
||||
testWidgets('함께 가기 좋은 곳은 관광공사·확인 장소만 서버에 요청해, 상가가 더 가까워도 채워진다', (
|
||||
tester,
|
||||
) async {
|
||||
await _useTallScreen(tester);
|
||||
final alley = _place(
|
||||
'p-alley',
|
||||
'대구근대골목',
|
||||
category: PlaceCategory.attraction,
|
||||
distanceM: 320,
|
||||
);
|
||||
final places = _FakePlaceRepository(
|
||||
places: [_storeCafe, _petPark, alley],
|
||||
petPlaces: [_petPark],
|
||||
);
|
||||
await _pumpApp(tester, prefs: {'onboarding_done': true}, places: places);
|
||||
|
||||
await tester.tap(find.text('경상감영공원'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final nearby = places.calls.where((c) => c.trustedOnly).toList();
|
||||
expect(nearby, hasLength(1));
|
||||
// 자기 자신이 섞여 오므로 보일 수보다 하나 더 받는다
|
||||
expect(nearby.single.limit, kNearbyPlaceLimit + 1);
|
||||
expect(find.text('함께 가기 좋은 곳'), findsOneWidget);
|
||||
expect(find.text('대구근대골목'), findsOneWidget);
|
||||
expect(find.text('마실커피 동성로점'), findsNothing);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user