Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Projects/.DS_Store
Binary file not shown.
28 changes: 11 additions & 17 deletions Projects/App/Sources/AppDIContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ final class AppDIContainer {
}

func makeSettingsDIContainer(
getCurrentLocationUseCase: any GetCurrentLocationUseCase
locationService: any LocationService
) -> any SettingsCoordinatorBuildable {
SettingsDIContainer(
userRepository: userRepository,
Expand All @@ -204,9 +204,8 @@ final class AppDIContainer {
userRepository: userRepository,
placeRepository: placeRepository
),
searchPlacesUseCase: DefaultSearchPlacesUseCase(repository: placeRepository),
getCurrentLocationUseCase: getCurrentLocationUseCase,
reverseGeocodeUseCase: DefaultReverseGeocodeUseCase(repository: placeRepository),
placeRepository: placeRepository,
locationService: locationService,
checkAppUpdateUseCase: DefaultCheckAppUpdateUseCase(
repository: AppVersionRepositoryImpl(networkClient: networkClient)
),
Expand Down Expand Up @@ -241,26 +240,21 @@ final class AppDIContainer {

func makeHomeDIContainer() -> any HomeCoordinatorBuildable {
let recentSearchRepository = RecentSearchRepositoryImpl(store: UserDefaultsKeyValueStore())
let locationService = CoreLocationServiceAdapter()
let getCurrentLocation: any GetCurrentLocationUseCase =
DefaultGetCurrentLocationUseCase(locationService: locationService)
let locationService: any LocationService = CoreLocationServiceAdapter()
// 원탭 칩(Phase 18) — 검색과 홈이 같은 인스턴스를 봐야 검색의 저장·삭제가
// 칩에 그대로 비친다 (recentSearchRepository 1회 생성과 같은 이유).
let searchLastRoutes: any SearchLastRoutesUseCase =
DefaultSearchLastRoutesUseCase(repository: lastRouteRepository)
let recentSearches: any RecentSearchesUseCase =
DefaultRecentSearchesUseCase(repository: recentSearchRepository)

let searchContainer = SearchDIContainer(
searchPlacesUseCase: DefaultSearchPlacesUseCase(repository: placeRepository),
placeRepository: placeRepository,
searchLastRoutesUseCase: searchLastRoutes,
recentSearchesUseCase: recentSearches,
getCurrentLocationUseCase: getCurrentLocation
recentSearchRepository: recentSearchRepository,
locationService: locationService
)

return HomeDIContainer(
getCurrentLocationUseCase: getCurrentLocation,
reverseGeocodeUseCase: DefaultReverseGeocodeUseCase(repository: placeRepository),
locationService: locationService,
placeRepository: placeRepository,
registerAlarmUseCase: DefaultRegisterAlarmUseCase(
repository: alarmRepository,
scheduler: alarmScheduler,
Expand All @@ -285,10 +279,10 @@ final class AppDIContainer {
lastRouteRepository: lastRouteRepository,
// 원탭 칩(Phase 18) — 검색 화면과 같은 인스턴스 공유(위 주석 참조).
searchLastRoutesUseCase: searchLastRoutes,
recentSearchesUseCase: recentSearches,
recentSearchRepository: recentSearchRepository,
searchCoordinatorBuildable: searchContainer,
settingsCoordinatorBuildable: makeSettingsDIContainer(
getCurrentLocationUseCase: getCurrentLocation
locationService: locationService
)
)
}
Expand Down
15 changes: 0 additions & 15 deletions Projects/Domain/Sources/UseCases/GetCurrentLocationUseCase.swift

This file was deleted.

25 changes: 0 additions & 25 deletions Projects/Domain/Sources/UseCases/RecentSearchesUseCase.swift

This file was deleted.

15 changes: 0 additions & 15 deletions Projects/Domain/Sources/UseCases/ReverseGeocodeUseCase.swift

This file was deleted.

15 changes: 0 additions & 15 deletions Projects/Domain/Sources/UseCases/SearchPlacesUseCase.swift

This file was deleted.

40 changes: 0 additions & 40 deletions Projects/Domain/Tests/DefaultGetLastRouteDetailUseCaseTests.swift

This file was deleted.

30 changes: 0 additions & 30 deletions Projects/Domain/Tests/DefaultObserveAlarmChangeUseCaseTests.swift

This file was deleted.

39 changes: 0 additions & 39 deletions Projects/Domain/Tests/DefaultObserveAlarmUseCaseTests.swift

This file was deleted.

22 changes: 0 additions & 22 deletions Projects/Domain/Tests/DefaultRequestAlarmSyncUseCaseTests.swift

This file was deleted.

60 changes: 0 additions & 60 deletions Projects/Domain/Tests/DefaultReverseGeocodeUseCaseTests.swift

This file was deleted.

22 changes: 13 additions & 9 deletions Projects/Feature/Home/Example/ExampleApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
guard let windowScene = scene as? UIWindowScene else { return }
let navigationController = UINavigationController()
let container = HomeDIContainer(
getCurrentLocationUseCase: PreviewGetCurrentLocationUseCase(),
reverseGeocodeUseCase: PreviewReverseGeocodeUseCase(),
locationService: PreviewLocationService(),
placeRepository: PreviewPlaceRepository(),
registerAlarmUseCase: PreviewRegisterAlarmUseCase(),
cancelAlarmUseCase: PreviewCancelAlarmUseCase(),
alarmSyncEvents: PreviewAlarmSyncEvents(),
alarmChangeEvents: PreviewAlarmChangeEvents(),
alarmSyncRequesting: PreviewAlarmSyncRequesting(),
lastRouteRepository: PreviewLastRouteRepository(),
searchLastRoutesUseCase: PreviewSearchLastRoutesUseCase(),
recentSearchesUseCase: PreviewRecentSearchesUseCase(),
recentSearchRepository: PreviewRecentSearchRepository(),
searchCoordinatorBuildable: PreviewSearchCoordinatorBuildable()
)
let coordinator = container.makeHomeCoordinator(navigationController: navigationController)
Expand All @@ -60,18 +60,22 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {

// Example apps wire stub use cases — no Data/network dependency.

struct PreviewGetCurrentLocationUseCase: GetCurrentLocationUseCase {
func execute() async throws -> Coordinate {
struct PreviewLocationService: LocationService {
func currentLocation() async throws -> Coordinate {
try? await Task.sleep(for: .milliseconds(400))
return Coordinate(latitude: 37.4979, longitude: 127.0276)
}
}

struct PreviewReverseGeocodeUseCase: ReverseGeocodeUseCase {
func execute(coordinate: Coordinate) async throws -> Place {
struct PreviewPlaceRepository: PlaceRepository {
func reverseGeocode(_ coordinate: Coordinate) async throws -> Place {
try? await Task.sleep(for: .milliseconds(200))
return Place(name: "강남역", address: "서울 강남구 강남대로 396", coordinate: coordinate)
}

// 홈은 역지오코딩만 쓴다 — 나머지는 프리뷰에서 호출되지 않는다.
func searchPlaces(keyword: String, near coordinate: Coordinate?) async throws -> [Place] { [] }
func isServiceRegion(_ coordinate: Coordinate) async throws -> Bool { true }
}

struct PreviewRegisterAlarmUseCase: RegisterAlarmUseCase {
Expand Down Expand Up @@ -130,8 +134,8 @@ struct PreviewSearchLastRoutesUseCase: SearchLastRoutesUseCase {
}

/// 최근 검색 스텁(Phase 18) — canned 1건으로 칩이 즉시 표출된다. save/remove는 no-op.
struct PreviewRecentSearchesUseCase: RecentSearchesUseCase {
func fetch() async throws -> [Place] {
struct PreviewRecentSearchRepository: RecentSearchRepository {
func recentSearches() async throws -> [Place] {
[PreviewSearchCoordinator.makeCannedArrival()]
}

Expand Down
Loading
Loading