Skip to content

Commit 8546bf7

Browse files
authored
Merge pull request #333 from boostcampwm-2021/issue/#332
[리팩토링] 프로토콜과 extension 파일 분리
2 parents b2489bf + 09ea668 commit 8546bf7

File tree

46 files changed

+541
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+541
-253
lines changed

BBus/BBus.xcodeproj/project.pbxproj

Lines changed: 101 additions & 5 deletions
Large diffs are not rendered by default.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// AlarmSettingAPIUsable.swift
3+
// BBus
4+
//
5+
// Created by 최수정 on 2021/12/01.
6+
//
7+
8+
import Foundation
9+
import Combine
10+
11+
protocol AlarmSettingAPIUsable: BaseUseCase {
12+
func busArriveInfoWillLoaded(stId: String, busRouteId: String, ord: String) -> AnyPublisher<ArrInfoByRouteDTO, Error>
13+
func busStationsInfoWillLoaded(busRouetId: String, arsId: String) -> AnyPublisher<[StationByRouteListDTO]?, Error>
14+
}

BBus/BBus/Foreground/AlarmSetting/UseCase/AlarmSettingAPIUseCase.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
import Foundation
99
import Combine
1010

11-
protocol AlarmSettingAPIUsable: BaseUseCase {
12-
func busArriveInfoWillLoaded(stId: String, busRouteId: String, ord: String) -> AnyPublisher<ArrInfoByRouteDTO, Error>
13-
func busStationsInfoWillLoaded(busRouetId: String, arsId: String) -> AnyPublisher<[StationByRouteListDTO]?, Error>
14-
}
15-
1611
final class AlarmSettingAPIUseCase: AlarmSettingAPIUsable {
1712
typealias AlarmSettingUseCases = GetArrInfoByRouteListUsable & GetStationsByRouteListUsable
1813

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// AlarmSettingCalculatable.swift
3+
// BBus
4+
//
5+
// Created by 최수정 on 2021/12/01.
6+
//
7+
8+
import Foundation
9+
10+
protocol AlarmSettingCalculatable: AverageSectionTimeCalculatable { }

BBus/BBus/Foreground/AlarmSetting/UseCase/AlarmSettingCalculateUseCase.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@
77

88
import Foundation
99

10-
protocol AlarmSettingCalculatable: AverageSectionTimeCalculatable { }
11-
1210
struct AlarmSettingCalculateUseCase: AlarmSettingCalculatable { }
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// BusRouteAPIUsable.swift
3+
// BBus
4+
//
5+
// Created by 최수정 on 2021/12/01.
6+
//
7+
8+
import Foundation
9+
import Combine
10+
11+
protocol BusRouteAPIUsable: BaseUseCase {
12+
func searchHeader(busRouteId: Int) -> AnyPublisher<BusRouteDTO?, Error>
13+
func fetchRouteList(busRouteId: Int) -> AnyPublisher<[StationByRouteListDTO], Error>
14+
func fetchBusPosList(busRouteId: Int) -> AnyPublisher<[BusPosByRtidDTO], Error>
15+
}

BBus/BBus/Foreground/BusRoute/UseCase/BusRouteUseCase.swift renamed to BBus/BBus/Foreground/BusRoute/UseCase/BusRouteAPIUseCase.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
import Foundation
99
import Combine
1010

11-
protocol BusRouteAPIUsable: BaseUseCase {
12-
func searchHeader(busRouteId: Int) -> AnyPublisher<BusRouteDTO?, Error>
13-
func fetchRouteList(busRouteId: Int) -> AnyPublisher<[StationByRouteListDTO], Error>
14-
func fetchBusPosList(busRouteId: Int) -> AnyPublisher<[BusPosByRtidDTO], Error>
15-
}
16-
1711
final class BusRouteAPIUseCase: BusRouteAPIUsable {
1812

1913
private let useCases: GetRouteListUsable & GetStationsByRouteListUsable & GetBusPosByRtidUsable
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// HomeAPIUsable.swift
3+
// BBus
4+
//
5+
// Created by 최수정 on 2021/12/01.
6+
//
7+
8+
import Foundation
9+
import Combine
10+
11+
protocol HomeAPIUsable: BaseUseCase {
12+
typealias HomeUseCases = GetFavoriteItemListUsable & CreateFavoriteItemUsable & GetStationListUsable & GetRouteListUsable & GetArrInfoByRouteListUsable
13+
14+
func fetchFavoriteData() -> AnyPublisher<[FavoriteItemDTO], Error>
15+
func fetchBusRemainTime(favoriteItem: FavoriteItemDTO) -> AnyPublisher<HomeFavoriteInfo, Error>
16+
func fetchStation() -> AnyPublisher<[StationDTO], Error>
17+
func fetchBusRoute() -> AnyPublisher<[BusRouteDTO], Error>
18+
}

BBus/BBus/Foreground/Home/UseCase/HomeAPIUseCase.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@
88
import Foundation
99
import Combine
1010

11-
protocol HomeAPIUsable: BaseUseCase {
12-
typealias HomeUseCases = GetFavoriteItemListUsable & CreateFavoriteItemUsable & GetStationListUsable & GetRouteListUsable & GetArrInfoByRouteListUsable
13-
14-
func fetchFavoriteData() -> AnyPublisher<[FavoriteItemDTO], Error>
15-
func fetchBusRemainTime(favoriteItem: FavoriteItemDTO) -> AnyPublisher<HomeFavoriteInfo, Error>
16-
func fetchStation() -> AnyPublisher<[StationDTO], Error>
17-
func fetchBusRoute() -> AnyPublisher<[BusRouteDTO], Error>
18-
}
19-
2011
final class HomeAPIUseCase: HomeAPIUsable {
2112

2213
private let useCases: HomeUseCases
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// HomeCalculatable.swift
3+
// BBus
4+
//
5+
// Created by 최수정 on 2021/12/01.
6+
//
7+
8+
import Foundation
9+
10+
protocol HomeCalculateUsable: BaseUseCase {
11+
func findStationName(in list: [StationDTO]?, by stationId: String) -> String?
12+
func findBusName(in list: [BusRouteDTO]?, by busRouteId: String) -> String?
13+
func findBusType(in list: [BusRouteDTO]?, by busName: String) -> RouteType?
14+
}

0 commit comments

Comments
 (0)