-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[리팩토링] 프로토콜과 extension 파일 분리
- Loading branch information
Showing
46 changed files
with
541 additions
and
253 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
BBus/BBus/Foreground/AlarmSetting/UseCase/AlarmSettingAPIUsable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// AlarmSettingAPIUsable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
import Combine | ||
|
||
protocol AlarmSettingAPIUsable: BaseUseCase { | ||
func busArriveInfoWillLoaded(stId: String, busRouteId: String, ord: String) -> AnyPublisher<ArrInfoByRouteDTO, Error> | ||
func busStationsInfoWillLoaded(busRouetId: String, arsId: String) -> AnyPublisher<[StationByRouteListDTO]?, Error> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
BBus/BBus/Foreground/AlarmSetting/UseCase/AlarmSettingCalculatable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// AlarmSettingCalculatable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol AlarmSettingCalculatable: AverageSectionTimeCalculatable { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
BBus/BBus/Foreground/BusRoute/UseCase/BusRouteAPIUsable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// BusRouteAPIUsable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
import Combine | ||
|
||
protocol BusRouteAPIUsable: BaseUseCase { | ||
func searchHeader(busRouteId: Int) -> AnyPublisher<BusRouteDTO?, Error> | ||
func fetchRouteList(busRouteId: Int) -> AnyPublisher<[StationByRouteListDTO], Error> | ||
func fetchBusPosList(busRouteId: Int) -> AnyPublisher<[BusPosByRtidDTO], Error> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// HomeAPIUsable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
import Combine | ||
|
||
protocol HomeAPIUsable: BaseUseCase { | ||
typealias HomeUseCases = GetFavoriteItemListUsable & CreateFavoriteItemUsable & GetStationListUsable & GetRouteListUsable & GetArrInfoByRouteListUsable | ||
|
||
func fetchFavoriteData() -> AnyPublisher<[FavoriteItemDTO], Error> | ||
func fetchBusRemainTime(favoriteItem: FavoriteItemDTO) -> AnyPublisher<HomeFavoriteInfo, Error> | ||
func fetchStation() -> AnyPublisher<[StationDTO], Error> | ||
func fetchBusRoute() -> AnyPublisher<[BusRouteDTO], Error> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// HomeCalculatable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol HomeCalculateUsable: BaseUseCase { | ||
func findStationName(in list: [StationDTO]?, by stationId: String) -> String? | ||
func findBusName(in list: [BusRouteDTO]?, by busRouteId: String) -> String? | ||
func findBusType(in list: [BusRouteDTO]?, by busName: String) -> RouteType? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
BBus/BBus/Foreground/MovingStatus/UseCase/MovingStatusAPIUsable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// MovingStatusAPIUsable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
import Combine | ||
|
||
protocol MovingStatusAPIUsable: BaseUseCase { | ||
func searchHeader(busRouteId: Int) -> AnyPublisher<BusRouteDTO?, Error> | ||
func fetchRouteList(busRouteId: Int) -> AnyPublisher<[StationByRouteListDTO], Error> | ||
func fetchBusPosList(busRouteId: Int) -> AnyPublisher<[BusPosByRtidDTO], Error> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
BBus/BBus/Foreground/MovingStatus/UseCase/MovingStatusCalculatable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// MovingStatusCalculatable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol MovingStatusCalculatable: AverageSectionTimeCalculatable { | ||
func filteredBuses(from buses: [BusPosByRtidDTO], startOrd: Int, currentOrd: Int, count: Int) -> [BusPosByRtidDTO] | ||
func convertBusInfo(header: BusRouteDTO) -> BusInfo | ||
func remainStation(bus: BusPosByRtidDTO, startOrd: Int, count: Int) -> Int | ||
func pushAlarmMessage(remainStation: Int) -> (message: String?, terminated: Bool) | ||
func remainTime(bus: BusPosByRtidDTO, stations: [StationInfo], startOrd: Int, boardedBus: BoardedBus) -> Int | ||
func convertBusPos(startOrd: Int, order: Int, sect: String, fullSect: String) -> Double | ||
func isOnBoard(gpsY: Double, gpsX: Double, busY: Double, busX: Double) -> Bool | ||
func stationIndex(with targetId: String, with stations: [StationByRouteListDTO]) -> Int? | ||
func filteredStations(from stations: [StationByRouteListDTO]) -> (stations: [StationInfo], time: Int) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// SearchAPIUsable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
import Combine | ||
|
||
protocol SearchAPIUsable: BaseUseCase { | ||
func loadBusRouteList() -> AnyPublisher<[BusRouteDTO], Error> | ||
func loadStationList() -> AnyPublisher<[StationDTO], Error> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
BBus/BBus/Foreground/Search/UseCase/SearchCalculatable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// SearchCalculatable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol SearchCalculatable { | ||
func searchBus(by keyword: String, at routeList: [BusRouteDTO]) -> [BusSearchResult] | ||
func searchStation(by keyword: String, at stationList: [StationDTO]) -> [StationSearchResult] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
BBus/BBus/Foreground/Station/UseCase/StationAPIUsable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// StationAPIUsable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
import Combine | ||
|
||
protocol StationAPIUsable: BaseUseCase { | ||
func loadStationList() -> AnyPublisher<[StationDTO], Error> | ||
func refreshInfo(about arsId: String) -> AnyPublisher<[StationByUidItemDTO], Error> | ||
func add(favoriteItem: FavoriteItemDTO) -> AnyPublisher<Data, Error> | ||
func remove(favoriteItem: FavoriteItemDTO) -> AnyPublisher<Data, Error> | ||
func getFavoriteItems() -> AnyPublisher<[FavoriteItemDTO], Error> | ||
func loadRoute() -> AnyPublisher<[BusRouteDTO], Error> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
BBus/BBus/Foreground/Station/UseCase/StationCalculatable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// StationCalculatable.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol StationCalculatable: BaseUseCase { | ||
func findStation(in stations: [StationDTO], with arsId: String) -> StationDTO? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// JsonDTO.swift | ||
// BBus | ||
// | ||
// Created by 최수정 on 2021/12/01. | ||
// | ||
|
||
import Foundation | ||
|
||
struct JsonHeader: Codable { | ||
let msgHeader: MessageHeader | ||
} | ||
|
||
struct JsonMessage<T: Codable>: Codable { | ||
let msgHeader: MessageHeader | ||
let msgBody: MessageBody<T> | ||
} | ||
|
||
struct MessageHeader: Codable { | ||
let headerMessage, headerCD: String | ||
let itemCount: Int | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case headerMessage = "headerMsg" | ||
case headerCD = "headerCd" | ||
case itemCount | ||
} | ||
} | ||
|
||
struct MessageBody<T: Codable>: Codable { | ||
let itemList: [T] | ||
} |
File renamed without changes.
Oops, something went wrong.