From beb148b043542384dc747ffe367ef5bdb2389cc0 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 17:42:57 +0900 Subject: [PATCH 01/30] =?UTF-8?q?feat=20::=20=EC=9E=94=EB=A5=98=20?= =?UTF-8?q?=EC=8B=A0=EC=B2=AD=20APIKit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Services/APIKit/Sources/DmsAPI.swift | 1 + .../Services/APIKit/Sources/RemainsAPI.swift | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 Projects/Services/APIKit/Sources/RemainsAPI.swift diff --git a/Projects/Services/APIKit/Sources/DmsAPI.swift b/Projects/Services/APIKit/Sources/DmsAPI.swift index 211db8eb..56b2665f 100644 --- a/Projects/Services/APIKit/Sources/DmsAPI.swift +++ b/Projects/Services/APIKit/Sources/DmsAPI.swift @@ -39,6 +39,7 @@ public enum DmsDomain: String { case points case users case studyRooms = "study-rooms" + case remains } extension DmsDomain { diff --git a/Projects/Services/APIKit/Sources/RemainsAPI.swift b/Projects/Services/APIKit/Sources/RemainsAPI.swift new file mode 100644 index 00000000..9b40d53b --- /dev/null +++ b/Projects/Services/APIKit/Sources/RemainsAPI.swift @@ -0,0 +1,63 @@ +import Moya +import DataMappingModule +import ErrorModule +import Foundation + +public enum RemainsAPI { + case remainingApplicationsChanges(id: String) + case fetchMyRemainApplicationItems + case fetchRemainsAvailableTime + case fetchListRemainApplicationItems +} + +extension RemainsAPI: DmsAPI { + public var domain: DmsDomain { + .remains + } + + public var urlPath: String { + switch self { + case .remainingApplicationsChanges(let id): + return "/\(id)" + case .fetchMyRemainApplicationItems: + return "/my" + case .fetchRemainsAvailableTime: + return "/available-time" + case .fetchListRemainApplicationItems: + return "/options" + } + } + + public var method: Moya.Method { + switch self { + case .remainingApplicationsChanges: + return .put + case .fetchMyRemainApplicationItems, .fetchRemainsAvailableTime, .fetchListRemainApplicationItems: + return .get + } + } + + public var task: Moya.Task { + .requestPlain + } + + public var jwtTokenType: JwtTokenType { + .accessToken + } + + public var errorMap: [Int: DmsError] { + switch self { + case .remainingApplicationsChanges: + return [ + 400: .badRequest, + 401: .token + ] + case .fetchMyRemainApplicationItems: + <#code#> + case .fetchRemainsAvailableTime: + <#code#> + case .fetchListRemainApplicationItems: + <#code#> + } + } +} From 23d5661e1385514488a9bdc78b09ca4a1c6a85e2 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 19:43:38 +0900 Subject: [PATCH 02/30] =?UTF-8?q?feat=20::=20=EC=9E=94=EB=A5=98=EC=8B=A0?= =?UTF-8?q?=EC=B2=AD=20=EA=B4=80=EB=A0=A8=20Entity=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/APIKit/Sources/RemainsAPI.swift | 10 +---- .../ListRemainApplicationItemsEntity.swift | 13 +++++++ .../MyRemainApplicationItemsEntity.swift | 10 +++++ .../Sources/Entities/RemainOptionEntity.swift | 16 ++++++++ .../Entities/RemainsAvailableTimeEntity.swift | 19 +++++++++ .../Impl/RemoteRemainsDataSourceImpl.swift | 39 +++++++++++++++++++ .../Remote/RemoteStudyRoomsDataSource.swift | 14 +++++++ 7 files changed, 113 insertions(+), 8 deletions(-) create mode 100644 Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemsEntity.swift create mode 100644 Projects/Services/DomainModule/Sources/Entities/MyRemainApplicationItemsEntity.swift create mode 100644 Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift create mode 100644 Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift create mode 100644 Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift create mode 100644 Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteStudyRoomsDataSource.swift diff --git a/Projects/Services/APIKit/Sources/RemainsAPI.swift b/Projects/Services/APIKit/Sources/RemainsAPI.swift index 9b40d53b..761c0f46 100644 --- a/Projects/Services/APIKit/Sources/RemainsAPI.swift +++ b/Projects/Services/APIKit/Sources/RemainsAPI.swift @@ -47,17 +47,11 @@ extension RemainsAPI: DmsAPI { public var errorMap: [Int: DmsError] { switch self { - case .remainingApplicationsChanges: + default: return [ 400: .badRequest, - 401: .token + 500: .internalServerError ] - case .fetchMyRemainApplicationItems: - <#code#> - case .fetchRemainsAvailableTime: - <#code#> - case .fetchListRemainApplicationItems: - <#code#> } } } diff --git a/Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemsEntity.swift b/Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemsEntity.swift new file mode 100644 index 00000000..ebdc69dd --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemsEntity.swift @@ -0,0 +1,13 @@ +import Foundation + +public struct ListRemainApplicationItemsEntity: Equatable, Hashable { + public init( + selectedOption: String, + remainOptions: [RemainOptionEntity] + ) { + self.selectedOption = selectedOption + self.remainOptions = remainOptions + } + public let selectedOption: String + public let remainOptions: [RemainOptionEntity] +} diff --git a/Projects/Services/DomainModule/Sources/Entities/MyRemainApplicationItemsEntity.swift b/Projects/Services/DomainModule/Sources/Entities/MyRemainApplicationItemsEntity.swift new file mode 100644 index 00000000..7a4969ed --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Entities/MyRemainApplicationItemsEntity.swift @@ -0,0 +1,10 @@ +import Foundation + +public struct MyRemainApplicationItemsEntity: Equatable, Hashable { + public init( + title: String + ) { + self.title = title + } + public let title: String +} diff --git a/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift b/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift new file mode 100644 index 00000000..412928ee --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift @@ -0,0 +1,16 @@ +import Foundation + +public struct RemainOptionEntity: Equatable, Hashable { + public init( + id: String, + title: String, + description: String + ) { + self.id = id + self.title = title + self.description = description + } + public let id: String + public let title: String + public let description: String +} diff --git a/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift b/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift new file mode 100644 index 00000000..e704e531 --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift @@ -0,0 +1,19 @@ +import Foundation + +public struct RemainsAvailableTimeEntity: Equatable, Hashable { + public init( + startDayOfWeek: String, + startAt: String, + endDayOfWeek: String, + endAt: String + ) { + self.startDayOfWeek = startDayOfWeek + self.startAt = startAt + self.endDayOfWeek = endDayOfWeek + self.endAt = endAt + } + public let startDayOfWeek: String + public let startAt: String + public let endDayOfWeek: String + public let endAt: String +} diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift new file mode 100644 index 00000000..0051832a --- /dev/null +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift @@ -0,0 +1,39 @@ +import APIKit +import Combine +import DataMappingModule +import DomainModule +import ErrorModule + +public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource, RemoteStudyRoomsDataSource { + public func fetchStudyAvailableTime() -> AnyPublisher { + request(.fetchStudyAvailableTime, dto: FetchStudyAvailableTimeResponseDTO.self) + .map { $0.toDomain() } + .eraseToAnyPublisher() + } + + public func fetchSeatTypes() -> AnyPublisher<[SeatTypeEntity], DmsError> { + request(.fetchSeatTypes, dto: FetchSeatTypesResponseDTO.self) + .map { $0.toDomain() } + .eraseToAnyPublisher() + } + + public func fetchStudyRoomList() -> AnyPublisher<[StudyRoomEntity], DmsError> { + request(.fetchStudyRoomList, dto: FetchStudyRoomListResponDTO.self) + .map { $0.toDomain() } + .eraseToAnyPublisher() + } + + public func fetchDetailStudyRoom(roomID: String) -> AnyPublisher { + request(.fetchDetailStudyRoom(roomID: roomID), dto: FetchDetailStudyRoomResponseDTO.self) + .map { $0.toDomain() } + .eraseToAnyPublisher() + } + + public func applyStudyRoomSeat(seatID: String) -> AnyPublisher { + request(.applyStudyRoomSeat(seatID: seatID)) + } + + public func cancelStudyRoomSeat() -> AnyPublisher { + request(.cancelStudyRoomSeat) + } +} diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteStudyRoomsDataSource.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteStudyRoomsDataSource.swift new file mode 100644 index 00000000..84b20288 --- /dev/null +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteStudyRoomsDataSource.swift @@ -0,0 +1,14 @@ +import APIKit +import Combine +import DataMappingModule +import DomainModule +import ErrorModule +import Foundation + +public protocol RemoteRemainsDataSource { + func remainingApplicationsChanges(id: String) -> AnyPublisher + func fetchMyRemainApplicationItems() -> AnyPublisher + func fetchRemainsAvailableTime() -> AnyPublisher + func fetchListRemainApplicationItems() -> AnyPublisher +} From 49bc053e4f84e901dab17027cd418684a83fafc0 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 22:24:43 +0900 Subject: [PATCH 03/30] =?UTF-8?q?feat=20::=20=EC=9E=94=EB=A5=98=20?= =?UTF-8?q?=EC=8B=A0=EC=B2=AD=20DataSourceImpl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...istRemainApplicationItemsResponseDTO.swift | 18 ++++++++ ...hMyRemainApplicationItemsResponseDTO.swift | 10 ++++ ...FetchRemainsAvailableTimeResponseDTO.swift | 25 ++++++++++ .../Response/RemainOptionResponseDTO.swift | 16 +++++++ .../FetchListRemainAppItemsDataTransfer.swift | 21 +++++++++ ...MyRemainApplicationItemsDataTransfer.swift | 10 ++++ ...etchRemainsAvailableTimeDataTransfer.swift | 13 ++++++ .../Impl/RemoteRemainsDataSourceImpl.swift | 46 ++++++++----------- ...ce.swift => RemoteRemainsDataSource.swift} | 0 9 files changed, 131 insertions(+), 28 deletions(-) create mode 100644 Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift create mode 100644 Projects/Services/DataMappingModule/Sources/Remains/Response/FetchMyRemainApplicationItemsResponseDTO.swift create mode 100644 Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift create mode 100644 Projects/Services/DataMappingModule/Sources/Remains/Response/RemainOptionResponseDTO.swift create mode 100644 Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift create mode 100644 Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchMyRemainApplicationItemsDataTransfer.swift create mode 100644 Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift rename Projects/Services/NetworkModule/Sources/Remains/Remote/{RemoteStudyRoomsDataSource.swift => RemoteRemainsDataSource.swift} (100%) diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift new file mode 100644 index 00000000..5a5d76db --- /dev/null +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift @@ -0,0 +1,18 @@ +import Foundation + +public struct FetchListRemainAppItemsResponseDTO: Decodable { + public init( + selectedOption: String, + remainOptions: [RemainOptionResponseDTO] + ) { + self.selectedOption = selectedOption + self.remainOptions = remainOptions + } + public let selectedOption: String + public let remainOptions: [RemainOptionResponseDTO] + + enum CodingKeys: String, CodingKey { + case selectedOption = "selected_option" + case remainOptions = "remain_options" + } +} diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchMyRemainApplicationItemsResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchMyRemainApplicationItemsResponseDTO.swift new file mode 100644 index 00000000..70cdb972 --- /dev/null +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchMyRemainApplicationItemsResponseDTO.swift @@ -0,0 +1,10 @@ +import Foundation + +public struct FetchMyRemainApplicationItemsResponseDTO: Decodable { + public init( + title: String + ) { + self.title = title + } + public let title: String +} diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift new file mode 100644 index 00000000..63ae213c --- /dev/null +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift @@ -0,0 +1,25 @@ +import Foundation + +public struct FetchRemainsAvailableTimeResponseDTO: Decodable { + public init( + startDayOfWeek: String, + startAt: String, + endDayOfWeek: String, + endAt: String + ) { + self.startDayOfWeek = startDayOfWeek + self.startAt = startAt + self.endDayOfWeek = endDayOfWeek + self.endAt = endAt + } + public let startDayOfWeek: String + public let startAt: String + public let endDayOfWeek: String + public let endAt: String + enum CodingKeys: String, CodingKey { + case startDayOfWeek = "start_day_of_week" + case startAt = "start_at" + case endDayOfWeek = "end_day_of_week" + case endAt = "end_at" + } +} diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/RemainOptionResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/RemainOptionResponseDTO.swift new file mode 100644 index 00000000..7e604ae7 --- /dev/null +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/RemainOptionResponseDTO.swift @@ -0,0 +1,16 @@ +import Foundation + +public struct RemainOptionResponseDTO: Decodable { + public init( + id: String, + title: String, + description: String + ) { + self.id = id + self.title = title + self.description = description + } + public let id: String + public let title: String + public let description: String +} diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift new file mode 100644 index 00000000..0b55d8ba --- /dev/null +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift @@ -0,0 +1,21 @@ +import DataMappingModule +import DomainModule + +public extension FetchListRemainAppItemsResponseDTO { + func toDomain() -> ListRemainApplicationItemsEntity { + ListRemainApplicationItemsEntity( + selectedOption: selectedOption, + remainOptions: remainOptions.map { $0.toDomain() } + ) + } +} + +public extension RemainOptionResponseDTO { + func toDomain() -> RemainOptionEntity { + RemainOptionEntity( + id: id, + title: title, + description: description + ) + } +} diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchMyRemainApplicationItemsDataTransfer.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchMyRemainApplicationItemsDataTransfer.swift new file mode 100644 index 00000000..bb3309a7 --- /dev/null +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchMyRemainApplicationItemsDataTransfer.swift @@ -0,0 +1,10 @@ +import DataMappingModule +import DomainModule + +public extension FetchMyRemainApplicationItemsResponseDTO { + func toDomain() -> MyRemainApplicationItemsEntity { + MyRemainApplicationItemsEntity( + title: title + ) + } +} diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift new file mode 100644 index 00000000..6edfc8c8 --- /dev/null +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift @@ -0,0 +1,13 @@ +import DataMappingModule +import DomainModule + +public extension FetchRemainsAvailableTimeResponseDTO { + func toDomain() -> RemainsAvailableTimeEntity { + RemainsAvailableTimeEntity( + startDayOfWeek: startDayOfWeek, + startAt: startAt, + endDayOfWeek: endDayOfWeek, + endAt: endAt + ) + } +} diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift index 0051832a..ebdbf774 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift @@ -4,36 +4,26 @@ import DataMappingModule import DomainModule import ErrorModule -public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource, RemoteStudyRoomsDataSource { - public func fetchStudyAvailableTime() -> AnyPublisher { - request(.fetchStudyAvailableTime, dto: FetchStudyAvailableTimeResponseDTO.self) - .map { $0.toDomain() } - .eraseToAnyPublisher() +public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource, RemoteRemainsDataSource { + public func remainingApplicationsChanges(id: String) -> AnyPublisher { + request(.remainingApplicationsChanges(id: id)) } - - public func fetchSeatTypes() -> AnyPublisher<[SeatTypeEntity], DmsError> { - request(.fetchSeatTypes, dto: FetchSeatTypesResponseDTO.self) - .map { $0.toDomain() } - .eraseToAnyPublisher() - } - - public func fetchStudyRoomList() -> AnyPublisher<[StudyRoomEntity], DmsError> { - request(.fetchStudyRoomList, dto: FetchStudyRoomListResponDTO.self) - .map { $0.toDomain() } - .eraseToAnyPublisher() + public func fetchMyRemainApplicationItems() -> AnyPublisher { + request(.fetchMyRemainApplicationItems, + dto: FetchMyRemainApplicationItemsResponseDTO.self) + .map { $0.toDomain() } + .eraseToAnyPublisher() } - - public func fetchDetailStudyRoom(roomID: String) -> AnyPublisher { - request(.fetchDetailStudyRoom(roomID: roomID), dto: FetchDetailStudyRoomResponseDTO.self) - .map { $0.toDomain() } - .eraseToAnyPublisher() + public func fetchRemainsAvailableTime() -> AnyPublisher { + request(.fetchRemainsAvailableTime, + dto: FetchRemainsAvailableTimeResponseDTO.self) + .map { $0.toDomain() } + .eraseToAnyPublisher() } - - public func applyStudyRoomSeat(seatID: String) -> AnyPublisher { - request(.applyStudyRoomSeat(seatID: seatID)) - } - - public func cancelStudyRoomSeat() -> AnyPublisher { - request(.cancelStudyRoomSeat) + public func fetchListRemainApplicationItems() -> AnyPublisher { + request(.fetchListRemainApplicationItems, + dto: FetchListRemainAppItemsResponseDTO.self) + .map { $0.toDomain() } + .eraseToAnyPublisher() } } diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteStudyRoomsDataSource.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift similarity index 100% rename from Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteStudyRoomsDataSource.swift rename to Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift From 5d500091ab3611871975d61cfa1ce0abbbc2d5d7 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 22:40:13 +0900 Subject: [PATCH 04/30] =?UTF-8?q?feat=20::=20=EC=9E=94=EB=A5=98=20?= =?UTF-8?q?=EC=8B=A0=EC=B2=AD=20Repository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lmpl/RemainsRepositoryImpl.swift | 29 +++++++++++++++++++ ...istRemainApplicationItemsUseCaselmpl.swift | 9 ++++++ ...hMyRemainApplicationItemsUseCaselmpl.swift | 9 ++++++ ...FetchRemainsAvailableTimeUseCaselmpl.swift | 9 ++++++ ...ainingApplicationsChangesUseCaselmpl.swift | 16 ++++++++++ .../Repository/RemainsRepository.swift | 11 +++++++ ...tchListRemainApplicationItemsUseCase.swift | 8 +++++ ...FetchMyRemainApplicationItemsUseCase.swift | 7 +++++ .../FetchRemainsAvailableTimeUseCase.swift | 7 +++++ .../RemainingApplicationsChangesUseCase.swift | 7 +++++ 10 files changed, 112 insertions(+) create mode 100644 Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift create mode 100644 Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift create mode 100644 Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift create mode 100644 Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift create mode 100644 Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift create mode 100644 Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift create mode 100644 Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift create mode 100644 Projects/Services/DomainModule/Sources/Remains/UseCases/FetchMyRemainApplicationItemsUseCase.swift create mode 100644 Projects/Services/DomainModule/Sources/Remains/UseCases/FetchRemainsAvailableTimeUseCase.swift create mode 100644 Projects/Services/DomainModule/Sources/Remains/UseCases/RemainingApplicationsChangesUseCase.swift diff --git a/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift b/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift new file mode 100644 index 00000000..dd4f05c7 --- /dev/null +++ b/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift @@ -0,0 +1,29 @@ +import Combine +import DataMappingModule +import DomainModule +import ErrorModule +import NetworkModule + +public struct RemainsRepositoryImpl: RemainsRepository { + private let remoteRemainsDataSource: any RemoteRemainsDataSource + + public init(remoteRemainsDataSource: any RemoteRemainsDataSource) { + self.remoteRemainsDataSource = remoteRemainsDataSource + } + + public func remainingApplicationsChanges(id: String) -> AnyPublisher { + remoteRemainsDataSource.remainingApplicationsChanges(id: id) + } + + public func fetchMyRemainApplicationItems() -> AnyPublisher { + remoteRemainsDataSource.fetchMyRemainApplicationItems() + } + + public func fetchRemainsAvailableTime() -> AnyPublisher { + remoteRemainsDataSource.fetchRemainsAvailableTime() + } + + public func fetchListRemainApplicationItems() -> AnyPublisher { + remoteRemainsDataSource.fetchListRemainApplicationItems() + } +} diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift new file mode 100644 index 00000000..7af361af --- /dev/null +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift @@ -0,0 +1,9 @@ +// +// FetchListRemainApplicationItemsUseCaselmpl.swift +// DataModule +// +// Created by 홍승재 on 2023/02/19. +// Copyright © 2023 com.team.aliens. All rights reserved. +// + +import Foundation diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift new file mode 100644 index 00000000..e0420ae2 --- /dev/null +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift @@ -0,0 +1,9 @@ +// +// FetchMyRemainApplicationItemsUseCaselmpl.swift +// DataModule +// +// Created by 홍승재 on 2023/02/19. +// Copyright © 2023 com.team.aliens. All rights reserved. +// + +import Foundation diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift new file mode 100644 index 00000000..dce50d6e --- /dev/null +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift @@ -0,0 +1,9 @@ +// +// FetchRemainsAvailableTimeUseCaselmpl.swift +// DataModule +// +// Created by 홍승재 on 2023/02/19. +// Copyright © 2023 com.team.aliens. All rights reserved. +// + +import Foundation diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift new file mode 100644 index 00000000..d97c933a --- /dev/null +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift @@ -0,0 +1,16 @@ +import Combine +import DataMappingModule +import DomainModule +import ErrorModule + +public struct RemainingApplicationsChangesUseCaselmpl: RemainingApplicationsChangesUseCase { + private let studyRoomsRepository: any StudyRoomsRepository + + public init(studyRoomsRepository: any StudyRoomsRepository) { + self.studyRoomsRepository = studyRoomsRepository + } + + public func execute(seatID: String) -> AnyPublisher { + studyRoomsRepository.applyStudyRoomSeat(seatID: seatID) + } +} diff --git a/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift b/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift new file mode 100644 index 00000000..02238e0a --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift @@ -0,0 +1,11 @@ +import Combine +import DataMappingModule +import ErrorModule + +public protocol RemainsRepository { + func remainingApplicationsChanges(id: String) -> AnyPublisher + func fetchMyRemainApplicationItems() -> AnyPublisher + func fetchRemainsAvailableTime() -> AnyPublisher + func fetchListRemainApplicationItems() -> AnyPublisher +} diff --git a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift new file mode 100644 index 00000000..b4fc3acc --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift @@ -0,0 +1,8 @@ +import Combine +import DataMappingModule +import ErrorModule + +public protocol FetchListRemainApplicationItemsUseCase { + func execute() -> AnyPublisher +} diff --git a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchMyRemainApplicationItemsUseCase.swift b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchMyRemainApplicationItemsUseCase.swift new file mode 100644 index 00000000..bd75f098 --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchMyRemainApplicationItemsUseCase.swift @@ -0,0 +1,7 @@ +import Combine +import DataMappingModule +import ErrorModule + +public protocol FetchMyRemainApplicationItemsUseCase { + func execute() -> AnyPublisher +} diff --git a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchRemainsAvailableTimeUseCase.swift b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchRemainsAvailableTimeUseCase.swift new file mode 100644 index 00000000..1769cd69 --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchRemainsAvailableTimeUseCase.swift @@ -0,0 +1,7 @@ +import Combine +import DataMappingModule +import ErrorModule + +public protocol FetchRemainsAvailableTimeUseCase { + func execute() -> AnyPublisher +} diff --git a/Projects/Services/DomainModule/Sources/Remains/UseCases/RemainingApplicationsChangesUseCase.swift b/Projects/Services/DomainModule/Sources/Remains/UseCases/RemainingApplicationsChangesUseCase.swift new file mode 100644 index 00000000..ca2fa0b9 --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Remains/UseCases/RemainingApplicationsChangesUseCase.swift @@ -0,0 +1,7 @@ +import Combine +import DataMappingModule +import ErrorModule + +public protocol RemainingApplicationsChangesUseCase { + func execute() -> AnyPublisher +} From fbe2078ad2fcb651020751e77e9f870c6ecdcf72 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 22:44:40 +0900 Subject: [PATCH 05/30] =?UTF-8?q?feat=20::=20=EC=9E=94=EB=A5=98=20?= =?UTF-8?q?=EC=8B=A0=EC=B2=AD=20UseCase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Application/NeedleGenerated.swift | 156 +++++++++--------- ...istRemainApplicationItemsUseCaselmpl.swift | 23 ++- ...hMyRemainApplicationItemsUseCaselmpl.swift | 24 ++- ...FetchRemainsAvailableTimeUseCaselmpl.swift | 23 ++- ...ainingApplicationsChangesUseCaselmpl.swift | 11 +- .../RemainingApplicationsChangesUseCase.swift | 2 +- 6 files changed, 130 insertions(+), 109 deletions(-) diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index 384903b9..61eecf9a 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -482,84 +482,84 @@ private func factory8dd2f9e0b545ead35ecaf47b58f8f304c97af4d5(_ component: Needle extension AppComponent: Registration { public func registerItems() { - localTable["keychain-any Keychain"] = { self.keychain as Any } - localTable["remoteStudyRoomsDataSource-any RemoteStudyRoomsDataSource"] = { self.remoteStudyRoomsDataSource as Any } - localTable["studyRoomsRepository-any StudyRoomsRepository"] = { self.studyRoomsRepository as Any } - localTable["fetchStudyAvailableTimeUseCase-any FetchStudyAvailableTimeUseCase"] = { self.fetchStudyAvailableTimeUseCase as Any } - localTable["fetchSeatTypesUseCase-any FetchSeatTypesUseCase"] = { self.fetchSeatTypesUseCase as Any } - localTable["fetchStudyRoomListUseCase-any FetchStudyRoomListUseCase"] = { self.fetchStudyRoomListUseCase as Any } - localTable["fetchDetailStudyRoomUseCase-any FetchDetailStudyRoomUseCase"] = { self.fetchDetailStudyRoomUseCase as Any } - localTable["applyStudyRoomSeatUseCase-any ApplyStudyRoomSeatUseCase"] = { self.applyStudyRoomSeatUseCase as Any } - localTable["cancelStudyRoomSeatUseCase-any CancelStudyRoomSeatUseCase"] = { self.cancelStudyRoomSeatUseCase as Any } - localTable["localAuthDataSource-any LocalAuthDataSource"] = { self.localAuthDataSource as Any } - localTable["remoteAuthDataSource-any RemoteAuthDataSource"] = { self.remoteAuthDataSource as Any } - localTable["authRepository-any AuthRepository"] = { self.authRepository as Any } - localTable["signinUseCase-any SigninUseCase"] = { self.signinUseCase as Any } - localTable["verifyAuthCodeUseCase-any VerifyAuthCodeUseCase"] = { self.verifyAuthCodeUseCase as Any } - localTable["sendAuthCodeUseCase-any SendAuthCodeUseCase"] = { self.sendAuthCodeUseCase as Any } - localTable["reissueTokenUseCase-any ReissueTokenUseCase"] = { self.reissueTokenUseCase as Any } - localTable["checkEmailExistByAccountIDUseCase-any CheckEmailExistByAccountIDUseCase"] = { self.checkEmailExistByAccountIDUseCase as Any } - localTable["checkAccountIDIsExistUseCase-any CheckAccountIDIsExistUseCase"] = { self.checkAccountIDIsExistUseCase as Any } - localTable["logoutUseCase-any LogoutUseCase"] = { self.logoutUseCase as Any } - localTable["schoolCodeComponent-SchoolCodeComponent"] = { self.schoolCodeComponent as Any } - localTable["findIDComponent-FindIDComponent"] = { self.findIDComponent as Any } - localTable["signinComponent-SigninComponent"] = { self.signinComponent as Any } - localTable["splashComponent-SplashComponent"] = { self.splashComponent as Any } - localTable["schoolConfirmationQuestionsComponent-SchoolConfirmationQuestionsComponent"] = { self.schoolConfirmationQuestionsComponent as Any } - localTable["signupEmailVerifyComponent-SignupEmailVerifyComponent"] = { self.signupEmailVerifyComponent as Any } - localTable["signupEmailAuthCodeVerifyComponent-SignupEmailAuthCodeVerifyComponent"] = { self.signupEmailAuthCodeVerifyComponent as Any } - localTable["idSettingComponent-IDSettingComponent"] = { self.idSettingComponent as Any } - localTable["enterInformationComponent-EnterInformationComponent"] = { self.enterInformationComponent as Any } - localTable["authenticationEmailComponent-AuthenticationEmailComponent"] = { self.authenticationEmailComponent as Any } - localTable["changePasswordComponent-ChangePasswordComponent"] = { self.changePasswordComponent as Any } - localTable["signupProfileImageComponent-SignupProfileImageComponent"] = { self.signupProfileImageComponent as Any } - localTable["signupPasswordComponent-SignupPasswordComponent"] = { self.signupPasswordComponent as Any } - localTable["signupTermsComponent-SignupTermsComponent"] = { self.signupTermsComponent as Any } - localTable["mainTabComponent-MainTabComponent"] = { self.mainTabComponent as Any } - localTable["homeComponent-HomeComponent"] = { self.homeComponent as Any } - localTable["studyRoomDetailComponent-StudyRoomDetailComponent"] = { self.studyRoomDetailComponent as Any } - localTable["noticeListComponent-NoticeListComponent"] = { self.noticeListComponent as Any } - localTable["myPageComponent-MyPageComponent"] = { self.myPageComponent as Any } - localTable["changeProfileComponent-ChangeProfileComponent"] = { self.changeProfileComponent as Any } - localTable["noticeDetailComponent-NoticeDetailComponent"] = { self.noticeDetailComponent as Any } - localTable["rewardPointDetailComponent-RewardPointDetailComponent"] = { self.rewardPointDetailComponent as Any } - localTable["checkPasswordComponent-CheckPasswordComponent"] = { self.checkPasswordComponent as Any } - localTable["modifyPasswordComponent-ModifyPasswordComponent"] = { self.modifyPasswordComponent as Any } - localTable["studyRoomListComponent-StudyRoomListComponent"] = { self.studyRoomListComponent as Any } - localTable["remoteNoticeDataSource-any RemoteNoticeDataSource"] = { self.remoteNoticeDataSource as Any } - localTable["noticeRepository-any NoticeRepository"] = { self.noticeRepository as Any } - localTable["fetchWhetherNewNoticeUseCase-any FetchWhetherNewNoticeUseCase"] = { self.fetchWhetherNewNoticeUseCase as Any } - localTable["fetchNoticeListUseCase-any FetchNoticeListUseCase"] = { self.fetchNoticeListUseCase as Any } - localTable["fetchDetailNoticeUseCase-any FetchDetailNoticeUseCase"] = { self.fetchDetailNoticeUseCase as Any } - localTable["remoteStudentsDataSource-any RemoteStudentsDataSource"] = { self.remoteStudentsDataSource as Any } - localTable["studentsRepository-any StudentsRepository"] = { self.studentsRepository as Any } - localTable["signupUseCase-any SignupUseCase"] = { self.signupUseCase as Any } - localTable["checkDuplicateAccountIDUseCase-any CheckDuplicateAccountIDUseCase"] = { self.checkDuplicateAccountIDUseCase as Any } - localTable["checkDuplicateEmailUseCase-any CheckDuplicateEmailUseCase"] = { self.checkDuplicateEmailUseCase as Any } - localTable["renewalPasswordUseCase-any RenewalPasswordUseCase"] = { self.renewalPasswordUseCase as Any } - localTable["findIDUseCase-any FindIDUseCase"] = { self.findIDUseCase as Any } - localTable["checkExistGradeClassNumberUseCase-any CheckExistGradeClassNumberUseCase"] = { self.checkExistGradeClassNumberUseCase as Any } - localTable["fetchMyProfileUseCase-any FetchMyProfileUseCase"] = { self.fetchMyProfileUseCase as Any } - localTable["changeProfileImageUseCase-any ChangeProfileImageUseCase"] = { self.changeProfileImageUseCase as Any } - localTable["remoteUsersDataSource-any RemoteUsersDataSource"] = { self.remoteUsersDataSource as Any } - localTable["usersRepository-any UsersRepository"] = { self.usersRepository as Any } - localTable["changePasswordUseCase-any ChangePasswordUseCase"] = { self.changePasswordUseCase as Any } - localTable["compareCurrentPasswordUseCase-any CompareCurrentPasswordUseCase"] = { self.compareCurrentPasswordUseCase as Any } - localTable["remotePointsDataSource-any RemotePointsDataSource"] = { self.remotePointsDataSource as Any } - localTable["pointsRepository-any PointsRepository"] = { self.pointsRepository as Any } - localTable["fetchPointListUseCase-any FetchPointListUseCase"] = { self.fetchPointListUseCase as Any } - localTable["remoteMealDataSource-any RemoteMealDataSource"] = { self.remoteMealDataSource as Any } - localTable["mealRepository-any MealRepository"] = { self.mealRepository as Any } - localTable["fetchMealListUseCase-any FetchMealListUseCase"] = { self.fetchMealListUseCase as Any } - localTable["remoteFilesDataSource-any RemoteFilesDataSource"] = { self.remoteFilesDataSource as Any } - localTable["filesRepository-any FilesRepository"] = { self.filesRepository as Any } - localTable["uploadFileUseCase-any UploadFileUseCase"] = { self.uploadFileUseCase as Any } - localTable["remoteSchoolDataSource-any RemoteSchoolDataSource"] = { self.remoteSchoolDataSource as Any } - localTable["schoolRepository-any SchoolRepository"] = { self.schoolRepository as Any } - localTable["fetchSchoolListUseCase-any FetchSchoolListUseCase"] = { self.fetchSchoolListUseCase as Any } - localTable["fetchSchoolQuestionUseCase-any FetchSchoolQuestionUseCase"] = { self.fetchSchoolQuestionUseCase as Any } - localTable["checkSchoolQuestionUseCase-any CheckSchoolQuestionUseCase"] = { self.checkSchoolQuestionUseCase as Any } - localTable["checkSchoolCodeUseCase-any CheckSchoolCodeUseCase"] = { self.checkSchoolCodeUseCase as Any } + localTable["keychain-any Keychain"] = { [unowned self] in self.keychain as Any } + localTable["remoteStudyRoomsDataSource-any RemoteStudyRoomsDataSource"] = { [unowned self] in self.remoteStudyRoomsDataSource as Any } + localTable["studyRoomsRepository-any StudyRoomsRepository"] = { [unowned self] in self.studyRoomsRepository as Any } + localTable["fetchStudyAvailableTimeUseCase-any FetchStudyAvailableTimeUseCase"] = { [unowned self] in self.fetchStudyAvailableTimeUseCase as Any } + localTable["fetchSeatTypesUseCase-any FetchSeatTypesUseCase"] = { [unowned self] in self.fetchSeatTypesUseCase as Any } + localTable["fetchStudyRoomListUseCase-any FetchStudyRoomListUseCase"] = { [unowned self] in self.fetchStudyRoomListUseCase as Any } + localTable["fetchDetailStudyRoomUseCase-any FetchDetailStudyRoomUseCase"] = { [unowned self] in self.fetchDetailStudyRoomUseCase as Any } + localTable["applyStudyRoomSeatUseCase-any ApplyStudyRoomSeatUseCase"] = { [unowned self] in self.applyStudyRoomSeatUseCase as Any } + localTable["cancelStudyRoomSeatUseCase-any CancelStudyRoomSeatUseCase"] = { [unowned self] in self.cancelStudyRoomSeatUseCase as Any } + localTable["localAuthDataSource-any LocalAuthDataSource"] = { [unowned self] in self.localAuthDataSource as Any } + localTable["remoteAuthDataSource-any RemoteAuthDataSource"] = { [unowned self] in self.remoteAuthDataSource as Any } + localTable["authRepository-any AuthRepository"] = { [unowned self] in self.authRepository as Any } + localTable["signinUseCase-any SigninUseCase"] = { [unowned self] in self.signinUseCase as Any } + localTable["verifyAuthCodeUseCase-any VerifyAuthCodeUseCase"] = { [unowned self] in self.verifyAuthCodeUseCase as Any } + localTable["sendAuthCodeUseCase-any SendAuthCodeUseCase"] = { [unowned self] in self.sendAuthCodeUseCase as Any } + localTable["reissueTokenUseCase-any ReissueTokenUseCase"] = { [unowned self] in self.reissueTokenUseCase as Any } + localTable["checkEmailExistByAccountIDUseCase-any CheckEmailExistByAccountIDUseCase"] = { [unowned self] in self.checkEmailExistByAccountIDUseCase as Any } + localTable["checkAccountIDIsExistUseCase-any CheckAccountIDIsExistUseCase"] = { [unowned self] in self.checkAccountIDIsExistUseCase as Any } + localTable["logoutUseCase-any LogoutUseCase"] = { [unowned self] in self.logoutUseCase as Any } + localTable["schoolCodeComponent-SchoolCodeComponent"] = { [unowned self] in self.schoolCodeComponent as Any } + localTable["findIDComponent-FindIDComponent"] = { [unowned self] in self.findIDComponent as Any } + localTable["signinComponent-SigninComponent"] = { [unowned self] in self.signinComponent as Any } + localTable["splashComponent-SplashComponent"] = { [unowned self] in self.splashComponent as Any } + localTable["schoolConfirmationQuestionsComponent-SchoolConfirmationQuestionsComponent"] = { [unowned self] in self.schoolConfirmationQuestionsComponent as Any } + localTable["signupEmailVerifyComponent-SignupEmailVerifyComponent"] = { [unowned self] in self.signupEmailVerifyComponent as Any } + localTable["signupEmailAuthCodeVerifyComponent-SignupEmailAuthCodeVerifyComponent"] = { [unowned self] in self.signupEmailAuthCodeVerifyComponent as Any } + localTable["idSettingComponent-IDSettingComponent"] = { [unowned self] in self.idSettingComponent as Any } + localTable["enterInformationComponent-EnterInformationComponent"] = { [unowned self] in self.enterInformationComponent as Any } + localTable["authenticationEmailComponent-AuthenticationEmailComponent"] = { [unowned self] in self.authenticationEmailComponent as Any } + localTable["changePasswordComponent-ChangePasswordComponent"] = { [unowned self] in self.changePasswordComponent as Any } + localTable["signupProfileImageComponent-SignupProfileImageComponent"] = { [unowned self] in self.signupProfileImageComponent as Any } + localTable["signupPasswordComponent-SignupPasswordComponent"] = { [unowned self] in self.signupPasswordComponent as Any } + localTable["signupTermsComponent-SignupTermsComponent"] = { [unowned self] in self.signupTermsComponent as Any } + localTable["mainTabComponent-MainTabComponent"] = { [unowned self] in self.mainTabComponent as Any } + localTable["homeComponent-HomeComponent"] = { [unowned self] in self.homeComponent as Any } + localTable["studyRoomDetailComponent-StudyRoomDetailComponent"] = { [unowned self] in self.studyRoomDetailComponent as Any } + localTable["noticeListComponent-NoticeListComponent"] = { [unowned self] in self.noticeListComponent as Any } + localTable["myPageComponent-MyPageComponent"] = { [unowned self] in self.myPageComponent as Any } + localTable["changeProfileComponent-ChangeProfileComponent"] = { [unowned self] in self.changeProfileComponent as Any } + localTable["noticeDetailComponent-NoticeDetailComponent"] = { [unowned self] in self.noticeDetailComponent as Any } + localTable["rewardPointDetailComponent-RewardPointDetailComponent"] = { [unowned self] in self.rewardPointDetailComponent as Any } + localTable["checkPasswordComponent-CheckPasswordComponent"] = { [unowned self] in self.checkPasswordComponent as Any } + localTable["modifyPasswordComponent-ModifyPasswordComponent"] = { [unowned self] in self.modifyPasswordComponent as Any } + localTable["studyRoomListComponent-StudyRoomListComponent"] = { [unowned self] in self.studyRoomListComponent as Any } + localTable["remoteNoticeDataSource-any RemoteNoticeDataSource"] = { [unowned self] in self.remoteNoticeDataSource as Any } + localTable["noticeRepository-any NoticeRepository"] = { [unowned self] in self.noticeRepository as Any } + localTable["fetchWhetherNewNoticeUseCase-any FetchWhetherNewNoticeUseCase"] = { [unowned self] in self.fetchWhetherNewNoticeUseCase as Any } + localTable["fetchNoticeListUseCase-any FetchNoticeListUseCase"] = { [unowned self] in self.fetchNoticeListUseCase as Any } + localTable["fetchDetailNoticeUseCase-any FetchDetailNoticeUseCase"] = { [unowned self] in self.fetchDetailNoticeUseCase as Any } + localTable["remoteStudentsDataSource-any RemoteStudentsDataSource"] = { [unowned self] in self.remoteStudentsDataSource as Any } + localTable["studentsRepository-any StudentsRepository"] = { [unowned self] in self.studentsRepository as Any } + localTable["signupUseCase-any SignupUseCase"] = { [unowned self] in self.signupUseCase as Any } + localTable["checkDuplicateAccountIDUseCase-any CheckDuplicateAccountIDUseCase"] = { [unowned self] in self.checkDuplicateAccountIDUseCase as Any } + localTable["checkDuplicateEmailUseCase-any CheckDuplicateEmailUseCase"] = { [unowned self] in self.checkDuplicateEmailUseCase as Any } + localTable["renewalPasswordUseCase-any RenewalPasswordUseCase"] = { [unowned self] in self.renewalPasswordUseCase as Any } + localTable["findIDUseCase-any FindIDUseCase"] = { [unowned self] in self.findIDUseCase as Any } + localTable["checkExistGradeClassNumberUseCase-any CheckExistGradeClassNumberUseCase"] = { [unowned self] in self.checkExistGradeClassNumberUseCase as Any } + localTable["fetchMyProfileUseCase-any FetchMyProfileUseCase"] = { [unowned self] in self.fetchMyProfileUseCase as Any } + localTable["changeProfileImageUseCase-any ChangeProfileImageUseCase"] = { [unowned self] in self.changeProfileImageUseCase as Any } + localTable["remoteUsersDataSource-any RemoteUsersDataSource"] = { [unowned self] in self.remoteUsersDataSource as Any } + localTable["usersRepository-any UsersRepository"] = { [unowned self] in self.usersRepository as Any } + localTable["changePasswordUseCase-any ChangePasswordUseCase"] = { [unowned self] in self.changePasswordUseCase as Any } + localTable["compareCurrentPasswordUseCase-any CompareCurrentPasswordUseCase"] = { [unowned self] in self.compareCurrentPasswordUseCase as Any } + localTable["remotePointsDataSource-any RemotePointsDataSource"] = { [unowned self] in self.remotePointsDataSource as Any } + localTable["pointsRepository-any PointsRepository"] = { [unowned self] in self.pointsRepository as Any } + localTable["fetchPointListUseCase-any FetchPointListUseCase"] = { [unowned self] in self.fetchPointListUseCase as Any } + localTable["remoteMealDataSource-any RemoteMealDataSource"] = { [unowned self] in self.remoteMealDataSource as Any } + localTable["mealRepository-any MealRepository"] = { [unowned self] in self.mealRepository as Any } + localTable["fetchMealListUseCase-any FetchMealListUseCase"] = { [unowned self] in self.fetchMealListUseCase as Any } + localTable["remoteFilesDataSource-any RemoteFilesDataSource"] = { [unowned self] in self.remoteFilesDataSource as Any } + localTable["filesRepository-any FilesRepository"] = { [unowned self] in self.filesRepository as Any } + localTable["uploadFileUseCase-any UploadFileUseCase"] = { [unowned self] in self.uploadFileUseCase as Any } + localTable["remoteSchoolDataSource-any RemoteSchoolDataSource"] = { [unowned self] in self.remoteSchoolDataSource as Any } + localTable["schoolRepository-any SchoolRepository"] = { [unowned self] in self.schoolRepository as Any } + localTable["fetchSchoolListUseCase-any FetchSchoolListUseCase"] = { [unowned self] in self.fetchSchoolListUseCase as Any } + localTable["fetchSchoolQuestionUseCase-any FetchSchoolQuestionUseCase"] = { [unowned self] in self.fetchSchoolQuestionUseCase as Any } + localTable["checkSchoolQuestionUseCase-any CheckSchoolQuestionUseCase"] = { [unowned self] in self.checkSchoolQuestionUseCase as Any } + localTable["checkSchoolCodeUseCase-any CheckSchoolCodeUseCase"] = { [unowned self] in self.checkSchoolCodeUseCase as Any } } } extension SplashComponent: Registration { diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift index 7af361af..61871bd4 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift @@ -1,9 +1,16 @@ -// -// FetchListRemainApplicationItemsUseCaselmpl.swift -// DataModule -// -// Created by 홍승재 on 2023/02/19. -// Copyright © 2023 com.team.aliens. All rights reserved. -// +import Combine +import DataMappingModule +import DomainModule +import ErrorModule -import Foundation +public struct FetchListRemainApplicationItemsUseCaselmpl: FetchListRemainApplicationItemsUseCase { + private let remainsRepository: any RemainsRepository + + public init(remainsRepository: any RemainsRepository) { + self.remainsRepository = remainsRepository + } + + public func execute() -> AnyPublisher { + remainsRepository.fetchListRemainApplicationItems() + } +} diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift index e0420ae2..a973916f 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift @@ -1,9 +1,17 @@ -// -// FetchMyRemainApplicationItemsUseCaselmpl.swift -// DataModule -// -// Created by 홍승재 on 2023/02/19. -// Copyright © 2023 com.team.aliens. All rights reserved. -// +import Combine +import DataMappingModule +import DomainModule +import ErrorModule -import Foundation +public struct FetchMyRemainApplicationItemsUseCaselmpl: FetchMyRemainApplicationItemsUseCase { + private let remainsRepository: any RemainsRepository + + public init(remainsRepository: any RemainsRepository) { + self.remainsRepository = remainsRepository + } + + public func execute() -> AnyPublisher { + remainsRepository.fetchMyRemainApplicationItems() + } + +} diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift index dce50d6e..a842af4c 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift @@ -1,9 +1,16 @@ -// -// FetchRemainsAvailableTimeUseCaselmpl.swift -// DataModule -// -// Created by 홍승재 on 2023/02/19. -// Copyright © 2023 com.team.aliens. All rights reserved. -// +import Combine +import DataMappingModule +import DomainModule +import ErrorModule -import Foundation +public struct FetchRemainsAvailableTimeUseCaselmpl: FetchRemainsAvailableTimeUseCase { + private let remainsRepository: any RemainsRepository + + public init(remainsRepository: any RemainsRepository) { + self.remainsRepository = remainsRepository + } + + public func execute() -> AnyPublisher { + remainsRepository.fetchRemainsAvailableTime() + } +} diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift index d97c933a..23c63580 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift @@ -4,13 +4,12 @@ import DomainModule import ErrorModule public struct RemainingApplicationsChangesUseCaselmpl: RemainingApplicationsChangesUseCase { - private let studyRoomsRepository: any StudyRoomsRepository + private let remainsRepository: any RemainsRepository - public init(studyRoomsRepository: any StudyRoomsRepository) { - self.studyRoomsRepository = studyRoomsRepository + public init(remainsRepository: any RemainsRepository) { + self.remainsRepository = remainsRepository } - - public func execute(seatID: String) -> AnyPublisher { - studyRoomsRepository.applyStudyRoomSeat(seatID: seatID) + public func execute(id: String) -> AnyPublisher { + remainsRepository.remainingApplicationsChanges(id: id) } } diff --git a/Projects/Services/DomainModule/Sources/Remains/UseCases/RemainingApplicationsChangesUseCase.swift b/Projects/Services/DomainModule/Sources/Remains/UseCases/RemainingApplicationsChangesUseCase.swift index ca2fa0b9..243f9dc6 100644 --- a/Projects/Services/DomainModule/Sources/Remains/UseCases/RemainingApplicationsChangesUseCase.swift +++ b/Projects/Services/DomainModule/Sources/Remains/UseCases/RemainingApplicationsChangesUseCase.swift @@ -3,5 +3,5 @@ import DataMappingModule import ErrorModule public protocol RemainingApplicationsChangesUseCase { - func execute() -> AnyPublisher + func execute(id: String) -> AnyPublisher } From c588f54e57c69b0cd9a36df4e4b34f72a4812aac Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 22:58:32 +0900 Subject: [PATCH 06/30] =?UTF-8?q?feat=20::=20=EC=9E=94=EB=A5=98=EC=8B=A0?= =?UTF-8?q?=EC=B2=AD=20api=20=EB=A7=88=EB=AC=B4=EB=A6=AC=20(AppCompoent)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DI/Remains/AppComponent+Remains.swift | 30 +++++++++++++++++++ .../Sources/Application/NeedleGenerated.swift | 6 ++++ 2 files changed, 36 insertions(+) create mode 100644 Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift diff --git a/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift b/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift new file mode 100644 index 00000000..f906ae94 --- /dev/null +++ b/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift @@ -0,0 +1,30 @@ +import NeedleFoundation +import NetworkModule +import DomainModule +import DataModule + +public extension AppComponent { + var remoteRemainsDataSource: any RemoteRemainsDataSource { + RemoteRemainsDataSourceImpl(keychain: keychain) + } + + var remainsRepository: any RemainsRepository { + RemainsRepositoryImpl(remoteRemainsDataSource: remoteRemainsDataSource) + } + + var remainingApplicationsChangesUseCase: any RemainingApplicationsChangesUseCase { + RemainingApplicationsChangesUseCaselmpl(remainsRepository: remainsRepository) + } + + var fetchMyRemainApplicationItemsUseCase: any FetchMyRemainApplicationItemsUseCase { + FetchMyRemainApplicationItemsUseCaselmpl(remainsRepository: remainsRepository) + } + + var fetchListRemainApplicationItemsUseCase: any FetchListRemainApplicationItemsUseCase { + FetchListRemainApplicationItemsUseCaselmpl(remainsRepository: remainsRepository) + } + + var fetchRemainsAvailableTimeUseCase: any FetchRemainsAvailableTimeUseCase { + FetchRemainsAvailableTimeUseCaselmpl(remainsRepository: remainsRepository) + } +} diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index 61eecf9a..3e572065 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -554,6 +554,12 @@ extension AppComponent: Registration { localTable["remoteFilesDataSource-any RemoteFilesDataSource"] = { [unowned self] in self.remoteFilesDataSource as Any } localTable["filesRepository-any FilesRepository"] = { [unowned self] in self.filesRepository as Any } localTable["uploadFileUseCase-any UploadFileUseCase"] = { [unowned self] in self.uploadFileUseCase as Any } + localTable["remoteRemainsDataSource-any RemoteRemainsDataSource"] = { [unowned self] in self.remoteRemainsDataSource as Any } + localTable["remainsRepository-any RemainsRepository"] = { [unowned self] in self.remainsRepository as Any } + localTable["remainingApplicationsChangesUseCase-any RemainingApplicationsChangesUseCase"] = { [unowned self] in self.remainingApplicationsChangesUseCase as Any } + localTable["fetchMyRemainApplicationItemsUseCase-any FetchMyRemainApplicationItemsUseCase"] = { [unowned self] in self.fetchMyRemainApplicationItemsUseCase as Any } + localTable["fetchListRemainApplicationItemsUseCase-any FetchListRemainApplicationItemsUseCase"] = { [unowned self] in self.fetchListRemainApplicationItemsUseCase as Any } + localTable["fetchRemainsAvailableTimeUseCase-any FetchRemainsAvailableTimeUseCase"] = { [unowned self] in self.fetchRemainsAvailableTimeUseCase as Any } localTable["remoteSchoolDataSource-any RemoteSchoolDataSource"] = { [unowned self] in self.remoteSchoolDataSource as Any } localTable["schoolRepository-any SchoolRepository"] = { [unowned self] in self.schoolRepository as Any } localTable["fetchSchoolListUseCase-any FetchSchoolListUseCase"] = { [unowned self] in self.fetchSchoolListUseCase as Any } From 39294025471d30dcc5941bb0bc98a35270434662 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 23:15:19 +0900 Subject: [PATCH 07/30] feat :: Remains Error Message --- .../ErrorModule/Sources/DmsError.swift | 14 ++++++++ .../Services/APIKit/Sources/RemainsAPI.swift | 33 ++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/Projects/Modules/ErrorModule/Sources/DmsError.swift b/Projects/Modules/ErrorModule/Sources/DmsError.swift index d9342682..87a5d48e 100644 --- a/Projects/Modules/ErrorModule/Sources/DmsError.swift +++ b/Projects/Modules/ErrorModule/Sources/DmsError.swift @@ -42,6 +42,10 @@ public enum DmsError: Error { case notFoundAppliedSeat case noPermissionApplySeat + // MARK: - Remains + case forbidden + case notFound + case conflict } extension DmsError: LocalizedError { @@ -125,6 +129,16 @@ extension DmsError: LocalizedError { case .noPermissionApplySeat: return "신청 불가능한 자습실입니다" + + // MARK: - Remains + case .forbidden: + return "잔류 신청 기간이 아님" + + case .notFound: + return "찾을 수 없음" + + case .conflict: + return "이미 존재함" } } } diff --git a/Projects/Services/APIKit/Sources/RemainsAPI.swift b/Projects/Services/APIKit/Sources/RemainsAPI.swift index 761c0f46..d704b510 100644 --- a/Projects/Services/APIKit/Sources/RemainsAPI.swift +++ b/Projects/Services/APIKit/Sources/RemainsAPI.swift @@ -47,9 +47,40 @@ extension RemainsAPI: DmsAPI { public var errorMap: [Int: DmsError] { switch self { - default: + case .remainingApplicationsChanges: + return [ + 400: .badRequest, + 401: .tokenExpired, + 403: .forbidden, + 404: .notFound, + 409: .conflict, + 429: .tooManyRequest, + 500: .internalServerError + ] + case .fetchMyRemainApplicationItems: + return [ + 400: .badRequest, + 401: .tokenExpired, + 403: .forbidden, + 404: .notFound, + 429: .tooManyRequest, + 500: .internalServerError + ] + case .fetchRemainsAvailableTime: + return [ + 400: .badRequest, + 401: .tokenExpired, + 403: .forbidden, + 404: .notFound, + 429: .tooManyRequest, + 500: .internalServerError + ] + case .fetchListRemainApplicationItems: return [ 400: .badRequest, + 401: .tokenExpired, + 404: .notFound, + 429: .tooManyRequest, 500: .internalServerError ] } From dd05d259d330d0df318ad201a86d4d0dfef6ce23 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 23:34:19 +0900 Subject: [PATCH 08/30] feat :: Team Aliens SwiftStyleGuide --- .../DI/Remains/AppComponent+Remains.swift | 2 +- .../StudyRoomDetail/StudyRoomDetailView.swift | 2 +- Projects/Features/SplashFeature/Project.swift | 2 +- .../Modules/ErrorModule/Sources/DmsError.swift | 6 +++--- .../Services/APIKit/Sources/RemainsAPI.swift | 7 +++++++ Projects/Services/APIKit/Sources/UsersAPI.swift | 5 +---- ...hListRemainApplicationItemsResponseDTO.swift | 2 +- ...tchMyRemainApplicationItemsResponseDTO.swift | 1 + .../FetchRemainsAvailableTimeResponseDTO.swift | 2 ++ .../Response/RemainOptionResponseDTO.swift | 1 + .../lmpl/RemainsRepositoryImpl.swift | 17 ++++++++++------- ...=> FetchListRemainAppItemsUseCaselmpl.swift} | 4 ++-- ...tchMyRemainApplicationItemsUseCaselmpl.swift | 3 +-- .../FetchRemainsAvailableTimeUseCaselmpl.swift | 2 +- ...emainingApplicationsChangesUseCaselmpl.swift | 1 + ...FetchListRemainApplicationItemsUseCase.swift | 3 +-- 16 files changed, 35 insertions(+), 25 deletions(-) rename Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/{FetchListRemainApplicationItemsUseCaselmpl.swift => FetchListRemainAppItemsUseCaselmpl.swift} (80%) diff --git a/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift b/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift index f906ae94..f3c45841 100644 --- a/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift +++ b/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift @@ -21,7 +21,7 @@ public extension AppComponent { } var fetchListRemainApplicationItemsUseCase: any FetchListRemainApplicationItemsUseCase { - FetchListRemainApplicationItemsUseCaselmpl(remainsRepository: remainsRepository) + FetchListRemainAppItemsUseCaselmpl(remainsRepository: remainsRepository) } var fetchRemainsAvailableTimeUseCase: any FetchRemainsAvailableTimeUseCase { diff --git a/Projects/Features/ApplyFeature/Sources/StudyRoomDetail/StudyRoomDetailView.swift b/Projects/Features/ApplyFeature/Sources/StudyRoomDetail/StudyRoomDetailView.swift index ed401628..0b764d77 100644 --- a/Projects/Features/ApplyFeature/Sources/StudyRoomDetail/StudyRoomDetailView.swift +++ b/Projects/Features/ApplyFeature/Sources/StudyRoomDetail/StudyRoomDetailView.swift @@ -54,7 +54,7 @@ struct StudyRoomDetailView: View { .padding(.bottom, 6) HStack(spacing: 10) { - DMSWideButton(text: "취소",style: .contained, color: .GrayScale.gray4) { + DMSWideButton(text: "취소", style: .contained, color: .GrayScale.gray4) { viewModel.cancelStudyRoomSeat() } diff --git a/Projects/Features/SplashFeature/Project.swift b/Projects/Features/SplashFeature/Project.swift index 19855b5f..6b6b2d4b 100644 --- a/Projects/Features/SplashFeature/Project.swift +++ b/Projects/Features/SplashFeature/Project.swift @@ -7,4 +7,4 @@ let project = Project.makeModule( dependencies: [ .Project.Features.BaseFeature ] -) \ No newline at end of file +) diff --git a/Projects/Modules/ErrorModule/Sources/DmsError.swift b/Projects/Modules/ErrorModule/Sources/DmsError.swift index 87a5d48e..26c55646 100644 --- a/Projects/Modules/ErrorModule/Sources/DmsError.swift +++ b/Projects/Modules/ErrorModule/Sources/DmsError.swift @@ -129,14 +129,14 @@ extension DmsError: LocalizedError { case .noPermissionApplySeat: return "신청 불가능한 자습실입니다" - + // MARK: - Remains case .forbidden: return "잔류 신청 기간이 아님" - + case .notFound: return "찾을 수 없음" - + case .conflict: return "이미 존재함" } diff --git a/Projects/Services/APIKit/Sources/RemainsAPI.swift b/Projects/Services/APIKit/Sources/RemainsAPI.swift index d704b510..df5c097d 100644 --- a/Projects/Services/APIKit/Sources/RemainsAPI.swift +++ b/Projects/Services/APIKit/Sources/RemainsAPI.swift @@ -19,10 +19,13 @@ extension RemainsAPI: DmsAPI { switch self { case .remainingApplicationsChanges(let id): return "/\(id)" + case .fetchMyRemainApplicationItems: return "/my" + case .fetchRemainsAvailableTime: return "/available-time" + case .fetchListRemainApplicationItems: return "/options" } @@ -32,6 +35,7 @@ extension RemainsAPI: DmsAPI { switch self { case .remainingApplicationsChanges: return .put + case .fetchMyRemainApplicationItems, .fetchRemainsAvailableTime, .fetchListRemainApplicationItems: return .get } @@ -57,6 +61,7 @@ extension RemainsAPI: DmsAPI { 429: .tooManyRequest, 500: .internalServerError ] + case .fetchMyRemainApplicationItems: return [ 400: .badRequest, @@ -66,6 +71,7 @@ extension RemainsAPI: DmsAPI { 429: .tooManyRequest, 500: .internalServerError ] + case .fetchRemainsAvailableTime: return [ 400: .badRequest, @@ -75,6 +81,7 @@ extension RemainsAPI: DmsAPI { 429: .tooManyRequest, 500: .internalServerError ] + case .fetchListRemainApplicationItems: return [ 400: .badRequest, diff --git a/Projects/Services/APIKit/Sources/UsersAPI.swift b/Projects/Services/APIKit/Sources/UsersAPI.swift index c7176f62..90c21b41 100644 --- a/Projects/Services/APIKit/Sources/UsersAPI.swift +++ b/Projects/Services/APIKit/Sources/UsersAPI.swift @@ -34,14 +34,11 @@ extension UsersAPI: DmsAPI { switch self { case let .changePassword(req): return .requestJSONEncodable(req) - + case let .compareCurrentPasssword(password): return .requestParameters(parameters: [ "password": password ], encoding: URLEncoding.queryString) - - default: - return .requestPlain } } diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift index 5a5d76db..6fe2ec22 100644 --- a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift @@ -10,7 +10,7 @@ public struct FetchListRemainAppItemsResponseDTO: Decodable { } public let selectedOption: String public let remainOptions: [RemainOptionResponseDTO] - + enum CodingKeys: String, CodingKey { case selectedOption = "selected_option" case remainOptions = "remain_options" diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchMyRemainApplicationItemsResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchMyRemainApplicationItemsResponseDTO.swift index 70cdb972..ba8ddfb9 100644 --- a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchMyRemainApplicationItemsResponseDTO.swift +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchMyRemainApplicationItemsResponseDTO.swift @@ -6,5 +6,6 @@ public struct FetchMyRemainApplicationItemsResponseDTO: Decodable { ) { self.title = title } + public let title: String } diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift index 63ae213c..e28545c0 100644 --- a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift @@ -12,10 +12,12 @@ public struct FetchRemainsAvailableTimeResponseDTO: Decodable { self.endDayOfWeek = endDayOfWeek self.endAt = endAt } + public let startDayOfWeek: String public let startAt: String public let endDayOfWeek: String public let endAt: String + enum CodingKeys: String, CodingKey { case startDayOfWeek = "start_day_of_week" case startAt = "start_at" diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/RemainOptionResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/RemainOptionResponseDTO.swift index 7e604ae7..e36f4692 100644 --- a/Projects/Services/DataMappingModule/Sources/Remains/Response/RemainOptionResponseDTO.swift +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/RemainOptionResponseDTO.swift @@ -10,6 +10,7 @@ public struct RemainOptionResponseDTO: Decodable { self.title = title self.description = description } + public let id: String public let title: String public let description: String diff --git a/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift b/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift index dd4f05c7..c89c9c3b 100644 --- a/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift @@ -10,20 +10,23 @@ public struct RemainsRepositoryImpl: RemainsRepository { public init(remoteRemainsDataSource: any RemoteRemainsDataSource) { self.remoteRemainsDataSource = remoteRemainsDataSource } - + public func remainingApplicationsChanges(id: String) -> AnyPublisher { remoteRemainsDataSource.remainingApplicationsChanges(id: id) } - - public func fetchMyRemainApplicationItems() -> AnyPublisher { + + public func fetchMyRemainApplicationItems() -> + AnyPublisher { remoteRemainsDataSource.fetchMyRemainApplicationItems() } - - public func fetchRemainsAvailableTime() -> AnyPublisher { + + public func fetchRemainsAvailableTime() -> + AnyPublisher { remoteRemainsDataSource.fetchRemainsAvailableTime() } - - public func fetchListRemainApplicationItems() -> AnyPublisher { + + public func fetchListRemainApplicationItems() -> + AnyPublisher { remoteRemainsDataSource.fetchListRemainApplicationItems() } } diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainAppItemsUseCaselmpl.swift similarity index 80% rename from Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift rename to Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainAppItemsUseCaselmpl.swift index 61871bd4..b98015b5 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainApplicationItemsUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainAppItemsUseCaselmpl.swift @@ -3,13 +3,13 @@ import DataMappingModule import DomainModule import ErrorModule -public struct FetchListRemainApplicationItemsUseCaselmpl: FetchListRemainApplicationItemsUseCase { +public struct FetchListRemainAppItemsUseCaselmpl: FetchListRemainApplicationItemsUseCase { private let remainsRepository: any RemainsRepository public init(remainsRepository: any RemainsRepository) { self.remainsRepository = remainsRepository } - + public func execute() -> AnyPublisher { remainsRepository.fetchListRemainApplicationItems() } diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift index a973916f..a7b48ba6 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift @@ -9,9 +9,8 @@ public struct FetchMyRemainApplicationItemsUseCaselmpl: FetchMyRemainApplication public init(remainsRepository: any RemainsRepository) { self.remainsRepository = remainsRepository } - + public func execute() -> AnyPublisher { remainsRepository.fetchMyRemainApplicationItems() } - } diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift index a842af4c..37a7318a 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift @@ -9,7 +9,7 @@ public struct FetchRemainsAvailableTimeUseCaselmpl: FetchRemainsAvailableTimeUse public init(remainsRepository: any RemainsRepository) { self.remainsRepository = remainsRepository } - + public func execute() -> AnyPublisher { remainsRepository.fetchRemainsAvailableTime() } diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift index 23c63580..5692f444 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/RemainingApplicationsChangesUseCaselmpl.swift @@ -9,6 +9,7 @@ public struct RemainingApplicationsChangesUseCaselmpl: RemainingApplicationsChan public init(remainsRepository: any RemainsRepository) { self.remainsRepository = remainsRepository } + public func execute(id: String) -> AnyPublisher { remainsRepository.remainingApplicationsChanges(id: id) } diff --git a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift index b4fc3acc..b1476e05 100644 --- a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift +++ b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift @@ -3,6 +3,5 @@ import DataMappingModule import ErrorModule public protocol FetchListRemainApplicationItemsUseCase { - func execute() -> AnyPublisher + func execute() -> AnyPublisher } From b7c74f2cc6c33863ae4a048a0a33d3d8c12c3162 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 23:53:29 +0900 Subject: [PATCH 09/30] =?UTF-8?q?fix=20::=20error=20=EC=9D=B4=EB=A6=84=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/ErrorModule/Sources/DmsError.swift | 12 ++++++------ .../Services/APIKit/Sources/RemainsAPI.swift | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Projects/Modules/ErrorModule/Sources/DmsError.swift b/Projects/Modules/ErrorModule/Sources/DmsError.swift index 26c55646..6129bba4 100644 --- a/Projects/Modules/ErrorModule/Sources/DmsError.swift +++ b/Projects/Modules/ErrorModule/Sources/DmsError.swift @@ -43,9 +43,9 @@ public enum DmsError: Error { case noPermissionApplySeat // MARK: - Remains - case forbidden - case notFound - case conflict + case forbiddenPeriod + case notFoundRemain + case conflictRemain } extension DmsError: LocalizedError { @@ -131,13 +131,13 @@ extension DmsError: LocalizedError { return "신청 불가능한 자습실입니다" // MARK: - Remains - case .forbidden: + case .forbiddenPeriod: return "잔류 신청 기간이 아님" - case .notFound: + case .notFoundRemain: return "찾을 수 없음" - case .conflict: + case .conflictRemain: return "이미 존재함" } } diff --git a/Projects/Services/APIKit/Sources/RemainsAPI.swift b/Projects/Services/APIKit/Sources/RemainsAPI.swift index df5c097d..7b18d013 100644 --- a/Projects/Services/APIKit/Sources/RemainsAPI.swift +++ b/Projects/Services/APIKit/Sources/RemainsAPI.swift @@ -55,9 +55,9 @@ extension RemainsAPI: DmsAPI { return [ 400: .badRequest, 401: .tokenExpired, - 403: .forbidden, - 404: .notFound, - 409: .conflict, + 403: .forbiddenPeriod, + 404: .notFoundRemain, + 409: .conflictRemain, 429: .tooManyRequest, 500: .internalServerError ] @@ -66,8 +66,8 @@ extension RemainsAPI: DmsAPI { return [ 400: .badRequest, 401: .tokenExpired, - 403: .forbidden, - 404: .notFound, + 403: .forbiddenPeriod, + 404: .notFoundRemain, 429: .tooManyRequest, 500: .internalServerError ] @@ -76,8 +76,8 @@ extension RemainsAPI: DmsAPI { return [ 400: .badRequest, 401: .tokenExpired, - 403: .forbidden, - 404: .notFound, + 403: .forbiddenPeriod, + 404: .notFoundRemain, 429: .tooManyRequest, 500: .internalServerError ] @@ -86,7 +86,7 @@ extension RemainsAPI: DmsAPI { return [ 400: .badRequest, 401: .tokenExpired, - 404: .notFound, + 404: .notFoundRemain, 429: .tooManyRequest, 500: .internalServerError ] From c506c017f6cb9685f1621864923f46763eb4193d Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 23:56:26 +0900 Subject: [PATCH 10/30] =?UTF-8?q?fix=20::=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EC=84=A0=EC=96=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Remains/Repositories/lmpl/RemainsRepositoryImpl.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift b/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift index c89c9c3b..92ffba05 100644 --- a/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift @@ -11,22 +11,22 @@ public struct RemainsRepositoryImpl: RemainsRepository { self.remoteRemainsDataSource = remoteRemainsDataSource } - public func remainingApplicationsChanges(id: String) -> AnyPublisher { + public func remainingApplicationsChanges(id: String) -> AnyPublisher { remoteRemainsDataSource.remainingApplicationsChanges(id: id) } public func fetchMyRemainApplicationItems() -> - AnyPublisher { + AnyPublisher { remoteRemainsDataSource.fetchMyRemainApplicationItems() } public func fetchRemainsAvailableTime() -> - AnyPublisher { + AnyPublisher { remoteRemainsDataSource.fetchRemainsAvailableTime() } public func fetchListRemainApplicationItems() -> - AnyPublisher { + AnyPublisher { remoteRemainsDataSource.fetchListRemainApplicationItems() } } From 8adc1df7a5276018cee3d64a1d3b6c9376fd7881 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Sun, 19 Feb 2023 23:58:17 +0900 Subject: [PATCH 11/30] =?UTF-8?q?fix=20::=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EC=A4=84=EB=B0=94=EA=BF=88=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Entities/MyRemainApplicationItemsEntity.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Projects/Services/DomainModule/Sources/Entities/MyRemainApplicationItemsEntity.swift b/Projects/Services/DomainModule/Sources/Entities/MyRemainApplicationItemsEntity.swift index 7a4969ed..779001c2 100644 --- a/Projects/Services/DomainModule/Sources/Entities/MyRemainApplicationItemsEntity.swift +++ b/Projects/Services/DomainModule/Sources/Entities/MyRemainApplicationItemsEntity.swift @@ -1,9 +1,7 @@ import Foundation public struct MyRemainApplicationItemsEntity: Equatable, Hashable { - public init( - title: String - ) { + public init(title: String) { self.title = title } public let title: String From 3c6415957315e6b1c6f9f00fa193bc51b7c50b85 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Mon, 20 Feb 2023 00:01:40 +0900 Subject: [PATCH 12/30] =?UTF-8?q?fix=20::=20=EC=96=B4=EC=83=89=ED=95=9C=20?= =?UTF-8?q?=EB=B3=80=EC=88=98=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Application/DI/Remains/AppComponent+Remains.swift | 2 +- Projects/App/Sources/Application/NeedleGenerated.swift | 2 +- Projects/Services/APIKit/Sources/RemainsAPI.swift | 8 ++++---- .../Remains/Repositories/lmpl/RemainsRepositoryImpl.swift | 6 +++--- .../lmpl/FetchListRemainAppItemsUseCaselmpl.swift | 6 +++--- ...Entity.swift => ListRemainApplicationItemEntity.swift} | 2 +- .../Sources/Remains/Repository/RemainsRepository.swift | 2 +- .../UseCases/FetchListRemainApplicationItemUseCase.swift | 7 +++++++ .../UseCases/FetchListRemainApplicationItemsUseCase.swift | 7 ------- .../FetchListRemainAppItemsDataTransfer.swift | 4 ++-- .../Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift | 4 ++-- .../Sources/Remains/Remote/RemoteRemainsDataSource.swift | 2 +- 12 files changed, 26 insertions(+), 26 deletions(-) rename Projects/Services/DomainModule/Sources/Entities/{ListRemainApplicationItemsEntity.swift => ListRemainApplicationItemEntity.swift} (81%) create mode 100644 Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemUseCase.swift delete mode 100644 Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift diff --git a/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift b/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift index f3c45841..3740c66b 100644 --- a/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift +++ b/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift @@ -20,7 +20,7 @@ public extension AppComponent { FetchMyRemainApplicationItemsUseCaselmpl(remainsRepository: remainsRepository) } - var fetchListRemainApplicationItemsUseCase: any FetchListRemainApplicationItemsUseCase { + var fetchListRemainApplicationItemUseCase: any FetchListRemainApplicationItemUseCase { FetchListRemainAppItemsUseCaselmpl(remainsRepository: remainsRepository) } diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index 3e572065..61409375 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -558,7 +558,7 @@ extension AppComponent: Registration { localTable["remainsRepository-any RemainsRepository"] = { [unowned self] in self.remainsRepository as Any } localTable["remainingApplicationsChangesUseCase-any RemainingApplicationsChangesUseCase"] = { [unowned self] in self.remainingApplicationsChangesUseCase as Any } localTable["fetchMyRemainApplicationItemsUseCase-any FetchMyRemainApplicationItemsUseCase"] = { [unowned self] in self.fetchMyRemainApplicationItemsUseCase as Any } - localTable["fetchListRemainApplicationItemsUseCase-any FetchListRemainApplicationItemsUseCase"] = { [unowned self] in self.fetchListRemainApplicationItemsUseCase as Any } + localTable["fetchListRemainApplicationItemsUseCase-any FetchListRemainApplicationItemsUseCase"] = { [unowned self] in self.fetchListRemainApplicationItemUseCase as Any } localTable["fetchRemainsAvailableTimeUseCase-any FetchRemainsAvailableTimeUseCase"] = { [unowned self] in self.fetchRemainsAvailableTimeUseCase as Any } localTable["remoteSchoolDataSource-any RemoteSchoolDataSource"] = { [unowned self] in self.remoteSchoolDataSource as Any } localTable["schoolRepository-any SchoolRepository"] = { [unowned self] in self.schoolRepository as Any } diff --git a/Projects/Services/APIKit/Sources/RemainsAPI.swift b/Projects/Services/APIKit/Sources/RemainsAPI.swift index 7b18d013..19c3c667 100644 --- a/Projects/Services/APIKit/Sources/RemainsAPI.swift +++ b/Projects/Services/APIKit/Sources/RemainsAPI.swift @@ -7,7 +7,7 @@ public enum RemainsAPI { case remainingApplicationsChanges(id: String) case fetchMyRemainApplicationItems case fetchRemainsAvailableTime - case fetchListRemainApplicationItems + case fetchListRemainApplicationItem } extension RemainsAPI: DmsAPI { @@ -26,7 +26,7 @@ extension RemainsAPI: DmsAPI { case .fetchRemainsAvailableTime: return "/available-time" - case .fetchListRemainApplicationItems: + case .fetchListRemainApplicationItem: return "/options" } } @@ -36,7 +36,7 @@ extension RemainsAPI: DmsAPI { case .remainingApplicationsChanges: return .put - case .fetchMyRemainApplicationItems, .fetchRemainsAvailableTime, .fetchListRemainApplicationItems: + case .fetchMyRemainApplicationItems, .fetchRemainsAvailableTime, .fetchListRemainApplicationItem: return .get } } @@ -82,7 +82,7 @@ extension RemainsAPI: DmsAPI { 500: .internalServerError ] - case .fetchListRemainApplicationItems: + case .fetchListRemainApplicationItem: return [ 400: .badRequest, 401: .tokenExpired, diff --git a/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift b/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift index 92ffba05..cf71fcf1 100644 --- a/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift @@ -25,8 +25,8 @@ public struct RemainsRepositoryImpl: RemainsRepository { remoteRemainsDataSource.fetchRemainsAvailableTime() } - public func fetchListRemainApplicationItems() -> - AnyPublisher { - remoteRemainsDataSource.fetchListRemainApplicationItems() + public func fetchListRemainApplicationItem() -> + AnyPublisher { + remoteRemainsDataSource.fetchListRemainApplicationItem() } } diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainAppItemsUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainAppItemsUseCaselmpl.swift index b98015b5..b0888a88 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainAppItemsUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainAppItemsUseCaselmpl.swift @@ -3,14 +3,14 @@ import DataMappingModule import DomainModule import ErrorModule -public struct FetchListRemainAppItemsUseCaselmpl: FetchListRemainApplicationItemsUseCase { +public struct FetchListRemainAppItemsUseCaselmpl: FetchListRemainApplicationItemUseCase { private let remainsRepository: any RemainsRepository public init(remainsRepository: any RemainsRepository) { self.remainsRepository = remainsRepository } - public func execute() -> AnyPublisher { - remainsRepository.fetchListRemainApplicationItems() + public func execute() -> AnyPublisher { + remainsRepository.fetchListRemainApplicationItem() } } diff --git a/Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemsEntity.swift b/Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemEntity.swift similarity index 81% rename from Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemsEntity.swift rename to Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemEntity.swift index ebdc69dd..eafb8104 100644 --- a/Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemsEntity.swift +++ b/Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemEntity.swift @@ -1,6 +1,6 @@ import Foundation -public struct ListRemainApplicationItemsEntity: Equatable, Hashable { +public struct ListRemainApplicationItemEntity: Equatable, Hashable { public init( selectedOption: String, remainOptions: [RemainOptionEntity] diff --git a/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift b/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift index 02238e0a..68966970 100644 --- a/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift +++ b/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift @@ -6,6 +6,6 @@ public protocol RemainsRepository { func remainingApplicationsChanges(id: String) -> AnyPublisher func fetchMyRemainApplicationItems() -> AnyPublisher func fetchRemainsAvailableTime() -> AnyPublisher - func fetchListRemainApplicationItems() -> AnyPublisher AnyPublisher } diff --git a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemUseCase.swift b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemUseCase.swift new file mode 100644 index 00000000..1b6cce56 --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemUseCase.swift @@ -0,0 +1,7 @@ +import Combine +import DataMappingModule +import ErrorModule + +public protocol FetchListRemainApplicationItemUseCase { + func execute() -> AnyPublisher +} diff --git a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift deleted file mode 100644 index b1476e05..00000000 --- a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemsUseCase.swift +++ /dev/null @@ -1,7 +0,0 @@ -import Combine -import DataMappingModule -import ErrorModule - -public protocol FetchListRemainApplicationItemsUseCase { - func execute() -> AnyPublisher -} diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift index 0b55d8ba..a85a3cde 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift @@ -2,8 +2,8 @@ import DataMappingModule import DomainModule public extension FetchListRemainAppItemsResponseDTO { - func toDomain() -> ListRemainApplicationItemsEntity { - ListRemainApplicationItemsEntity( + func toDomain() -> ListRemainApplicationItemEntity { + ListRemainApplicationItemEntity( selectedOption: selectedOption, remainOptions: remainOptions.map { $0.toDomain() } ) diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift index ebdbf774..b4aeeabe 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift @@ -20,8 +20,8 @@ public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource .map { $0.toDomain() } .eraseToAnyPublisher() } - public func fetchListRemainApplicationItems() -> AnyPublisher { - request(.fetchListRemainApplicationItems, + public func fetchListRemainApplicationItem() -> AnyPublisher { + request(.fetchListRemainApplicationItem, dto: FetchListRemainAppItemsResponseDTO.self) .map { $0.toDomain() } .eraseToAnyPublisher() diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift index 84b20288..4ece4e7c 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift @@ -9,6 +9,6 @@ public protocol RemoteRemainsDataSource { func remainingApplicationsChanges(id: String) -> AnyPublisher func fetchMyRemainApplicationItems() -> AnyPublisher func fetchRemainsAvailableTime() -> AnyPublisher - func fetchListRemainApplicationItems() -> AnyPublisher AnyPublisher } From d6aa72b826c18812486b18842fdc6c4ba42b4eef Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Mon, 20 Feb 2023 22:14:23 +0900 Subject: [PATCH 13/30] =?UTF-8?q?fix=20::=20shared=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DI/Remains/AppComponent+Remains.swift | 24 ++++++++++++++----- .../Sources/Application/NeedleGenerated.swift | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift b/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift index 3740c66b..405dbedb 100644 --- a/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift +++ b/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift @@ -5,26 +5,38 @@ import DataModule public extension AppComponent { var remoteRemainsDataSource: any RemoteRemainsDataSource { - RemoteRemainsDataSourceImpl(keychain: keychain) + shared { + RemoteRemainsDataSourceImpl(keychain: keychain) + } } var remainsRepository: any RemainsRepository { - RemainsRepositoryImpl(remoteRemainsDataSource: remoteRemainsDataSource) + shared { + RemainsRepositoryImpl(remoteRemainsDataSource: remoteRemainsDataSource) + } } var remainingApplicationsChangesUseCase: any RemainingApplicationsChangesUseCase { - RemainingApplicationsChangesUseCaselmpl(remainsRepository: remainsRepository) + shared { + RemainingApplicationsChangesUseCaselmpl(remainsRepository: remainsRepository) + } } var fetchMyRemainApplicationItemsUseCase: any FetchMyRemainApplicationItemsUseCase { - FetchMyRemainApplicationItemsUseCaselmpl(remainsRepository: remainsRepository) + shared { + FetchMyRemainApplicationItemsUseCaselmpl(remainsRepository: remainsRepository) + } } var fetchListRemainApplicationItemUseCase: any FetchListRemainApplicationItemUseCase { - FetchListRemainAppItemsUseCaselmpl(remainsRepository: remainsRepository) + shared { + FetchListRemainAppItemsUseCaselmpl(remainsRepository: remainsRepository) + } } var fetchRemainsAvailableTimeUseCase: any FetchRemainsAvailableTimeUseCase { - FetchRemainsAvailableTimeUseCaselmpl(remainsRepository: remainsRepository) + shared { + FetchRemainsAvailableTimeUseCaselmpl(remainsRepository: remainsRepository) + } } } diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index 61409375..7138e2f5 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -558,7 +558,7 @@ extension AppComponent: Registration { localTable["remainsRepository-any RemainsRepository"] = { [unowned self] in self.remainsRepository as Any } localTable["remainingApplicationsChangesUseCase-any RemainingApplicationsChangesUseCase"] = { [unowned self] in self.remainingApplicationsChangesUseCase as Any } localTable["fetchMyRemainApplicationItemsUseCase-any FetchMyRemainApplicationItemsUseCase"] = { [unowned self] in self.fetchMyRemainApplicationItemsUseCase as Any } - localTable["fetchListRemainApplicationItemsUseCase-any FetchListRemainApplicationItemsUseCase"] = { [unowned self] in self.fetchListRemainApplicationItemUseCase as Any } + localTable["fetchListRemainApplicationItemUseCase-any FetchListRemainApplicationItemUseCase"] = { [unowned self] in self.fetchListRemainApplicationItemUseCase as Any } localTable["fetchRemainsAvailableTimeUseCase-any FetchRemainsAvailableTimeUseCase"] = { [unowned self] in self.fetchRemainsAvailableTimeUseCase as Any } localTable["remoteSchoolDataSource-any RemoteSchoolDataSource"] = { [unowned self] in self.remoteSchoolDataSource as Any } localTable["schoolRepository-any SchoolRepository"] = { [unowned self] in self.schoolRepository as Any } From aa6cea13343483b7f4e0cf3d36431ba4b9a3bcad Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Tue, 21 Feb 2023 14:13:03 +0900 Subject: [PATCH 14/30] =?UTF-8?q?refactor=20::=20=EC=A4=84=EB=B0=94?= =?UTF-8?q?=EA=BF=88=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Response/FetchListRemainApplicationItemsResponseDTO.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift index 6fe2ec22..6842fb8c 100644 --- a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift @@ -8,6 +8,7 @@ public struct FetchListRemainAppItemsResponseDTO: Decodable { self.selectedOption = selectedOption self.remainOptions = remainOptions } + public let selectedOption: String public let remainOptions: [RemainOptionResponseDTO] From f934601a60f6d2455e4befd670166d7f5c959c45 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Tue, 21 Feb 2023 14:15:41 +0900 Subject: [PATCH 15/30] =?UTF-8?q?refactor=20::=20error=20message=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Modules/ErrorModule/Sources/DmsError.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Projects/Modules/ErrorModule/Sources/DmsError.swift b/Projects/Modules/ErrorModule/Sources/DmsError.swift index 6129bba4..2d785036 100644 --- a/Projects/Modules/ErrorModule/Sources/DmsError.swift +++ b/Projects/Modules/ErrorModule/Sources/DmsError.swift @@ -43,7 +43,7 @@ public enum DmsError: Error { case noPermissionApplySeat // MARK: - Remains - case forbiddenPeriod + case forbiddenRemainPeriod case notFoundRemain case conflictRemain } @@ -132,13 +132,13 @@ extension DmsError: LocalizedError { // MARK: - Remains case .forbiddenPeriod: - return "잔류 신청 기간이 아님" + return "잔류 신청 기간이 아닙니다" case .notFoundRemain: - return "찾을 수 없음" + return "찾을 수 없습니다" case .conflictRemain: - return "이미 존재함" + return "이미 존재합니다" } } } From c86d0c47bd6ea7a4cf0db073468ad3ae911f5856 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Tue, 21 Feb 2023 14:16:46 +0900 Subject: [PATCH 16/30] =?UTF-8?q?refactor=20::=20=EA=B3=B5=EB=B0=B1=20?= =?UTF-8?q?=EC=A3=BD=EC=9D=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Services/APIKit/Sources/UsersAPI.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Services/APIKit/Sources/UsersAPI.swift b/Projects/Services/APIKit/Sources/UsersAPI.swift index 90c21b41..2e949085 100644 --- a/Projects/Services/APIKit/Sources/UsersAPI.swift +++ b/Projects/Services/APIKit/Sources/UsersAPI.swift @@ -34,7 +34,7 @@ extension UsersAPI: DmsAPI { switch self { case let .changePassword(req): return .requestJSONEncodable(req) - + case let .compareCurrentPasssword(password): return .requestParameters(parameters: [ "password": password From d7eb000294a9c0b87f3e541a0e2b398a531beb9a Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Tue, 21 Feb 2023 14:18:23 +0900 Subject: [PATCH 17/30] =?UTF-8?q?fix=20::=20error=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Modules/ErrorModule/Sources/DmsError.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Modules/ErrorModule/Sources/DmsError.swift b/Projects/Modules/ErrorModule/Sources/DmsError.swift index 2d785036..f7b09b15 100644 --- a/Projects/Modules/ErrorModule/Sources/DmsError.swift +++ b/Projects/Modules/ErrorModule/Sources/DmsError.swift @@ -131,7 +131,7 @@ extension DmsError: LocalizedError { return "신청 불가능한 자습실입니다" // MARK: - Remains - case .forbiddenPeriod: + case .forbiddenRemainPeriod: return "잔류 신청 기간이 아닙니다" case .notFoundRemain: From e1fc3113ffc81c121ad878da3974e3d489468d33 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Tue, 21 Feb 2023 14:25:18 +0900 Subject: [PATCH 18/30] =?UTF-8?q?refactor=20::=20=EB=B3=80=EC=88=98=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DI/Remains/AppComponent+Remains.swift | 4 ++-- .../App/Sources/Application/NeedleGenerated.swift | 2 +- Projects/Services/APIKit/Sources/RemainsAPI.swift | 14 +++++++------- ...etchListRemainApplicationItemsResponseDTO.swift | 4 ++-- .../Repositories/lmpl/RemainsRepositoryImpl.swift | 6 +++--- ...l.swift => FetchRemainAppListUseCaselmpl.swift} | 6 +++--- ...ity.swift => RemainApplicationListEntity.swift} | 2 +- .../Remains/Repository/RemainsRepository.swift | 2 +- .../FetchListRemainApplicationItemUseCase.swift | 7 ------- .../FetchRemainApplicationListUseCase.swift | 7 +++++++ .../FetchListRemainAppItemsDataTransfer.swift | 6 +++--- .../Remote/Impl/RemoteRemainsDataSourceImpl.swift | 6 +++--- .../Remains/Remote/RemoteRemainsDataSource.swift | 2 +- 13 files changed, 34 insertions(+), 34 deletions(-) rename Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/{FetchListRemainAppItemsUseCaselmpl.swift => FetchRemainAppListUseCaselmpl.swift} (50%) rename Projects/Services/DomainModule/Sources/Entities/{ListRemainApplicationItemEntity.swift => RemainApplicationListEntity.swift} (81%) delete mode 100644 Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemUseCase.swift create mode 100644 Projects/Services/DomainModule/Sources/Remains/UseCases/FetchRemainApplicationListUseCase.swift diff --git a/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift b/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift index 405dbedb..d77b72cf 100644 --- a/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift +++ b/Projects/App/Sources/Application/DI/Remains/AppComponent+Remains.swift @@ -28,9 +28,9 @@ public extension AppComponent { } } - var fetchListRemainApplicationItemUseCase: any FetchListRemainApplicationItemUseCase { + var fetchRemainApplicationListUseCase: any FetchRemainApplicationListUseCase { shared { - FetchListRemainAppItemsUseCaselmpl(remainsRepository: remainsRepository) + FetchRemainAppListUseCaselmpl(remainsRepository: remainsRepository) } } diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index 7138e2f5..35f3b4e3 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -558,7 +558,7 @@ extension AppComponent: Registration { localTable["remainsRepository-any RemainsRepository"] = { [unowned self] in self.remainsRepository as Any } localTable["remainingApplicationsChangesUseCase-any RemainingApplicationsChangesUseCase"] = { [unowned self] in self.remainingApplicationsChangesUseCase as Any } localTable["fetchMyRemainApplicationItemsUseCase-any FetchMyRemainApplicationItemsUseCase"] = { [unowned self] in self.fetchMyRemainApplicationItemsUseCase as Any } - localTable["fetchListRemainApplicationItemUseCase-any FetchListRemainApplicationItemUseCase"] = { [unowned self] in self.fetchListRemainApplicationItemUseCase as Any } + localTable["fetchRemainApplicationListUseCase-any FetchRemainApplicationListUseCase"] = { [unowned self] in self.fetchRemainApplicationListUseCase as Any } localTable["fetchRemainsAvailableTimeUseCase-any FetchRemainsAvailableTimeUseCase"] = { [unowned self] in self.fetchRemainsAvailableTimeUseCase as Any } localTable["remoteSchoolDataSource-any RemoteSchoolDataSource"] = { [unowned self] in self.remoteSchoolDataSource as Any } localTable["schoolRepository-any SchoolRepository"] = { [unowned self] in self.schoolRepository as Any } diff --git a/Projects/Services/APIKit/Sources/RemainsAPI.swift b/Projects/Services/APIKit/Sources/RemainsAPI.swift index 19c3c667..c98f534e 100644 --- a/Projects/Services/APIKit/Sources/RemainsAPI.swift +++ b/Projects/Services/APIKit/Sources/RemainsAPI.swift @@ -7,7 +7,7 @@ public enum RemainsAPI { case remainingApplicationsChanges(id: String) case fetchMyRemainApplicationItems case fetchRemainsAvailableTime - case fetchListRemainApplicationItem + case fetchRemainApplicationList } extension RemainsAPI: DmsAPI { @@ -26,7 +26,7 @@ extension RemainsAPI: DmsAPI { case .fetchRemainsAvailableTime: return "/available-time" - case .fetchListRemainApplicationItem: + case .fetchRemainApplicationList: return "/options" } } @@ -36,7 +36,7 @@ extension RemainsAPI: DmsAPI { case .remainingApplicationsChanges: return .put - case .fetchMyRemainApplicationItems, .fetchRemainsAvailableTime, .fetchListRemainApplicationItem: + case .fetchMyRemainApplicationItems, .fetchRemainsAvailableTime, .fetchRemainApplicationList: return .get } } @@ -55,7 +55,7 @@ extension RemainsAPI: DmsAPI { return [ 400: .badRequest, 401: .tokenExpired, - 403: .forbiddenPeriod, + 403: .forbiddenRemainPeriod, 404: .notFoundRemain, 409: .conflictRemain, 429: .tooManyRequest, @@ -66,7 +66,7 @@ extension RemainsAPI: DmsAPI { return [ 400: .badRequest, 401: .tokenExpired, - 403: .forbiddenPeriod, + 403: .forbiddenRemainPeriod, 404: .notFoundRemain, 429: .tooManyRequest, 500: .internalServerError @@ -76,13 +76,13 @@ extension RemainsAPI: DmsAPI { return [ 400: .badRequest, 401: .tokenExpired, - 403: .forbiddenPeriod, + 403: .forbiddenRemainPeriod, 404: .notFoundRemain, 429: .tooManyRequest, 500: .internalServerError ] - case .fetchListRemainApplicationItem: + case .fetchRemainApplicationList: return [ 400: .badRequest, 401: .tokenExpired, diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift index 6842fb8c..0c5833dd 100644 --- a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchListRemainApplicationItemsResponseDTO.swift @@ -1,6 +1,6 @@ import Foundation -public struct FetchListRemainAppItemsResponseDTO: Decodable { +public struct FetchRemainAppListResponseDTO: Decodable { public init( selectedOption: String, remainOptions: [RemainOptionResponseDTO] @@ -8,7 +8,7 @@ public struct FetchListRemainAppItemsResponseDTO: Decodable { self.selectedOption = selectedOption self.remainOptions = remainOptions } - + public let selectedOption: String public let remainOptions: [RemainOptionResponseDTO] diff --git a/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift b/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift index cf71fcf1..a845d2f9 100644 --- a/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/Repositories/lmpl/RemainsRepositoryImpl.swift @@ -25,8 +25,8 @@ public struct RemainsRepositoryImpl: RemainsRepository { remoteRemainsDataSource.fetchRemainsAvailableTime() } - public func fetchListRemainApplicationItem() -> - AnyPublisher { - remoteRemainsDataSource.fetchListRemainApplicationItem() + public func fetchRemainApplicationList() -> + AnyPublisher { + remoteRemainsDataSource.fetchRemainApplicationList() } } diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainAppItemsUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainAppListUseCaselmpl.swift similarity index 50% rename from Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainAppItemsUseCaselmpl.swift rename to Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainAppListUseCaselmpl.swift index b0888a88..53cbabf7 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchListRemainAppItemsUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainAppListUseCaselmpl.swift @@ -3,14 +3,14 @@ import DataMappingModule import DomainModule import ErrorModule -public struct FetchListRemainAppItemsUseCaselmpl: FetchListRemainApplicationItemUseCase { +public struct FetchRemainAppListUseCaselmpl: FetchRemainApplicationListUseCase { private let remainsRepository: any RemainsRepository public init(remainsRepository: any RemainsRepository) { self.remainsRepository = remainsRepository } - public func execute() -> AnyPublisher { - remainsRepository.fetchListRemainApplicationItem() + public func execute() -> AnyPublisher { + remainsRepository.fetchRemainApplicationList() } } diff --git a/Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemEntity.swift b/Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift similarity index 81% rename from Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemEntity.swift rename to Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift index eafb8104..3f549bfe 100644 --- a/Projects/Services/DomainModule/Sources/Entities/ListRemainApplicationItemEntity.swift +++ b/Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift @@ -1,6 +1,6 @@ import Foundation -public struct ListRemainApplicationItemEntity: Equatable, Hashable { +public struct RemainApplicationListEntity: Equatable, Hashable { public init( selectedOption: String, remainOptions: [RemainOptionEntity] diff --git a/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift b/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift index 68966970..6a376a9c 100644 --- a/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift +++ b/Projects/Services/DomainModule/Sources/Remains/Repository/RemainsRepository.swift @@ -6,6 +6,6 @@ public protocol RemainsRepository { func remainingApplicationsChanges(id: String) -> AnyPublisher func fetchMyRemainApplicationItems() -> AnyPublisher func fetchRemainsAvailableTime() -> AnyPublisher - func fetchListRemainApplicationItem() -> AnyPublisher AnyPublisher } diff --git a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemUseCase.swift b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemUseCase.swift deleted file mode 100644 index 1b6cce56..00000000 --- a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchListRemainApplicationItemUseCase.swift +++ /dev/null @@ -1,7 +0,0 @@ -import Combine -import DataMappingModule -import ErrorModule - -public protocol FetchListRemainApplicationItemUseCase { - func execute() -> AnyPublisher -} diff --git a/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchRemainApplicationListUseCase.swift b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchRemainApplicationListUseCase.swift new file mode 100644 index 00000000..54591455 --- /dev/null +++ b/Projects/Services/DomainModule/Sources/Remains/UseCases/FetchRemainApplicationListUseCase.swift @@ -0,0 +1,7 @@ +import Combine +import DataMappingModule +import ErrorModule + +public protocol FetchRemainApplicationListUseCase { + func execute() -> AnyPublisher +} diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift index a85a3cde..8eb69c30 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchListRemainAppItemsDataTransfer.swift @@ -1,9 +1,9 @@ import DataMappingModule import DomainModule -public extension FetchListRemainAppItemsResponseDTO { - func toDomain() -> ListRemainApplicationItemEntity { - ListRemainApplicationItemEntity( +public extension FetchRemainAppListResponseDTO { + func toDomain() -> RemainApplicationListEntity { + RemainApplicationListEntity( selectedOption: selectedOption, remainOptions: remainOptions.map { $0.toDomain() } ) diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift index b4aeeabe..55c6cab8 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift @@ -20,9 +20,9 @@ public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource .map { $0.toDomain() } .eraseToAnyPublisher() } - public func fetchListRemainApplicationItem() -> AnyPublisher { - request(.fetchListRemainApplicationItem, - dto: FetchListRemainAppItemsResponseDTO.self) + public func fetchRemainApplicationList() -> AnyPublisher { + request(.fetchRemainApplicationList, + dto: FetchRemainAppListResponseDTO.self) .map { $0.toDomain() } .eraseToAnyPublisher() } diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift index 4ece4e7c..6cc47604 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift @@ -9,6 +9,6 @@ public protocol RemoteRemainsDataSource { func remainingApplicationsChanges(id: String) -> AnyPublisher func fetchMyRemainApplicationItems() -> AnyPublisher func fetchRemainsAvailableTime() -> AnyPublisher - func fetchListRemainApplicationItem() -> AnyPublisher AnyPublisher } From 74afdc95863c0edcb4c60e9dc03a9573bf032e3e Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Tue, 21 Feb 2023 14:56:38 +0900 Subject: [PATCH 19/30] =?UTF-8?q?refactor=20::=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=ED=94=84=EB=A0=88=EC=9E=84=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=20=EB=AA=85=EC=8B=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift | 2 +- .../Remains/UserCases/lmpl/FetchRemainAppListUseCaselmpl.swift | 2 +- .../UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift index a7b48ba6..cd36364a 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchMyRemainApplicationItemsUseCaselmpl.swift @@ -10,7 +10,7 @@ public struct FetchMyRemainApplicationItemsUseCaselmpl: FetchMyRemainApplication self.remainsRepository = remainsRepository } - public func execute() -> AnyPublisher { + public func execute() -> AnyPublisher { remainsRepository.fetchMyRemainApplicationItems() } } diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainAppListUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainAppListUseCaselmpl.swift index 53cbabf7..2e4248f8 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainAppListUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainAppListUseCaselmpl.swift @@ -10,7 +10,7 @@ public struct FetchRemainAppListUseCaselmpl: FetchRemainApplicationListUseCase { self.remainsRepository = remainsRepository } - public func execute() -> AnyPublisher { + public func execute() -> AnyPublisher { remainsRepository.fetchRemainApplicationList() } } diff --git a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift index 37a7318a..01c5e6cb 100644 --- a/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift +++ b/Projects/Services/DataModule/Sources/Remains/UserCases/lmpl/FetchRemainsAvailableTimeUseCaselmpl.swift @@ -10,7 +10,7 @@ public struct FetchRemainsAvailableTimeUseCaselmpl: FetchRemainsAvailableTimeUse self.remainsRepository = remainsRepository } - public func execute() -> AnyPublisher { + public func execute() -> AnyPublisher { remainsRepository.fetchRemainsAvailableTime() } } From 7a7f038bd8c7ab209d6abef5ebbafc6f30e05a2a Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Tue, 21 Feb 2023 15:01:13 +0900 Subject: [PATCH 20/30] =?UTF-8?q?refactor=20::=20=EC=A4=84=EB=B0=94?= =?UTF-8?q?=EA=BF=88=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Remote/Impl/RemoteRemainsDataSourceImpl.swift | 14 +++++++------- .../Remains/Remote/RemoteRemainsDataSource.swift | 3 +-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift index 55c6cab8..653bccad 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift @@ -4,25 +4,25 @@ import DataMappingModule import DomainModule import ErrorModule -public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource, RemoteRemainsDataSource { +public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource, + RemoteRemainsDataSource { public func remainingApplicationsChanges(id: String) -> AnyPublisher { request(.remainingApplicationsChanges(id: id)) } + public func fetchMyRemainApplicationItems() -> AnyPublisher { - request(.fetchMyRemainApplicationItems, - dto: FetchMyRemainApplicationItemsResponseDTO.self) + request(.fetchMyRemainApplicationItems, dto: FetchMyRemainApplicationItemsResponseDTO.self) .map { $0.toDomain() } .eraseToAnyPublisher() } + public func fetchRemainsAvailableTime() -> AnyPublisher { - request(.fetchRemainsAvailableTime, - dto: FetchRemainsAvailableTimeResponseDTO.self) + request(.fetchRemainsAvailableTime, dto: FetchRemainsAvailableTimeResponseDTO.self) .map { $0.toDomain() } .eraseToAnyPublisher() } public func fetchRemainApplicationList() -> AnyPublisher { - request(.fetchRemainApplicationList, - dto: FetchRemainAppListResponseDTO.self) + request(.fetchRemainApplicationList, dto: FetchRemainAppListResponseDTO.self) .map { $0.toDomain() } .eraseToAnyPublisher() } diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift index 6cc47604..a544fcac 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/RemoteRemainsDataSource.swift @@ -9,6 +9,5 @@ public protocol RemoteRemainsDataSource { func remainingApplicationsChanges(id: String) -> AnyPublisher func fetchMyRemainApplicationItems() -> AnyPublisher func fetchRemainsAvailableTime() -> AnyPublisher - func fetchRemainApplicationList() -> AnyPublisher + func fetchRemainApplicationList() -> AnyPublisher } From ca0fe0709733ebf9e08d3debfa8339f5aeb8d133 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Wed, 22 Feb 2023 14:44:52 +0900 Subject: [PATCH 21/30] =?UTF-8?q?refactor=20::=20guide=20=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EC=B6=B0=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Services/APIKit/Sources/RemainsAPI.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Services/APIKit/Sources/RemainsAPI.swift b/Projects/Services/APIKit/Sources/RemainsAPI.swift index c98f534e..2acefd82 100644 --- a/Projects/Services/APIKit/Sources/RemainsAPI.swift +++ b/Projects/Services/APIKit/Sources/RemainsAPI.swift @@ -17,7 +17,7 @@ extension RemainsAPI: DmsAPI { public var urlPath: String { switch self { - case .remainingApplicationsChanges(let id): + case let .remainingApplicationsChanges(id): return "/\(id)" case .fetchMyRemainApplicationItems: From ab0176f2ec4998ef0c3f8b38456aaa2207960c55 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Wed, 22 Feb 2023 14:46:47 +0900 Subject: [PATCH 22/30] =?UTF-8?q?refactor=20::=20=EC=A4=84=EB=B0=94?= =?UTF-8?q?=EA=BF=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Entities/RemainApplicationListEntity.swift | 1 + .../DomainModule/Sources/Entities/RemainOptionEntity.swift | 1 + .../Sources/Entities/RemainsAvailableTimeEntity.swift | 1 + 3 files changed, 3 insertions(+) diff --git a/Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift b/Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift index 3f549bfe..abaf3dff 100644 --- a/Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift +++ b/Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift @@ -8,6 +8,7 @@ public struct RemainApplicationListEntity: Equatable, Hashable { self.selectedOption = selectedOption self.remainOptions = remainOptions } + public let selectedOption: String public let remainOptions: [RemainOptionEntity] } diff --git a/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift b/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift index 412928ee..0231a5b4 100644 --- a/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift +++ b/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift @@ -10,6 +10,7 @@ public struct RemainOptionEntity: Equatable, Hashable { self.title = title self.description = description } + public let id: String public let title: String public let description: String diff --git a/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift b/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift index e704e531..3af962fe 100644 --- a/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift +++ b/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift @@ -12,6 +12,7 @@ public struct RemainsAvailableTimeEntity: Equatable, Hashable { self.endDayOfWeek = endDayOfWeek self.endAt = endAt } + public let startDayOfWeek: String public let startAt: String public let endDayOfWeek: String From 1b4a6061bcc40c8a342b878b85c8764450a86fcb Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Wed, 22 Feb 2023 14:48:20 +0900 Subject: [PATCH 23/30] feat :: WeekDayType --- .../DataMappingModule/Sources/Enum/WeekType.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift diff --git a/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift b/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift new file mode 100644 index 00000000..11c57d0d --- /dev/null +++ b/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift @@ -0,0 +1,11 @@ +import Foundation + +public enum WeekDayType: String { + case monDay = "MONDAY" + case tuesDay = "TUESDAY" + case wednesDay = "WEDNESDAY" + case thursDay = "THURSDAY" + case friDay = "FRIDAY" + case satuDay = "SATURDAY" + case sunDay = "SUNDAY" +} From 12c888a278009b2096e530aa32443694b68caf44 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Wed, 22 Feb 2023 14:49:32 +0900 Subject: [PATCH 24/30] =?UTF-8?q?refactor=20::=20=EA=B3=B5=EB=B0=B1=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Entities/RemainApplicationListEntity.swift | 2 +- .../DomainModule/Sources/Entities/RemainOptionEntity.swift | 2 +- .../Sources/Entities/RemainsAvailableTimeEntity.swift | 2 +- .../Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift b/Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift index abaf3dff..49e9ea89 100644 --- a/Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift +++ b/Projects/Services/DomainModule/Sources/Entities/RemainApplicationListEntity.swift @@ -8,7 +8,7 @@ public struct RemainApplicationListEntity: Equatable, Hashable { self.selectedOption = selectedOption self.remainOptions = remainOptions } - + public let selectedOption: String public let remainOptions: [RemainOptionEntity] } diff --git a/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift b/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift index 0231a5b4..0bda16ec 100644 --- a/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift +++ b/Projects/Services/DomainModule/Sources/Entities/RemainOptionEntity.swift @@ -10,7 +10,7 @@ public struct RemainOptionEntity: Equatable, Hashable { self.title = title self.description = description } - + public let id: String public let title: String public let description: String diff --git a/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift b/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift index 3af962fe..bece9a6d 100644 --- a/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift +++ b/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift @@ -12,7 +12,7 @@ public struct RemainsAvailableTimeEntity: Equatable, Hashable { self.endDayOfWeek = endDayOfWeek self.endAt = endAt } - + public let startDayOfWeek: String public let startAt: String public let endDayOfWeek: String diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift index 653bccad..5d4c9b4c 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift @@ -9,13 +9,13 @@ public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource public func remainingApplicationsChanges(id: String) -> AnyPublisher { request(.remainingApplicationsChanges(id: id)) } - + public func fetchMyRemainApplicationItems() -> AnyPublisher { request(.fetchMyRemainApplicationItems, dto: FetchMyRemainApplicationItemsResponseDTO.self) .map { $0.toDomain() } .eraseToAnyPublisher() } - + public func fetchRemainsAvailableTime() -> AnyPublisher { request(.fetchRemainsAvailableTime, dto: FetchRemainsAvailableTimeResponseDTO.self) .map { $0.toDomain() } From 959edbe7c269a94e18fe0da770f9799834aa14e4 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Wed, 22 Feb 2023 14:54:08 +0900 Subject: [PATCH 25/30] refactor :: WeekType --- .../Sources/Enum/WeekType.swift | 16 ++++++++-------- .../Impl/RemoteRemainsDataSourceImpl.swift | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift b/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift index 11c57d0d..bee174c3 100644 --- a/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift +++ b/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift @@ -1,11 +1,11 @@ import Foundation -public enum WeekDayType: String { - case monDay = "MONDAY" - case tuesDay = "TUESDAY" - case wednesDay = "WEDNESDAY" - case thursDay = "THURSDAY" - case friDay = "FRIDAY" - case satuDay = "SATURDAY" - case sunDay = "SUNDAY" +public enum WeekType: String { + case monday = "MONDAY" + case tuesday = "TUESDAY" + case wednesday = "WEDNESDAY" + case thursday = "THURSDAY" + case friday = "FRIDAY" + case satuday = "SATURDAY" + case sunday = "SUNDAY" } diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift index 5d4c9b4c..d27dd704 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift @@ -21,6 +21,7 @@ public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource .map { $0.toDomain() } .eraseToAnyPublisher() } + public func fetchRemainApplicationList() -> AnyPublisher { request(.fetchRemainApplicationList, dto: FetchRemainAppListResponseDTO.self) .map { $0.toDomain() } From 19ced42b60e799d8e5670e0e6b5ce605dd505c84 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Wed, 22 Feb 2023 16:10:48 +0900 Subject: [PATCH 26/30] =?UTF-8?q?feat=20::=20DTO=EC=97=90=20WeekType=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataMappingModule/Sources/Enum/WeekType.swift | 2 +- .../Response/FetchRemainsAvailableTimeResponseDTO.swift | 8 ++++---- ...DTO.swift => FetchStudyAvailableTimeResponseDTO.swift} | 0 .../FetchRemainsAvailableTimeDataTransfer.swift | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) rename Projects/Services/DataMappingModule/Sources/StudyRooms/Response/{FetchAvailableTimeResponseDTO.swift => FetchStudyAvailableTimeResponseDTO.swift} (100%) diff --git a/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift b/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift index bee174c3..b28a3bad 100644 --- a/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift +++ b/Projects/Services/DataMappingModule/Sources/Enum/WeekType.swift @@ -1,6 +1,6 @@ import Foundation -public enum WeekType: String { +public enum WeekType: String, Decodable { case monday = "MONDAY" case tuesday = "TUESDAY" case wednesday = "WEDNESDAY" diff --git a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift index e28545c0..aaa91494 100644 --- a/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift +++ b/Projects/Services/DataMappingModule/Sources/Remains/Response/FetchRemainsAvailableTimeResponseDTO.swift @@ -2,9 +2,9 @@ import Foundation public struct FetchRemainsAvailableTimeResponseDTO: Decodable { public init( - startDayOfWeek: String, + startDayOfWeek: WeekType, startAt: String, - endDayOfWeek: String, + endDayOfWeek: WeekType, endAt: String ) { self.startDayOfWeek = startDayOfWeek @@ -13,9 +13,9 @@ public struct FetchRemainsAvailableTimeResponseDTO: Decodable { self.endAt = endAt } - public let startDayOfWeek: String + public let startDayOfWeek: WeekType public let startAt: String - public let endDayOfWeek: String + public let endDayOfWeek: WeekType public let endAt: String enum CodingKeys: String, CodingKey { diff --git a/Projects/Services/DataMappingModule/Sources/StudyRooms/Response/FetchAvailableTimeResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/StudyRooms/Response/FetchStudyAvailableTimeResponseDTO.swift similarity index 100% rename from Projects/Services/DataMappingModule/Sources/StudyRooms/Response/FetchAvailableTimeResponseDTO.swift rename to Projects/Services/DataMappingModule/Sources/StudyRooms/Response/FetchStudyAvailableTimeResponseDTO.swift diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift index 6edfc8c8..e9ee084c 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift @@ -4,9 +4,9 @@ import DomainModule public extension FetchRemainsAvailableTimeResponseDTO { func toDomain() -> RemainsAvailableTimeEntity { RemainsAvailableTimeEntity( - startDayOfWeek: startDayOfWeek, + startDayOfWeek: startDayOfWeek.rawValue, startAt: startAt, - endDayOfWeek: endDayOfWeek, + endDayOfWeek: endDayOfWeek.rawValue, endAt: endAt ) } From 9c830c0fbfe416dc9c90d2591b63322709392da9 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Wed, 22 Feb 2023 16:22:35 +0900 Subject: [PATCH 27/30] =?UTF-8?q?feat=20::=20Entity=EC=97=90=20WeekType=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Entities/RemainsAvailableTimeEntity.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift b/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift index bece9a6d..b7a05197 100644 --- a/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift +++ b/Projects/Services/DomainModule/Sources/Entities/RemainsAvailableTimeEntity.swift @@ -1,10 +1,11 @@ import Foundation +import DataMappingModule public struct RemainsAvailableTimeEntity: Equatable, Hashable { public init( - startDayOfWeek: String, + startDayOfWeek: WeekType, startAt: String, - endDayOfWeek: String, + endDayOfWeek: WeekType, endAt: String ) { self.startDayOfWeek = startDayOfWeek @@ -13,8 +14,8 @@ public struct RemainsAvailableTimeEntity: Equatable, Hashable { self.endAt = endAt } - public let startDayOfWeek: String + public let startDayOfWeek: WeekType public let startAt: String - public let endDayOfWeek: String + public let endDayOfWeek: WeekType public let endAt: String } From 99e898e17a0866b909dff2675ebd3b130d69b994 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Wed, 22 Feb 2023 16:29:46 +0900 Subject: [PATCH 28/30] fix :: Error resolved --- .../DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift index e9ee084c..6edfc8c8 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/DataTransfer/FetchRemainsAvailableTimeDataTransfer.swift @@ -4,9 +4,9 @@ import DomainModule public extension FetchRemainsAvailableTimeResponseDTO { func toDomain() -> RemainsAvailableTimeEntity { RemainsAvailableTimeEntity( - startDayOfWeek: startDayOfWeek.rawValue, + startDayOfWeek: startDayOfWeek, startAt: startAt, - endDayOfWeek: endDayOfWeek.rawValue, + endDayOfWeek: endDayOfWeek, endAt: endAt ) } From 19d5353411ad5c2f2c7f6b6421487031eca93a64 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Wed, 22 Feb 2023 21:28:08 +0900 Subject: [PATCH 29/30] =?UTF-8?q?refactor=20::=20RemoteRemainsDataSourcelm?= =?UTF-8?q?pl=20=EC=BD=94=EB=93=9C=20control=20+=20i=20(=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EC=A0=95=EB=A6=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Impl/RemoteRemainsDataSourceImpl.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift index d27dd704..10b12a2f 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift @@ -9,22 +9,22 @@ public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource public func remainingApplicationsChanges(id: String) -> AnyPublisher { request(.remainingApplicationsChanges(id: id)) } - + public func fetchMyRemainApplicationItems() -> AnyPublisher { request(.fetchMyRemainApplicationItems, dto: FetchMyRemainApplicationItemsResponseDTO.self) - .map { $0.toDomain() } - .eraseToAnyPublisher() + .map { $0.toDomain() } + .eraseToAnyPublisher() } - + public func fetchRemainsAvailableTime() -> AnyPublisher { request(.fetchRemainsAvailableTime, dto: FetchRemainsAvailableTimeResponseDTO.self) - .map { $0.toDomain() } - .eraseToAnyPublisher() + .map { $0.toDomain() } + .eraseToAnyPublisher() } - + public func fetchRemainApplicationList() -> AnyPublisher { request(.fetchRemainApplicationList, dto: FetchRemainAppListResponseDTO.self) - .map { $0.toDomain() } - .eraseToAnyPublisher() + .map { $0.toDomain() } + .eraseToAnyPublisher() } } From 49182e05190d6d2f3cd803acfa389275b96746a4 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Wed, 22 Feb 2023 22:06:46 +0900 Subject: [PATCH 30/30] fix :: Error solved --- .../Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift index 10b12a2f..456d937a 100644 --- a/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift +++ b/Projects/Services/NetworkModule/Sources/Remains/Remote/Impl/RemoteRemainsDataSourceImpl.swift @@ -9,19 +9,19 @@ public final class RemoteRemainsDataSourceImpl: BaseRemoteDataSource public func remainingApplicationsChanges(id: String) -> AnyPublisher { request(.remainingApplicationsChanges(id: id)) } - + public func fetchMyRemainApplicationItems() -> AnyPublisher { request(.fetchMyRemainApplicationItems, dto: FetchMyRemainApplicationItemsResponseDTO.self) .map { $0.toDomain() } .eraseToAnyPublisher() } - + public func fetchRemainsAvailableTime() -> AnyPublisher { request(.fetchRemainsAvailableTime, dto: FetchRemainsAvailableTimeResponseDTO.self) .map { $0.toDomain() } .eraseToAnyPublisher() } - + public func fetchRemainApplicationList() -> AnyPublisher { request(.fetchRemainApplicationList, dto: FetchRemainAppListResponseDTO.self) .map { $0.toDomain() }