From c88a3fdd3a00dd935f79bd84d719ead7a6335118 Mon Sep 17 00:00:00 2001 From: TaeKyeongKim Date: Thu, 30 Jun 2022 15:59:02 +0900 Subject: [PATCH 1/7] =?UTF-8?q?FetchOpenIssueListURLConfiguration=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IssueTracker.xcodeproj/project.pbxproj | 32 ++++++++++++-- .../DataLayer/DTO/IssueCard.swift | 42 +++++++++++++++++++ .../DataLayer/Network/EndPoint/EndPoint.swift | 2 +- .../FetchOpenIssueListURLConfiguration.swift | 17 ++++++++ .../URLComponent/GitURLConfiguration.swift | 1 + .../Protocol/URLConfigurable.swift | 3 ++ .../URLComponent/TokenURLConfiguration.swift | 1 + .../DefaultIssueCardRepository.swift | 13 ++++++ .../FetchIssueCardRepository.swift | 32 ++++++++++++++ .../Entity/IssueCardEntity.swift} | 10 ++--- .../HomeScene/View/HomeViewController.swift | 25 +++++------ .../HomeScene/View/IssuseCardCell.swift | 4 +- .../LoginScene/View/LoginViewController.swift | 1 - 13 files changed, 158 insertions(+), 25 deletions(-) create mode 100644 iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift create mode 100644 iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/FetchOpenIssueListURLConfiguration.swift create mode 100644 iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/DefaultIssueCardRepository.swift create mode 100644 iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift rename iOS/IssueTracker/IssueTracker/{DataLayer/DTO/IssueCardDTO.swift => DomainLayer/Entity/IssueCardEntity.swift} (58%) diff --git a/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj b/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj index 664649ccdf..d770f3f1e9 100644 --- a/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj +++ b/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj @@ -16,7 +16,7 @@ B7A56D9528618E0900EA639D /* IssuseCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9428618E0900EA639D /* IssuseCardCell.swift */; }; B7A56D9728618F6800EA639D /* UIFont+.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9628618F6800EA639D /* UIFont+.swift */; }; B7A56D992861913300EA639D /* BadgeLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D982861913300EA639D /* BadgeLabel.swift */; }; - B7A56D9B2861C5E600EA639D /* IssueCardDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9A2861C5E600EA639D /* IssueCardDTO.swift */; }; + B7A56D9B2861C5E600EA639D /* IssueCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9A2861C5E600EA639D /* IssueCard.swift */; }; B7A56D9D2861C79D00EA639D /* SelectionLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9C2861C79D00EA639D /* SelectionLabel.swift */; }; B7A56DA02862B8B300EA639D /* IssueAddButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9F2862B8B300EA639D /* IssueAddButton.swift */; }; B7A56DA8286470CF00EA639D /* LoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DA7286470CF00EA639D /* LoginViewModel.swift */; }; @@ -34,6 +34,10 @@ B7A836FB285B39B500A06C77 /* HTTPPackageable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A836FA285B39B500A06C77 /* HTTPPackageable.swift */; }; B7A836FD285B3A1200A06C77 /* EndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A836FC285B3A1200A06C77 /* EndPoint.swift */; }; B7A83710285C1A1300A06C77 /* GithubAuthorizationUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A8370F285C1A1300A06C77 /* GithubAuthorizationUsecase.swift */; }; + B7AB7E3F286D6F730051095E /* IssueCardEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AB7E3E286D6F730051095E /* IssueCardEntity.swift */; }; + B7AB7E42286D70360051095E /* DefaultIssueCardRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AB7E41286D70360051095E /* DefaultIssueCardRepository.swift */; }; + B7AB7E44286D70510051095E /* FetchIssueCardRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AB7E43286D70510051095E /* FetchIssueCardRepository.swift */; }; + B7AB7E46286D73490051095E /* FetchOpenIssueListURLConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AB7E45286D73490051095E /* FetchOpenIssueListURLConfiguration.swift */; }; B7E58B6D2858505A004C6BE6 /* ClientKey.plist in Resources */ = {isa = PBXBuildFile; fileRef = B7E58B6C2858505A004C6BE6 /* ClientKey.plist */; }; B7E58B6F28586FCE004C6BE6 /* NetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E58B6E28586FCE004C6BE6 /* NetworkService.swift */; }; B7E58B7128587013004C6BE6 /* HTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E58B7028587013004C6BE6 /* HTTPMethod.swift */; }; @@ -78,7 +82,7 @@ B7A56D9428618E0900EA639D /* IssuseCardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssuseCardCell.swift; sourceTree = ""; }; B7A56D9628618F6800EA639D /* UIFont+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+.swift"; sourceTree = ""; }; B7A56D982861913300EA639D /* BadgeLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeLabel.swift; sourceTree = ""; }; - B7A56D9A2861C5E600EA639D /* IssueCardDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueCardDTO.swift; sourceTree = ""; }; + B7A56D9A2861C5E600EA639D /* IssueCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueCard.swift; sourceTree = ""; }; B7A56D9C2861C79D00EA639D /* SelectionLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectionLabel.swift; sourceTree = ""; }; B7A56D9F2862B8B300EA639D /* IssueAddButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueAddButton.swift; sourceTree = ""; }; B7A56DA7286470CF00EA639D /* LoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewModel.swift; sourceTree = ""; }; @@ -96,6 +100,10 @@ B7A836FA285B39B500A06C77 /* HTTPPackageable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPPackageable.swift; sourceTree = ""; }; B7A836FC285B3A1200A06C77 /* EndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EndPoint.swift; sourceTree = ""; }; B7A8370F285C1A1300A06C77 /* GithubAuthorizationUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GithubAuthorizationUsecase.swift; sourceTree = ""; }; + B7AB7E3E286D6F730051095E /* IssueCardEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueCardEntity.swift; sourceTree = ""; }; + B7AB7E41286D70360051095E /* DefaultIssueCardRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultIssueCardRepository.swift; sourceTree = ""; }; + B7AB7E43286D70510051095E /* FetchIssueCardRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchIssueCardRepository.swift; sourceTree = ""; }; + B7AB7E45286D73490051095E /* FetchOpenIssueListURLConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchOpenIssueListURLConfiguration.swift; sourceTree = ""; }; B7E58B6C2858505A004C6BE6 /* ClientKey.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = ClientKey.plist; sourceTree = ""; }; B7E58B6E28586FCE004C6BE6 /* NetworkService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkService.swift; sourceTree = ""; }; B7E58B7028587013004C6BE6 /* HTTPMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPMethod.swift; sourceTree = ""; }; @@ -190,6 +198,7 @@ B7A56DB9286A73A900EA639D /* Repository */ = { isa = PBXGroup; children = ( + B7AB7E40286D70090051095E /* DefaultIssueCardRepository */, B7A56DBA286A73BE00EA639D /* DefaultUserInfoRepository */, ); path = Repository; @@ -226,6 +235,7 @@ children = ( B7A836F2285B32C900A06C77 /* GitURLConfiguration.swift */, B7A56DC4286A937600EA639D /* TokenURLConfiguration.swift */, + B7AB7E45286D73490051095E /* FetchOpenIssueListURLConfiguration.swift */, B7A836EC285B30EA00A06C77 /* Protocol */, ); path = URLComponent; @@ -249,6 +259,15 @@ path = Protocol; sourceTree = ""; }; + B7AB7E40286D70090051095E /* DefaultIssueCardRepository */ = { + isa = PBXGroup; + children = ( + B7AB7E41286D70360051095E /* DefaultIssueCardRepository.swift */, + B7AB7E43286D70510051095E /* FetchIssueCardRepository.swift */, + ); + path = DefaultIssueCardRepository; + sourceTree = ""; + }; B7E58B6928584D0C004C6BE6 /* Network */ = { isa = PBXGroup; children = ( @@ -325,7 +344,7 @@ D2A999802862F4F900910F7D /* DTO */ = { isa = PBXGroup; children = ( - B7A56D9A2861C5E600EA639D /* IssueCardDTO.swift */, + B7A56D9A2861C5E600EA639D /* IssueCard.swift */, ); path = DTO; sourceTree = ""; @@ -336,6 +355,7 @@ D2A9997E2862BE9500910F7D /* IssueAddListEntity.swift */, D2A9998F28655CE200910F7D /* TokenInfo.swift */, D2A9999128655D0900910F7D /* GrantResource.swift */, + B7AB7E3E286D6F730051095E /* IssueCardEntity.swift */, ); path = Entity; sourceTree = ""; @@ -621,7 +641,7 @@ D291537C285B6B6500B5CDA8 /* NetworkError.swift in Sources */, B7A56DC3286A7E2500EA639D /* Encoder.swift in Sources */, B7A56DB8286A71E900EA639D /* RequestUserInfoUsecase.swift in Sources */, - B7A56D9B2861C5E600EA639D /* IssueCardDTO.swift in Sources */, + B7A56D9B2861C5E600EA639D /* IssueCard.swift in Sources */, B7A836F9285B392800A06C77 /* EndPointable.swift in Sources */, B7A56DC7286A98DA00EA639D /* DefaultRequestUserInfoUsecase.swift in Sources */, D2A9999028655CE200910F7D /* TokenInfo.swift in Sources */, @@ -641,9 +661,11 @@ D2D5265E2858D98400581C88 /* OAuthLoginButton.swift in Sources */, D2D526632859A65600581C88 /* OAuthButtonDelegate.swift in Sources */, D2B7506A2856FCBE0078067A /* SceneDelegate.swift in Sources */, + B7AB7E3F286D6F730051095E /* IssueCardEntity.swift in Sources */, B71A0A032859B8FF0030D3ED /* NotificationCenter.swift in Sources */, D2D526592858CF5000581C88 /* UIImage+.swift in Sources */, D2D526612858DF7B00581C88 /* UIColor+.swift in Sources */, + B7AB7E42286D70360051095E /* DefaultIssueCardRepository.swift in Sources */, B7A56DA8286470CF00EA639D /* LoginViewModel.swift in Sources */, D2A9999228655D0900910F7D /* GrantResource.swift in Sources */, D2A9997528615F3600910F7D /* CommentContainerView.swift in Sources */, @@ -655,10 +677,12 @@ D2A9998E2865584700910F7D /* Observable.swift in Sources */, B7A836F0285B322000A06C77 /* URLConfigurable.swift in Sources */, D2A9997F2862BE9500910F7D /* IssueAddListEntity.swift in Sources */, + B7AB7E46286D73490051095E /* FetchOpenIssueListURLConfiguration.swift in Sources */, D2915381285B740500B5CDA8 /* DefaultLoginUsecase.swift in Sources */, B7A56DC5286A937600EA639D /* TokenURLConfiguration.swift in Sources */, B7A836EE285B319500A06C77 /* Bundle+.swift in Sources */, B7A83710285C1A1300A06C77 /* GithubAuthorizationUsecase.swift in Sources */, + B7AB7E44286D70510051095E /* FetchIssueCardRepository.swift in Sources */, B7A56D9D2861C79D00EA639D /* SelectionLabel.swift in Sources */, B7A56DBE286A77FA00EA639D /* UserInfoRepository.swift in Sources */, B7A56DA02862B8B300EA639D /* IssueAddButton.swift in Sources */, diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift b/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift new file mode 100644 index 0000000000..62d6faac23 --- /dev/null +++ b/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift @@ -0,0 +1,42 @@ +// +// IssueCard.swift +// IssueTracker +// +// Created by Kai Kim on 2022/06/21. +// + +import Foundation + +// MARK: - Empty +struct Empty: Codable { + let issues: [IssueCard] +} + +// MARK: - Issue +struct IssueCard: Codable { + let issueID: Int + let title, content: String + let milestoneID: Int + let milestoneName: String + let labels: [Label] + + enum CodingKeys: String, CodingKey { + case issueID = "issueId" + case title, content + case milestoneID = "milestoneId" + case milestoneName, labels + } +} + +// MARK: - Label +struct Label: Codable { + let labelID: Int? + let labelName, labelColor: String + let lableID: Int? + + enum CodingKeys: String, CodingKey { + case labelID = "labelId" + case labelName, labelColor + case lableID = "lableId" + } +} diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPoint.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPoint.swift index d43f4db61a..f14417c87b 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPoint.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPoint.swift @@ -31,7 +31,7 @@ struct EndPoint: EndPointable, HTTPPackageable { components.scheme = urlConfigure.scheme components.host = urlConfigure.host components.path = urlConfigure.path - components.queryItems = queryItems + components.queryItems = urlConfigure.queryItem guard let url = components.url else { preconditionFailure("Invalid URL components: \(components)" )} diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/FetchOpenIssueListURLConfiguration.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/FetchOpenIssueListURLConfiguration.swift new file mode 100644 index 0000000000..82458229bb --- /dev/null +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/FetchOpenIssueListURLConfiguration.swift @@ -0,0 +1,17 @@ +// +// FetchIssueListURLConfiguration.swift +// IssueTracker +// +// Created by Kai Kim on 2022/06/30. +// + +import Foundation + +struct FetchOpenIssueListURLConfiguration: URLConfigurable { + var scheme: String = "https" + var host: String = "0e1f525b-4045-4a86-b2d7-b782850ccb9f.mock.pstmn.io" + var path: String = "/issue-tracker/api/issues" + var queryItem: [URLQueryItem]? = [URLQueryItem(name: "isOpened", value: "true")] +} +//https://0e1f525b-4045-4a86-b2d7-b782850ccb9f.mock.pstmn.io/issue-tracker/api/issues?isOpened=true +//https://0e1f525b-4045-4a86-b2d7-b782850ccb9f.mock.pstmn.io/issue-tracker/api/issues%3FisOpened=true diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/GitURLConfiguration.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/GitURLConfiguration.swift index 1a750e97f7..308868c381 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/GitURLConfiguration.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/GitURLConfiguration.swift @@ -8,5 +8,6 @@ import Foundation struct GitURLConfiguration: URLConfigurable { + var queryItem: [URLQueryItem]? var path = "/login/code/github" } diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/Protocol/URLConfigurable.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/Protocol/URLConfigurable.swift index e4ca856970..9b2dc7ddae 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/Protocol/URLConfigurable.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/Protocol/URLConfigurable.swift @@ -8,7 +8,10 @@ import Foundation protocol URLConfigurable { + var scheme: String {get} + var host: String {get} var path: String {get} + var queryItem: [URLQueryItem]? {get} } extension URLConfigurable { diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/TokenURLConfiguration.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/TokenURLConfiguration.swift index ea38c2945e..a205470196 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/TokenURLConfiguration.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/TokenURLConfiguration.swift @@ -8,5 +8,6 @@ import Foundation struct TokenURLConfiguration: URLConfigurable { + var queryItem: [URLQueryItem]? var path: String = "/login/oauth/github" } diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/DefaultIssueCardRepository.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/DefaultIssueCardRepository.swift new file mode 100644 index 0000000000..197b08b113 --- /dev/null +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/DefaultIssueCardRepository.swift @@ -0,0 +1,13 @@ +// +// DefaultIssueCardRepository.swift +// IssueTracker +// +// Created by Kai Kim on 2022/06/30. +// + +import Foundation + +protocol DefaultIssueCardRepository { + var endPoint: EndPoint {get} + func fetchIssueCard(completion: @escaping (Empty?) -> Void) +} diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift new file mode 100644 index 0000000000..f78c3fc4b1 --- /dev/null +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift @@ -0,0 +1,32 @@ +// +// FetchIssueCardRepository.swift +// IssueTracker +// +// Created by Kai Kim on 2022/06/30. +// + +import Foundation + +final class FetchIssueCardRepository: DefaultIssueCardRepository { + + var endPoint: EndPoint + + init(endPoint: EndPoint) { + self.endPoint = endPoint + } + + func fetchIssueCard(completion: @escaping (Empty?) -> Void) { + NetworkService.request(endPoint: endPoint) { result in + print(self.endPoint.url) + switch result { + case .success(let data): + let decoder = Decoder() + let issuecards = decoder.decode(data: data) + completion(issuecards) + case .failure(let error): + print(error) + } + } + } + +} diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCardDTO.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Entity/IssueCardEntity.swift similarity index 58% rename from iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCardDTO.swift rename to iOS/IssueTracker/IssueTracker/DomainLayer/Entity/IssueCardEntity.swift index 8d514a376c..a609f2d126 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCardDTO.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Entity/IssueCardEntity.swift @@ -1,22 +1,22 @@ // -// IssueCard.swift +// IssueCardEntity.swift // IssueTracker // -// Created by Kai Kim on 2022/06/21. +// Created by Kai Kim on 2022/06/30. // import Foundation -struct IssueCardDTO: Identifiable { +struct IssueCardEntity: Identifiable { let id: Int let title: String let content: String let isSelected: Bool let mileStone: String? - let labels: [Label] + let labels: [LabelEntity] } -struct Label: Identifiable { +struct LabelEntity: Identifiable { let id: Int let labelName: String let labelColor: String diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift index bceedf9573..88f1e4eeea 100644 --- a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift @@ -10,7 +10,7 @@ import UIKit class HomeViewController: UIViewController { private var homeTableView: UITableView? - private var dataSource: TableViewDataSource? + private var dataSource: TableViewDataSource? private var issueCreateButton: IssueAddButton? override func viewDidLoad() { @@ -58,20 +58,21 @@ private extension HomeViewController { } func setDataSource() { +// +// let labels1 = [Label(id: 2, labelName: "이것의 끝은 어디인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30")] +// +// let labels2 = [Label(id: 2, labelName: "이것의 끝은 어디인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30"), Label(id: 3, labelName: "이것의 끝은 dddd어디인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30"), Label(id: 4, labelName: "이것의 끝은 어디ds인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30")] +// + let mockEntity = IssueCardEntity(id: 2, title: "dasd", content: "Asdd", isSelected: false, mileStone: "asdsad", labels: [LabelEntity(id: 2, labelName: "dsd", labelColor: "asdasd")]) +// +// let mockEntity2 = IssueCardDTO(id: 2, title: "야호", content: "이건 우리안의 소리 연결고리연결고리연결고리연결고리연결고리연결고리 이건 우리안의 소리 ", isSelected: true, mileStone: nil, labels: labels2) +// + var testData = [mockEntity] - let labels1 = [Label(id: 2, labelName: "이것의 끝은 어디인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30")] - - let labels2 = [Label(id: 2, labelName: "이것의 끝은 어디인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30"), Label(id: 3, labelName: "이것의 끝은 dddd어디인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30"), Label(id: 4, labelName: "이것의 끝은 어디ds인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30")] - - let mockEntity = IssueCardDTO(id: 1, title: "야호", content: "너와나의 연결고리 이건 우리안의 소리 너와나의 연결고리 이건 우리안의 소리 연결고리 이건 우리안의 소리 ", isSelected: false, mileStone: "dsds", labels: labels1) - - let mockEntity2 = IssueCardDTO(id: 2, title: "야호", content: "이건 우리안의 소리 연결고리연결고리연결고리연결고리연결고리연결고리 이건 우리안의 소리 ", isSelected: true, mileStone: nil, labels: labels2) - - var testData = [mockEntity, mockEntity2, mockEntity, mockEntity2, mockEntity] - - let dataSource = TableViewDataSource(testData, reuseIdentifier: IssuseCardCell.id, cellConfigurator: { (model: IssueCardDTO, cell: IssuseCardCell) in + let dataSource = TableViewDataSource(testData, reuseIdentifier: IssuseCardCell.id, cellConfigurator: { (model: IssueCardEntity, cell: IssuseCardCell) in cell.configure(model: model) }) + self.dataSource = dataSource homeTableView?.dataSource = dataSource } diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/IssuseCardCell.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/IssuseCardCell.swift index efafbaccbc..524ab6eeaa 100644 --- a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/IssuseCardCell.swift +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/IssuseCardCell.swift @@ -107,10 +107,10 @@ class IssuseCardCell: UITableViewCell { extension IssuseCardCell { - func configure(model: IssueCardDTO) { + func configure(model: IssueCardEntity) { title.text = model.title content.text = model.content - selectionImageView.isSelected = model.isSelected + selectionImageView.isSelected = model.isSelected mileStoneLabel.text = model.mileStone model.labels.forEach({ let badgeLabel = BadgeLabel() diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/View/LoginViewController.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/View/LoginViewController.swift index 0fc6bf6286..5e88371f65 100644 --- a/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/View/LoginViewController.swift +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/View/LoginViewController.swift @@ -42,7 +42,6 @@ class LoginViewController: UIViewController { setViewsConstraint() setLoginViewModelBinding() oauthLoginView.delegate = self - } } From 504fdbcd8000c60d101f33a24bb7c6eb925d797d Mon Sep 17 00:00:00 2001 From: wnsxor1993 Date: Thu, 30 Jun 2022 16:03:02 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[wnsxor1993#107]refactor:=20EndPointable=20?= =?UTF-8?q?query=20=EA=B5=AC=EB=AC=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IssueTracker/DataLayer/Network/EndPoint/EndPoint.swift | 5 ----- .../DataLayer/Network/EndPoint/EndPointable.swift | 1 - 2 files changed, 6 deletions(-) diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPoint.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPoint.swift index f14417c87b..3d3d6941e0 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPoint.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPoint.swift @@ -21,11 +21,6 @@ struct EndPoint: EndPointable, HTTPPackageable { self.body = body } - var queryItems: [URLQueryItem]? { - // TODO: Issue card 정보 불러올때 사용예정 [미구현] - return nil - } - var url: URL { var components = URLComponents() components.scheme = urlConfigure.scheme diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPointable.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPointable.swift index 92f1584473..76bf979c61 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPointable.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Network/EndPoint/EndPointable.swift @@ -8,6 +8,5 @@ import Foundation protocol EndPointable { - var queryItems: [URLQueryItem]? {get} var url: URL {get} } From 6e713080df7bb5e442e2ab75eb13730553b2f8e6 Mon Sep 17 00:00:00 2001 From: wnsxor1993 Date: Thu, 30 Jun 2022 16:27:46 +0900 Subject: [PATCH 3/7] =?UTF-8?q?[wnsxor1993#107]feat:=20IssueCardUsecase=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IssueTracker.xcodeproj/project.pbxproj | 16 +++++++++++ .../DataLayer/DTO/IssueCard.swift | 16 +++++++++-- .../DomainLayer/Entity/IssueCardEntity.swift | 2 +- .../DefaultIssueCardUsecase.swift | 15 +++++++++++ .../FetchIssueCardUsecase.swift | 27 +++++++++++++++++++ 5 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/DefaultIssueCardUsecase.swift create mode 100644 iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift diff --git a/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj b/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj index d770f3f1e9..67e00412ad 100644 --- a/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj +++ b/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj @@ -41,6 +41,8 @@ B7E58B6D2858505A004C6BE6 /* ClientKey.plist in Resources */ = {isa = PBXBuildFile; fileRef = B7E58B6C2858505A004C6BE6 /* ClientKey.plist */; }; B7E58B6F28586FCE004C6BE6 /* NetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E58B6E28586FCE004C6BE6 /* NetworkService.swift */; }; B7E58B7128587013004C6BE6 /* HTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E58B7028587013004C6BE6 /* HTTPMethod.swift */; }; + D2861E81286D826600E544A5 /* DefaultIssueCardUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E80286D826600E544A5 /* DefaultIssueCardUsecase.swift */; }; + D2861E83286D82D900E544A5 /* FetchIssueCardUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E82286D82D900E544A5 /* FetchIssueCardUsecase.swift */; }; D291537A285B6B3300B5CDA8 /* NetworkServiceable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2915379285B6B3300B5CDA8 /* NetworkServiceable.swift */; }; D291537C285B6B6500B5CDA8 /* NetworkError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D291537B285B6B6500B5CDA8 /* NetworkError.swift */; }; D291537E285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D291537D285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift */; }; @@ -107,6 +109,8 @@ B7E58B6C2858505A004C6BE6 /* ClientKey.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = ClientKey.plist; sourceTree = ""; }; B7E58B6E28586FCE004C6BE6 /* NetworkService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkService.swift; sourceTree = ""; }; B7E58B7028587013004C6BE6 /* HTTPMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPMethod.swift; sourceTree = ""; }; + D2861E80286D826600E544A5 /* DefaultIssueCardUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultIssueCardUsecase.swift; sourceTree = ""; }; + D2861E82286D82D900E544A5 /* FetchIssueCardUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchIssueCardUsecase.swift; sourceTree = ""; }; D2915379285B6B3300B5CDA8 /* NetworkServiceable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkServiceable.swift; sourceTree = ""; }; D291537B285B6B6500B5CDA8 /* NetworkError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkError.swift; sourceTree = ""; }; D291537D285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleAuthorizationUsecase.swift; sourceTree = ""; }; @@ -279,6 +283,15 @@ path = Network; sourceTree = ""; }; + D2861E7F286D823200E544A5 /* DefatultIssueCard */ = { + isa = PBXGroup; + children = ( + D2861E80286D826600E544A5 /* DefaultIssueCardUsecase.swift */, + D2861E82286D82D900E544A5 /* FetchIssueCardUsecase.swift */, + ); + path = DefatultIssueCard; + sourceTree = ""; + }; D2915377285B436000B5CDA8 /* Service */ = { isa = PBXGroup; children = ( @@ -372,6 +385,7 @@ D2A999832862F58D00910F7D /* Usecase */ = { isa = PBXGroup; children = ( + D2861E7F286D823200E544A5 /* DefatultIssueCard */, B7A56DC8286A98DF00EA639D /* DefaultRequestUserInfo */, D291537F285B72E200B5CDA8 /* DefaultRequestGrantCode */, ); @@ -651,6 +665,7 @@ B7E58B7128587013004C6BE6 /* HTTPMethod.swift in Sources */, D291537A285B6B3300B5CDA8 /* NetworkServiceable.swift in Sources */, B7A56DBC286A73CA00EA639D /* DefaultUserInfoRepository.swift in Sources */, + D2861E83286D82D900E544A5 /* FetchIssueCardUsecase.swift in Sources */, B7A836FD285B3A1200A06C77 /* EndPoint.swift in Sources */, B7A56D9728618F6800EA639D /* UIFont+.swift in Sources */, B7A56D992861913300EA639D /* BadgeLabel.swift in Sources */, @@ -690,6 +705,7 @@ D2D5264C285850A100581C88 /* LoginInputView.swift in Sources */, D2915385286013DB00B5CDA8 /* OAuth.swift in Sources */, D2A9998B2864055400910F7D /* CommentTitleContainerView.swift in Sources */, + D2861E81286D826600E544A5 /* DefaultIssueCardUsecase.swift in Sources */, B7A836F3285B32C900A06C77 /* GitURLConfiguration.swift in Sources */, D2D5264E2858557700581C88 /* UIView+.swift in Sources */, ); diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift b/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift index 62d6faac23..98e3ec05de 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift @@ -32,11 +32,23 @@ struct IssueCard: Codable { struct Label: Codable { let labelID: Int? let labelName, labelColor: String - let lableID: Int? enum CodingKeys: String, CodingKey { case labelID = "labelId" case labelName, labelColor - case lableID = "lableId" + } +} + +extension IssueCard { + + func toDomain() -> IssueCardEntity { + return .init(id: issueID, title: title, content: content, isSelected: false, mileStone: milestoneName, labels: labels.map { $0.toDomain() }) + } +} + +extension Label { + + func toDomain() -> LabelEntity { + return .init(id: labelID, labelName: labelName, labelColor: labelColor) } } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Entity/IssueCardEntity.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Entity/IssueCardEntity.swift index a609f2d126..dca83b6fd4 100644 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Entity/IssueCardEntity.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Entity/IssueCardEntity.swift @@ -17,7 +17,7 @@ struct IssueCardEntity: Identifiable { } struct LabelEntity: Identifiable { - let id: Int + let id: Int? let labelName: String let labelColor: String } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/DefaultIssueCardUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/DefaultIssueCardUsecase.swift new file mode 100644 index 0000000000..17ae1a937a --- /dev/null +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/DefaultIssueCardUsecase.swift @@ -0,0 +1,15 @@ +// +// DefaultShowingIssueCardUsecase.swift +// IssueTracker +// +// Created by juntaek.oh on 2022/06/30. +// + +import Foundation + +protocol DefaultIssueCardUsecase { + associatedtype T + + var fetchIssueCardRepository: DefaultIssueCardRepository { get } + func execute(completion: @escaping (T) -> Void) +} diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift new file mode 100644 index 0000000000..f0a35ecfee --- /dev/null +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift @@ -0,0 +1,27 @@ +// +// FetchIssueCardUsecase.swift +// IssueTracker +// +// Created by juntaek.oh on 2022/06/30. +// + +import Foundation + +final class FetchIssueCardUsecase: DefaultIssueCardUsecase { + typealias T = [IssueCardEntity] + + private(set) var fetchIssueCardRepository: DefaultIssueCardRepository + + init(repository: DefaultIssueCardRepository) { + self.fetchIssueCardRepository = repository + } + + func execute(completion: @escaping (T) -> Void) { + fetchIssueCardRepository.fetchIssueCard { issueCards in + guard let issueCards = issueCards else { return } + + let issueEntities: [IssueCardEntity] = issueCards.issues.map { $0.toDomain() } + completion(issueEntities) + } + } +} From b329c0908f7465823345dd4ae01966c776e42b4f Mon Sep 17 00:00:00 2001 From: wnsxor1993 Date: Thu, 30 Jun 2022 17:36:45 +0900 Subject: [PATCH 4/7] =?UTF-8?q?[wnsxor1993#107]feat:=20HomeViewModel=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IssueTracker.xcodeproj/project.pbxproj | 28 +++++++++++++------ .../FetchOpenIssueListURLConfiguration.swift | 2 -- .../FetchIssueCardRepository.swift | 2 +- .../DefaultIssueCardUsecase.swift | 15 ---------- .../FetchIssueCardUsecase.swift | 21 +++----------- .../FetchOpenIssueCardUsecase.swift | 26 +++++++++++++++++ .../HomeScene/View/HomeViewController.swift | 5 ++++ .../HomeScene/ViewModel/HomeViewModel.swift | 25 +++++++++++++++++ 8 files changed, 81 insertions(+), 43 deletions(-) delete mode 100644 iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/DefaultIssueCardUsecase.swift create mode 100644 iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchOpenIssueCardUsecase.swift create mode 100644 iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift diff --git a/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj b/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj index 67e00412ad..67daf30866 100644 --- a/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj +++ b/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj @@ -41,8 +41,9 @@ B7E58B6D2858505A004C6BE6 /* ClientKey.plist in Resources */ = {isa = PBXBuildFile; fileRef = B7E58B6C2858505A004C6BE6 /* ClientKey.plist */; }; B7E58B6F28586FCE004C6BE6 /* NetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E58B6E28586FCE004C6BE6 /* NetworkService.swift */; }; B7E58B7128587013004C6BE6 /* HTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E58B7028587013004C6BE6 /* HTTPMethod.swift */; }; - D2861E81286D826600E544A5 /* DefaultIssueCardUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E80286D826600E544A5 /* DefaultIssueCardUsecase.swift */; }; - D2861E83286D82D900E544A5 /* FetchIssueCardUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E82286D82D900E544A5 /* FetchIssueCardUsecase.swift */; }; + D2861E81286D826600E544A5 /* FetchIssueCardUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E80286D826600E544A5 /* FetchIssueCardUsecase.swift */; }; + D2861E83286D82D900E544A5 /* FetchOpenIssueCardUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E82286D82D900E544A5 /* FetchOpenIssueCardUsecase.swift */; }; + D2861E86286D882000E544A5 /* HomeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E85286D882000E544A5 /* HomeViewModel.swift */; }; D291537A285B6B3300B5CDA8 /* NetworkServiceable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2915379285B6B3300B5CDA8 /* NetworkServiceable.swift */; }; D291537C285B6B6500B5CDA8 /* NetworkError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D291537B285B6B6500B5CDA8 /* NetworkError.swift */; }; D291537E285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D291537D285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift */; }; @@ -109,8 +110,9 @@ B7E58B6C2858505A004C6BE6 /* ClientKey.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = ClientKey.plist; sourceTree = ""; }; B7E58B6E28586FCE004C6BE6 /* NetworkService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkService.swift; sourceTree = ""; }; B7E58B7028587013004C6BE6 /* HTTPMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPMethod.swift; sourceTree = ""; }; - D2861E80286D826600E544A5 /* DefaultIssueCardUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultIssueCardUsecase.swift; sourceTree = ""; }; - D2861E82286D82D900E544A5 /* FetchIssueCardUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchIssueCardUsecase.swift; sourceTree = ""; }; + D2861E80286D826600E544A5 /* FetchIssueCardUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchIssueCardUsecase.swift; sourceTree = ""; }; + D2861E82286D82D900E544A5 /* FetchOpenIssueCardUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchOpenIssueCardUsecase.swift; sourceTree = ""; }; + D2861E85286D882000E544A5 /* HomeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewModel.swift; sourceTree = ""; }; D2915379285B6B3300B5CDA8 /* NetworkServiceable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkServiceable.swift; sourceTree = ""; }; D291537B285B6B6500B5CDA8 /* NetworkError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkError.swift; sourceTree = ""; }; D291537D285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleAuthorizationUsecase.swift; sourceTree = ""; }; @@ -175,6 +177,7 @@ B724DC9328605902007DAC1A /* HomeScene */ = { isa = PBXGroup; children = ( + D2861E84286D880700E544A5 /* ViewModel */, D2A999872862F70100910F7D /* View */, ); path = HomeScene; @@ -286,12 +289,20 @@ D2861E7F286D823200E544A5 /* DefatultIssueCard */ = { isa = PBXGroup; children = ( - D2861E80286D826600E544A5 /* DefaultIssueCardUsecase.swift */, - D2861E82286D82D900E544A5 /* FetchIssueCardUsecase.swift */, + D2861E80286D826600E544A5 /* FetchIssueCardUsecase.swift */, + D2861E82286D82D900E544A5 /* FetchOpenIssueCardUsecase.swift */, ); path = DefatultIssueCard; sourceTree = ""; }; + D2861E84286D880700E544A5 /* ViewModel */ = { + isa = PBXGroup; + children = ( + D2861E85286D882000E544A5 /* HomeViewModel.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; D2915377285B436000B5CDA8 /* Service */ = { isa = PBXGroup; children = ( @@ -665,7 +676,7 @@ B7E58B7128587013004C6BE6 /* HTTPMethod.swift in Sources */, D291537A285B6B3300B5CDA8 /* NetworkServiceable.swift in Sources */, B7A56DBC286A73CA00EA639D /* DefaultUserInfoRepository.swift in Sources */, - D2861E83286D82D900E544A5 /* FetchIssueCardUsecase.swift in Sources */, + D2861E83286D82D900E544A5 /* FetchOpenIssueCardUsecase.swift in Sources */, B7A836FD285B3A1200A06C77 /* EndPoint.swift in Sources */, B7A56D9728618F6800EA639D /* UIFont+.swift in Sources */, B7A56D992861913300EA639D /* BadgeLabel.swift in Sources */, @@ -692,6 +703,7 @@ D2A9998E2865584700910F7D /* Observable.swift in Sources */, B7A836F0285B322000A06C77 /* URLConfigurable.swift in Sources */, D2A9997F2862BE9500910F7D /* IssueAddListEntity.swift in Sources */, + D2861E86286D882000E544A5 /* HomeViewModel.swift in Sources */, B7AB7E46286D73490051095E /* FetchOpenIssueListURLConfiguration.swift in Sources */, D2915381285B740500B5CDA8 /* DefaultLoginUsecase.swift in Sources */, B7A56DC5286A937600EA639D /* TokenURLConfiguration.swift in Sources */, @@ -705,7 +717,7 @@ D2D5264C285850A100581C88 /* LoginInputView.swift in Sources */, D2915385286013DB00B5CDA8 /* OAuth.swift in Sources */, D2A9998B2864055400910F7D /* CommentTitleContainerView.swift in Sources */, - D2861E81286D826600E544A5 /* DefaultIssueCardUsecase.swift in Sources */, + D2861E81286D826600E544A5 /* FetchIssueCardUsecase.swift in Sources */, B7A836F3285B32C900A06C77 /* GitURLConfiguration.swift in Sources */, D2D5264E2858557700581C88 /* UIView+.swift in Sources */, ); diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/FetchOpenIssueListURLConfiguration.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/FetchOpenIssueListURLConfiguration.swift index 82458229bb..5b7ef2eaa6 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/FetchOpenIssueListURLConfiguration.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Network/URLComponent/FetchOpenIssueListURLConfiguration.swift @@ -13,5 +13,3 @@ struct FetchOpenIssueListURLConfiguration: URLConfigurable { var path: String = "/issue-tracker/api/issues" var queryItem: [URLQueryItem]? = [URLQueryItem(name: "isOpened", value: "true")] } -//https://0e1f525b-4045-4a86-b2d7-b782850ccb9f.mock.pstmn.io/issue-tracker/api/issues?isOpened=true -//https://0e1f525b-4045-4a86-b2d7-b782850ccb9f.mock.pstmn.io/issue-tracker/api/issues%3FisOpened=true diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift index f78c3fc4b1..062e8e7ac5 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift @@ -11,7 +11,7 @@ final class FetchIssueCardRepository: DefaultIssueCardRepository { var endPoint: EndPoint - init(endPoint: EndPoint) { + init(endPoint: EndPoint = EndPoint(urlConfigure: FetchOpenIssueListURLConfiguration(), method: .GET, body: nil)) { self.endPoint = endPoint } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/DefaultIssueCardUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/DefaultIssueCardUsecase.swift deleted file mode 100644 index 17ae1a937a..0000000000 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/DefaultIssueCardUsecase.swift +++ /dev/null @@ -1,15 +0,0 @@ -// -// DefaultShowingIssueCardUsecase.swift -// IssueTracker -// -// Created by juntaek.oh on 2022/06/30. -// - -import Foundation - -protocol DefaultIssueCardUsecase { - associatedtype T - - var fetchIssueCardRepository: DefaultIssueCardRepository { get } - func execute(completion: @escaping (T) -> Void) -} diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift index f0a35ecfee..02a2ffaaea 100644 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift @@ -1,5 +1,5 @@ // -// FetchIssueCardUsecase.swift +// DefaultShowingIssueCardUsecase.swift // IssueTracker // // Created by juntaek.oh on 2022/06/30. @@ -7,21 +7,8 @@ import Foundation -final class FetchIssueCardUsecase: DefaultIssueCardUsecase { - typealias T = [IssueCardEntity] +protocol FetchIssueCardUsecase { - private(set) var fetchIssueCardRepository: DefaultIssueCardRepository - - init(repository: DefaultIssueCardRepository) { - self.fetchIssueCardRepository = repository - } - - func execute(completion: @escaping (T) -> Void) { - fetchIssueCardRepository.fetchIssueCard { issueCards in - guard let issueCards = issueCards else { return } - - let issueEntities: [IssueCardEntity] = issueCards.issues.map { $0.toDomain() } - completion(issueEntities) - } - } + var fetchIssueCardRepository: DefaultIssueCardRepository { get } + func execute(completion: @escaping ([IssueCardEntity]) -> Void) } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchOpenIssueCardUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchOpenIssueCardUsecase.swift new file mode 100644 index 0000000000..da26d16c06 --- /dev/null +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchOpenIssueCardUsecase.swift @@ -0,0 +1,26 @@ +// +// FetchIssueCardUsecase.swift +// IssueTracker +// +// Created by juntaek.oh on 2022/06/30. +// + +import Foundation + +final class FetchOpenIssueCardUsecase: FetchIssueCardUsecase { + + private(set) var fetchIssueCardRepository: DefaultIssueCardRepository + + init(repository: DefaultIssueCardRepository = FetchIssueCardRepository()) { + self.fetchIssueCardRepository = repository + } + + func execute(completion: @escaping ([IssueCardEntity]) -> Void) { + fetchIssueCardRepository.fetchIssueCard { issueCards in + guard let issueCards = issueCards else { return } + + let issueEntities: [IssueCardEntity] = issueCards.issues.map { $0.toDomain() } + completion(issueEntities) + } + } +} diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift index 88f1e4eeea..cad8cd8c1a 100644 --- a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift @@ -12,11 +12,16 @@ class HomeViewController: UIViewController { private var homeTableView: UITableView? private var dataSource: TableViewDataSource? private var issueCreateButton: IssueAddButton? + + let homeVM = HomeViewModel() override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .secondarySystemBackground configureDisplay() + homeVM.issueCards.bind { issueCards in + // 관련 작업 + } } override func viewWillAppear(_ animated: Bool) { diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift new file mode 100644 index 0000000000..f33e353b69 --- /dev/null +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift @@ -0,0 +1,25 @@ +// +// HomeViewModel.swift +// IssueTracker +// +// Created by juntaek.oh on 2022/06/30. +// + +import Foundation + +final class HomeViewModel { + + private var fetchOpenIssueCardUsecase: FetchIssueCardUsecase + + var issueCards: Observable<[IssueCardEntity]?> = Observable(nil) + + init(fetchIssueUsecase: FetchIssueCardUsecase = FetchOpenIssueCardUsecase()) { + self.fetchOpenIssueCardUsecase = fetchIssueUsecase + } + + func fetchIssueCards() { + fetchOpenIssueCardUsecase.execute { issueCards in + self.issueCards.updateValue(value: issueCards) + } + } +} From 17002f790d8d67f9008d54f0961cee4d1fd041ee Mon Sep 17 00:00:00 2001 From: TaeKyeongKim Date: Thu, 30 Jun 2022 18:08:58 +0900 Subject: [PATCH 5/7] =?UTF-8?q?[wnsxor1993#107]=20feat:=20HomeViewControll?= =?UTF-8?q?er=20=EC=97=90=20homeViewModel=20=EB=B0=94=EC=9D=B8=EB=94=A9=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FetchIssueCardRepository.swift | 1 - .../IssueTracker/Helper/Observable.swift | 2 +- .../HomeScene/View/HomeViewController.swift | 30 ++++++++----------- .../HomeScene/View/TableViewDataSource.swift | 9 +++--- .../HomeScene/ViewModel/HomeViewModel.swift | 4 +-- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift index 062e8e7ac5..b7e85b53fc 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift @@ -17,7 +17,6 @@ final class FetchIssueCardRepository: DefaultIssueCardRepository { func fetchIssueCard(completion: @escaping (Empty?) -> Void) { NetworkService.request(endPoint: endPoint) { result in - print(self.endPoint.url) switch result { case .success(let data): let decoder = Decoder() diff --git a/iOS/IssueTracker/IssueTracker/Helper/Observable.swift b/iOS/IssueTracker/IssueTracker/Helper/Observable.swift index a0c7a89f0c..510c0c3da8 100644 --- a/iOS/IssueTracker/IssueTracker/Helper/Observable.swift +++ b/iOS/IssueTracker/IssueTracker/Helper/Observable.swift @@ -11,7 +11,7 @@ final class Observable { typealias Listener = ((T) -> Void) private var listener: Listener? - private var value: T { + var value: T { didSet { listener?(value) } diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift index cad8cd8c1a..b0234c5586 100644 --- a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/HomeViewController.swift @@ -12,16 +12,14 @@ class HomeViewController: UIViewController { private var homeTableView: UITableView? private var dataSource: TableViewDataSource? private var issueCreateButton: IssueAddButton? - + let homeVM = HomeViewModel() override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .secondarySystemBackground configureDisplay() - homeVM.issueCards.bind { issueCards in - // 관련 작업 - } + setDataBinding() } override func viewWillAppear(_ animated: Bool) { @@ -36,7 +34,6 @@ private extension HomeViewController { setNavigation() setTableView() setDataSource() - setDataBinding() setAddButton() setConstraints() } @@ -63,18 +60,7 @@ private extension HomeViewController { } func setDataSource() { -// -// let labels1 = [Label(id: 2, labelName: "이것의 끝은 어디인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30")] -// -// let labels2 = [Label(id: 2, labelName: "이것의 끝은 어디인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30"), Label(id: 3, labelName: "이것의 끝은 dddd어디인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30"), Label(id: 4, labelName: "이것의 끝은 어디ds인가", labelColor: "#020070"), Label(id: 3, labelName: "북치고 장구치기 낄낄", labelColor: "#FF3B30")] -// - let mockEntity = IssueCardEntity(id: 2, title: "dasd", content: "Asdd", isSelected: false, mileStone: "asdsad", labels: [LabelEntity(id: 2, labelName: "dsd", labelColor: "asdasd")]) -// -// let mockEntity2 = IssueCardDTO(id: 2, title: "야호", content: "이건 우리안의 소리 연결고리연결고리연결고리연결고리연결고리연결고리 이건 우리안의 소리 ", isSelected: true, mileStone: nil, labels: labels2) -// - var testData = [mockEntity] - - let dataSource = TableViewDataSource(testData, reuseIdentifier: IssuseCardCell.id, cellConfigurator: { (model: IssueCardEntity, cell: IssuseCardCell) in + let dataSource = TableViewDataSource(homeVM.issueCards.value, reuseIdentifier: IssuseCardCell.id, cellConfigurator: { (model: IssueCardEntity, cell: IssuseCardCell) in cell.configure(model: model) }) @@ -83,7 +69,15 @@ private extension HomeViewController { } func setDataBinding() { - // MARK: TO BE IMPLEMENTED WITH VIEWMODEL + homeVM.issueCards.bind {[weak self] issueCards in + + guard let issueCards = issueCards else {return} + self?.dataSource?.updateData(issueCards) + DispatchQueue.main.async { + self?.homeTableView?.reloadData() + } + } + homeVM.fetchIssueCards() } func setAddButton() { diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/TableViewDataSource.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/TableViewDataSource.swift index a23e900297..71fe6c8690 100644 --- a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/TableViewDataSource.swift +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/View/TableViewDataSource.swift @@ -10,22 +10,23 @@ import UIKit final class TableViewDataSource: NSObject, UITableViewDataSource { typealias CellConfigurator = (Model, Cell) -> Void - private(set) var models: [Model] + private(set) var models: [Model]? private let reuseIdentifier: String private let cellConfigurator: CellConfigurator - init(_ models: [Model], reuseIdentifier: String, cellConfigurator: @escaping CellConfigurator) { + init(_ models: [Model]?, reuseIdentifier: String, cellConfigurator: @escaping CellConfigurator) { self.models = models self.reuseIdentifier = reuseIdentifier self.cellConfigurator = cellConfigurator } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - models.count + guard let models = models else {return 0} + return models.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - guard let cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier) as? Cell else {return UITableViewCell()} + guard let cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier) as? Cell, let models = models else {return UITableViewCell()} cellConfigurator(models[indexPath.row], cell) return cell } diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift index f33e353b69..587cc7fc67 100644 --- a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift @@ -10,13 +10,13 @@ import Foundation final class HomeViewModel { private var fetchOpenIssueCardUsecase: FetchIssueCardUsecase - + var issueCards: Observable<[IssueCardEntity]?> = Observable(nil) init(fetchIssueUsecase: FetchIssueCardUsecase = FetchOpenIssueCardUsecase()) { self.fetchOpenIssueCardUsecase = fetchIssueUsecase } - + func fetchIssueCards() { fetchOpenIssueCardUsecase.execute { issueCards in self.issueCards.updateValue(value: issueCards) From 077e4e97311a17164615bba64bf0b3f5134e3a88 Mon Sep 17 00:00:00 2001 From: wnsxor1993 Date: Fri, 1 Jul 2022 12:06:34 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[wnsxor1993#107]refactor:=20Usecase,=20Repo?= =?UTF-8?q?sitory=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IssueTracker.xcodeproj/project.pbxproj | 114 +++++++++--------- .../{IssueCard.swift => IssueCardDTO.swift} | 14 +-- ... => ViewFilteredIssueCardRepository.swift} | 6 +- ...ry.swift => ViewIssueCardRepository.swift} | 4 +- ...> DefaultRequestTokenInfoRepository.swift} | 4 +- ...swift => RequestTokenInfoRepository.swift} | 4 +- .../RequestUserInfoUsecase.swift | 28 ----- .../AppleLoginUsecase.swift} | 12 +- .../GithubLoginUsecase.swift} | 23 +--- .../LoginUsecase.swift} | 4 +- .../DefaultRequestTokenInfoUsecase.swift | 28 +++++ .../RequestTokenInfoUsecase.swift} | 4 +- .../ViewFilteredIssueCardUsecase.swift} | 6 +- .../ViewIssueCardUsecase.swift} | 2 +- .../HomeScene/ViewModel/HomeViewModel.swift | 4 +- .../LoginScene/View/LoginViewController.swift | 2 +- .../LoginScene/ViewModel/LoginViewModel.swift | 12 +- 17 files changed, 128 insertions(+), 143 deletions(-) rename iOS/IssueTracker/IssueTracker/DataLayer/DTO/{IssueCard.swift => IssueCardDTO.swift} (82%) rename iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/{FetchIssueCardRepository.swift => ViewFilteredIssueCardRepository.swift} (75%) rename iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/{DefaultIssueCardRepository.swift => ViewIssueCardRepository.swift} (58%) rename iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/{UserInfoRepository.swift => DefaultRequestTokenInfoRepository.swift} (79%) rename iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/{DefaultUserInfoRepository.swift => RequestTokenInfoRepository.swift} (59%) delete mode 100644 iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestUserInfo/RequestUserInfoUsecase.swift rename iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/{DefaultRequestGrantCode/AppleAuthorizationUsecase.swift => LoginUsecase/AppleLoginUsecase.swift} (84%) rename iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/{DefaultRequestGrantCode/GithubAuthorizationUsecase.swift => LoginUsecase/GithubLoginUsecase.swift} (50%) rename iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/{DefaultRequestGrantCode/DefaultLoginUsecase.swift => LoginUsecase/LoginUsecase.swift} (66%) create mode 100644 iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/DefaultRequestTokenInfoUsecase.swift rename iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/{DefaultRequestUserInfo/DefaultRequestUserInfoUsecase.swift => RequestTokenInfoUsecase/RequestTokenInfoUsecase.swift} (64%) rename iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/{DefatultIssueCard/FetchOpenIssueCardUsecase.swift => ViewIssueCardUsecase/ViewFilteredIssueCardUsecase.swift} (70%) rename iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/{DefatultIssueCard/FetchIssueCardUsecase.swift => ViewIssueCardUsecase/ViewIssueCardUsecase.swift} (89%) diff --git a/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj b/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj index 67daf30866..a862c677b0 100644 --- a/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj +++ b/iOS/IssueTracker/IssueTracker.xcodeproj/project.pbxproj @@ -16,38 +16,38 @@ B7A56D9528618E0900EA639D /* IssuseCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9428618E0900EA639D /* IssuseCardCell.swift */; }; B7A56D9728618F6800EA639D /* UIFont+.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9628618F6800EA639D /* UIFont+.swift */; }; B7A56D992861913300EA639D /* BadgeLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D982861913300EA639D /* BadgeLabel.swift */; }; - B7A56D9B2861C5E600EA639D /* IssueCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9A2861C5E600EA639D /* IssueCard.swift */; }; + B7A56D9B2861C5E600EA639D /* IssueCardDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9A2861C5E600EA639D /* IssueCardDTO.swift */; }; B7A56D9D2861C79D00EA639D /* SelectionLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9C2861C79D00EA639D /* SelectionLabel.swift */; }; B7A56DA02862B8B300EA639D /* IssueAddButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56D9F2862B8B300EA639D /* IssueAddButton.swift */; }; B7A56DA8286470CF00EA639D /* LoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DA7286470CF00EA639D /* LoginViewModel.swift */; }; - B7A56DB8286A71E900EA639D /* RequestUserInfoUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DB7286A71E900EA639D /* RequestUserInfoUsecase.swift */; }; - B7A56DBC286A73CA00EA639D /* DefaultUserInfoRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DBB286A73CA00EA639D /* DefaultUserInfoRepository.swift */; }; - B7A56DBE286A77FA00EA639D /* UserInfoRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DBD286A77FA00EA639D /* UserInfoRepository.swift */; }; + B7A56DB8286A71E900EA639D /* DefaultRequestTokenInfoUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DB7286A71E900EA639D /* DefaultRequestTokenInfoUsecase.swift */; }; + B7A56DBC286A73CA00EA639D /* RequestTokenInfoRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DBB286A73CA00EA639D /* RequestTokenInfoRepository.swift */; }; + B7A56DBE286A77FA00EA639D /* DefaultRequestTokenInfoRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DBD286A77FA00EA639D /* DefaultRequestTokenInfoRepository.swift */; }; B7A56DC0286A7E1200EA639D /* Decoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DBF286A7E1200EA639D /* Decoder.swift */; }; B7A56DC3286A7E2500EA639D /* Encoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DC2286A7E2500EA639D /* Encoder.swift */; }; B7A56DC5286A937600EA639D /* TokenURLConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DC4286A937600EA639D /* TokenURLConfiguration.swift */; }; - B7A56DC7286A98DA00EA639D /* DefaultRequestUserInfoUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DC6286A98DA00EA639D /* DefaultRequestUserInfoUsecase.swift */; }; + B7A56DC7286A98DA00EA639D /* RequestTokenInfoUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A56DC6286A98DA00EA639D /* RequestTokenInfoUsecase.swift */; }; B7A836EE285B319500A06C77 /* Bundle+.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A836ED285B319500A06C77 /* Bundle+.swift */; }; B7A836F0285B322000A06C77 /* URLConfigurable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A836EF285B322000A06C77 /* URLConfigurable.swift */; }; B7A836F3285B32C900A06C77 /* GitURLConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A836F2285B32C900A06C77 /* GitURLConfiguration.swift */; }; B7A836F9285B392800A06C77 /* EndPointable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A836F8285B392800A06C77 /* EndPointable.swift */; }; B7A836FB285B39B500A06C77 /* HTTPPackageable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A836FA285B39B500A06C77 /* HTTPPackageable.swift */; }; B7A836FD285B3A1200A06C77 /* EndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A836FC285B3A1200A06C77 /* EndPoint.swift */; }; - B7A83710285C1A1300A06C77 /* GithubAuthorizationUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A8370F285C1A1300A06C77 /* GithubAuthorizationUsecase.swift */; }; + B7A83710285C1A1300A06C77 /* GithubLoginUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7A8370F285C1A1300A06C77 /* GithubLoginUsecase.swift */; }; B7AB7E3F286D6F730051095E /* IssueCardEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AB7E3E286D6F730051095E /* IssueCardEntity.swift */; }; - B7AB7E42286D70360051095E /* DefaultIssueCardRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AB7E41286D70360051095E /* DefaultIssueCardRepository.swift */; }; - B7AB7E44286D70510051095E /* FetchIssueCardRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AB7E43286D70510051095E /* FetchIssueCardRepository.swift */; }; + B7AB7E42286D70360051095E /* ViewIssueCardRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AB7E41286D70360051095E /* ViewIssueCardRepository.swift */; }; + B7AB7E44286D70510051095E /* ViewFilteredIssueCardRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AB7E43286D70510051095E /* ViewFilteredIssueCardRepository.swift */; }; B7AB7E46286D73490051095E /* FetchOpenIssueListURLConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AB7E45286D73490051095E /* FetchOpenIssueListURLConfiguration.swift */; }; B7E58B6D2858505A004C6BE6 /* ClientKey.plist in Resources */ = {isa = PBXBuildFile; fileRef = B7E58B6C2858505A004C6BE6 /* ClientKey.plist */; }; B7E58B6F28586FCE004C6BE6 /* NetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E58B6E28586FCE004C6BE6 /* NetworkService.swift */; }; B7E58B7128587013004C6BE6 /* HTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E58B7028587013004C6BE6 /* HTTPMethod.swift */; }; - D2861E81286D826600E544A5 /* FetchIssueCardUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E80286D826600E544A5 /* FetchIssueCardUsecase.swift */; }; - D2861E83286D82D900E544A5 /* FetchOpenIssueCardUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E82286D82D900E544A5 /* FetchOpenIssueCardUsecase.swift */; }; + D2861E81286D826600E544A5 /* ViewIssueCardUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E80286D826600E544A5 /* ViewIssueCardUsecase.swift */; }; + D2861E83286D82D900E544A5 /* ViewFilteredIssueCardUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E82286D82D900E544A5 /* ViewFilteredIssueCardUsecase.swift */; }; D2861E86286D882000E544A5 /* HomeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2861E85286D882000E544A5 /* HomeViewModel.swift */; }; D291537A285B6B3300B5CDA8 /* NetworkServiceable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2915379285B6B3300B5CDA8 /* NetworkServiceable.swift */; }; D291537C285B6B6500B5CDA8 /* NetworkError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D291537B285B6B6500B5CDA8 /* NetworkError.swift */; }; - D291537E285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D291537D285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift */; }; - D2915381285B740500B5CDA8 /* DefaultLoginUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2915380285B740500B5CDA8 /* DefaultLoginUsecase.swift */; }; + D291537E285B6D7F00B5CDA8 /* AppleLoginUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D291537D285B6D7F00B5CDA8 /* AppleLoginUsecase.swift */; }; + D2915381285B740500B5CDA8 /* LoginUsecase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2915380285B740500B5CDA8 /* LoginUsecase.swift */; }; D2915385286013DB00B5CDA8 /* OAuth.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2915384286013DB00B5CDA8 /* OAuth.swift */; }; D2A99973286159ED00910F7D /* IssueAddViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A99972286159ED00910F7D /* IssueAddViewController.swift */; }; D2A9997528615F3600910F7D /* CommentContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A9997428615F3600910F7D /* CommentContainerView.swift */; }; @@ -85,38 +85,38 @@ B7A56D9428618E0900EA639D /* IssuseCardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssuseCardCell.swift; sourceTree = ""; }; B7A56D9628618F6800EA639D /* UIFont+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+.swift"; sourceTree = ""; }; B7A56D982861913300EA639D /* BadgeLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeLabel.swift; sourceTree = ""; }; - B7A56D9A2861C5E600EA639D /* IssueCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueCard.swift; sourceTree = ""; }; + B7A56D9A2861C5E600EA639D /* IssueCardDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueCardDTO.swift; sourceTree = ""; }; B7A56D9C2861C79D00EA639D /* SelectionLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectionLabel.swift; sourceTree = ""; }; B7A56D9F2862B8B300EA639D /* IssueAddButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueAddButton.swift; sourceTree = ""; }; B7A56DA7286470CF00EA639D /* LoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewModel.swift; sourceTree = ""; }; - B7A56DB7286A71E900EA639D /* RequestUserInfoUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestUserInfoUsecase.swift; sourceTree = ""; }; - B7A56DBB286A73CA00EA639D /* DefaultUserInfoRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultUserInfoRepository.swift; sourceTree = ""; }; - B7A56DBD286A77FA00EA639D /* UserInfoRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserInfoRepository.swift; sourceTree = ""; }; + B7A56DB7286A71E900EA639D /* DefaultRequestTokenInfoUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultRequestTokenInfoUsecase.swift; sourceTree = ""; }; + B7A56DBB286A73CA00EA639D /* RequestTokenInfoRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestTokenInfoRepository.swift; sourceTree = ""; }; + B7A56DBD286A77FA00EA639D /* DefaultRequestTokenInfoRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultRequestTokenInfoRepository.swift; sourceTree = ""; }; B7A56DBF286A7E1200EA639D /* Decoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Decoder.swift; sourceTree = ""; }; B7A56DC2286A7E2500EA639D /* Encoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Encoder.swift; sourceTree = ""; }; B7A56DC4286A937600EA639D /* TokenURLConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenURLConfiguration.swift; sourceTree = ""; }; - B7A56DC6286A98DA00EA639D /* DefaultRequestUserInfoUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultRequestUserInfoUsecase.swift; sourceTree = ""; }; + B7A56DC6286A98DA00EA639D /* RequestTokenInfoUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestTokenInfoUsecase.swift; sourceTree = ""; }; B7A836ED285B319500A06C77 /* Bundle+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+.swift"; sourceTree = ""; }; B7A836EF285B322000A06C77 /* URLConfigurable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLConfigurable.swift; sourceTree = ""; }; B7A836F2285B32C900A06C77 /* GitURLConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GitURLConfiguration.swift; sourceTree = ""; }; B7A836F8285B392800A06C77 /* EndPointable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EndPointable.swift; sourceTree = ""; }; B7A836FA285B39B500A06C77 /* HTTPPackageable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPPackageable.swift; sourceTree = ""; }; B7A836FC285B3A1200A06C77 /* EndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EndPoint.swift; sourceTree = ""; }; - B7A8370F285C1A1300A06C77 /* GithubAuthorizationUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GithubAuthorizationUsecase.swift; sourceTree = ""; }; + B7A8370F285C1A1300A06C77 /* GithubLoginUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GithubLoginUsecase.swift; sourceTree = ""; }; B7AB7E3E286D6F730051095E /* IssueCardEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueCardEntity.swift; sourceTree = ""; }; - B7AB7E41286D70360051095E /* DefaultIssueCardRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultIssueCardRepository.swift; sourceTree = ""; }; - B7AB7E43286D70510051095E /* FetchIssueCardRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchIssueCardRepository.swift; sourceTree = ""; }; + B7AB7E41286D70360051095E /* ViewIssueCardRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewIssueCardRepository.swift; sourceTree = ""; }; + B7AB7E43286D70510051095E /* ViewFilteredIssueCardRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewFilteredIssueCardRepository.swift; sourceTree = ""; }; B7AB7E45286D73490051095E /* FetchOpenIssueListURLConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchOpenIssueListURLConfiguration.swift; sourceTree = ""; }; B7E58B6C2858505A004C6BE6 /* ClientKey.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = ClientKey.plist; sourceTree = ""; }; B7E58B6E28586FCE004C6BE6 /* NetworkService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkService.swift; sourceTree = ""; }; B7E58B7028587013004C6BE6 /* HTTPMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPMethod.swift; sourceTree = ""; }; - D2861E80286D826600E544A5 /* FetchIssueCardUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchIssueCardUsecase.swift; sourceTree = ""; }; - D2861E82286D82D900E544A5 /* FetchOpenIssueCardUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchOpenIssueCardUsecase.swift; sourceTree = ""; }; + D2861E80286D826600E544A5 /* ViewIssueCardUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewIssueCardUsecase.swift; sourceTree = ""; }; + D2861E82286D82D900E544A5 /* ViewFilteredIssueCardUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewFilteredIssueCardUsecase.swift; sourceTree = ""; }; D2861E85286D882000E544A5 /* HomeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewModel.swift; sourceTree = ""; }; D2915379285B6B3300B5CDA8 /* NetworkServiceable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkServiceable.swift; sourceTree = ""; }; D291537B285B6B6500B5CDA8 /* NetworkError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkError.swift; sourceTree = ""; }; - D291537D285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleAuthorizationUsecase.swift; sourceTree = ""; }; - D2915380285B740500B5CDA8 /* DefaultLoginUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultLoginUsecase.swift; sourceTree = ""; }; + D291537D285B6D7F00B5CDA8 /* AppleLoginUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleLoginUsecase.swift; sourceTree = ""; }; + D2915380285B740500B5CDA8 /* LoginUsecase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginUsecase.swift; sourceTree = ""; }; D2915384286013DB00B5CDA8 /* OAuth.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OAuth.swift; sourceTree = ""; }; D2A99972286159ED00910F7D /* IssueAddViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueAddViewController.swift; sourceTree = ""; }; D2A9997428615F3600910F7D /* CommentContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentContainerView.swift; sourceTree = ""; }; @@ -214,19 +214,19 @@ B7A56DBA286A73BE00EA639D /* DefaultUserInfoRepository */ = { isa = PBXGroup; children = ( - B7A56DBB286A73CA00EA639D /* DefaultUserInfoRepository.swift */, - B7A56DBD286A77FA00EA639D /* UserInfoRepository.swift */, + B7A56DBB286A73CA00EA639D /* RequestTokenInfoRepository.swift */, + B7A56DBD286A77FA00EA639D /* DefaultRequestTokenInfoRepository.swift */, ); path = DefaultUserInfoRepository; sourceTree = ""; }; - B7A56DC8286A98DF00EA639D /* DefaultRequestUserInfo */ = { + B7A56DC8286A98DF00EA639D /* RequestTokenInfoUsecase */ = { isa = PBXGroup; children = ( - B7A56DC6286A98DA00EA639D /* DefaultRequestUserInfoUsecase.swift */, - B7A56DB7286A71E900EA639D /* RequestUserInfoUsecase.swift */, + B7A56DC6286A98DA00EA639D /* RequestTokenInfoUsecase.swift */, + B7A56DB7286A71E900EA639D /* DefaultRequestTokenInfoUsecase.swift */, ); - path = DefaultRequestUserInfo; + path = RequestTokenInfoUsecase; sourceTree = ""; }; B7A836EC285B30EA00A06C77 /* Protocol */ = { @@ -269,8 +269,8 @@ B7AB7E40286D70090051095E /* DefaultIssueCardRepository */ = { isa = PBXGroup; children = ( - B7AB7E41286D70360051095E /* DefaultIssueCardRepository.swift */, - B7AB7E43286D70510051095E /* FetchIssueCardRepository.swift */, + B7AB7E41286D70360051095E /* ViewIssueCardRepository.swift */, + B7AB7E43286D70510051095E /* ViewFilteredIssueCardRepository.swift */, ); path = DefaultIssueCardRepository; sourceTree = ""; @@ -286,13 +286,13 @@ path = Network; sourceTree = ""; }; - D2861E7F286D823200E544A5 /* DefatultIssueCard */ = { + D2861E7F286D823200E544A5 /* ViewIssueCardUsecase */ = { isa = PBXGroup; children = ( - D2861E80286D826600E544A5 /* FetchIssueCardUsecase.swift */, - D2861E82286D82D900E544A5 /* FetchOpenIssueCardUsecase.swift */, + D2861E80286D826600E544A5 /* ViewIssueCardUsecase.swift */, + D2861E82286D82D900E544A5 /* ViewFilteredIssueCardUsecase.swift */, ); - path = DefatultIssueCard; + path = ViewIssueCardUsecase; sourceTree = ""; }; D2861E84286D880700E544A5 /* ViewModel */ = { @@ -320,14 +320,14 @@ path = Protocol; sourceTree = ""; }; - D291537F285B72E200B5CDA8 /* DefaultRequestGrantCode */ = { + D291537F285B72E200B5CDA8 /* LoginUsecase */ = { isa = PBXGroup; children = ( - D2915380285B740500B5CDA8 /* DefaultLoginUsecase.swift */, - B7A8370F285C1A1300A06C77 /* GithubAuthorizationUsecase.swift */, - D291537D285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift */, + D2915380285B740500B5CDA8 /* LoginUsecase.swift */, + B7A8370F285C1A1300A06C77 /* GithubLoginUsecase.swift */, + D291537D285B6D7F00B5CDA8 /* AppleLoginUsecase.swift */, ); - path = DefaultRequestGrantCode; + path = LoginUsecase; sourceTree = ""; }; D2915382286013B500B5CDA8 /* EnumTypes */ = { @@ -368,7 +368,7 @@ D2A999802862F4F900910F7D /* DTO */ = { isa = PBXGroup; children = ( - B7A56D9A2861C5E600EA639D /* IssueCard.swift */, + B7A56D9A2861C5E600EA639D /* IssueCardDTO.swift */, ); path = DTO; sourceTree = ""; @@ -396,9 +396,9 @@ D2A999832862F58D00910F7D /* Usecase */ = { isa = PBXGroup; children = ( - D2861E7F286D823200E544A5 /* DefatultIssueCard */, - B7A56DC8286A98DF00EA639D /* DefaultRequestUserInfo */, - D291537F285B72E200B5CDA8 /* DefaultRequestGrantCode */, + D2861E7F286D823200E544A5 /* ViewIssueCardUsecase */, + B7A56DC8286A98DF00EA639D /* RequestTokenInfoUsecase */, + D291537F285B72E200B5CDA8 /* LoginUsecase */, ); path = Usecase; sourceTree = ""; @@ -665,18 +665,18 @@ D2B7506C2856FCBE0078067A /* LoginViewController.swift in Sources */, D291537C285B6B6500B5CDA8 /* NetworkError.swift in Sources */, B7A56DC3286A7E2500EA639D /* Encoder.swift in Sources */, - B7A56DB8286A71E900EA639D /* RequestUserInfoUsecase.swift in Sources */, - B7A56D9B2861C5E600EA639D /* IssueCard.swift in Sources */, + B7A56DB8286A71E900EA639D /* DefaultRequestTokenInfoUsecase.swift in Sources */, + B7A56D9B2861C5E600EA639D /* IssueCardDTO.swift in Sources */, B7A836F9285B392800A06C77 /* EndPointable.swift in Sources */, - B7A56DC7286A98DA00EA639D /* DefaultRequestUserInfoUsecase.swift in Sources */, + B7A56DC7286A98DA00EA639D /* RequestTokenInfoUsecase.swift in Sources */, D2A9999028655CE200910F7D /* TokenInfo.swift in Sources */, D2A99973286159ED00910F7D /* IssueAddViewController.swift in Sources */, D2A9997B28618D0E00910F7D /* ListCell.swift in Sources */, B724DC92286058C3007DAC1A /* TabBarViewController.swift in Sources */, B7E58B7128587013004C6BE6 /* HTTPMethod.swift in Sources */, D291537A285B6B3300B5CDA8 /* NetworkServiceable.swift in Sources */, - B7A56DBC286A73CA00EA639D /* DefaultUserInfoRepository.swift in Sources */, - D2861E83286D82D900E544A5 /* FetchOpenIssueCardUsecase.swift in Sources */, + B7A56DBC286A73CA00EA639D /* RequestTokenInfoRepository.swift in Sources */, + D2861E83286D82D900E544A5 /* ViewFilteredIssueCardUsecase.swift in Sources */, B7A836FD285B3A1200A06C77 /* EndPoint.swift in Sources */, B7A56D9728618F6800EA639D /* UIFont+.swift in Sources */, B7A56D992861913300EA639D /* BadgeLabel.swift in Sources */, @@ -691,12 +691,12 @@ B71A0A032859B8FF0030D3ED /* NotificationCenter.swift in Sources */, D2D526592858CF5000581C88 /* UIImage+.swift in Sources */, D2D526612858DF7B00581C88 /* UIColor+.swift in Sources */, - B7AB7E42286D70360051095E /* DefaultIssueCardRepository.swift in Sources */, + B7AB7E42286D70360051095E /* ViewIssueCardRepository.swift in Sources */, B7A56DA8286470CF00EA639D /* LoginViewModel.swift in Sources */, D2A9999228655D0900910F7D /* GrantResource.swift in Sources */, D2A9997528615F3600910F7D /* CommentContainerView.swift in Sources */, D2A99977286160BF00910F7D /* DividedLineView.swift in Sources */, - D291537E285B6D7F00B5CDA8 /* AppleAuthorizationUsecase.swift in Sources */, + D291537E285B6D7F00B5CDA8 /* AppleLoginUsecase.swift in Sources */, B7A56D9528618E0900EA639D /* IssuseCardCell.swift in Sources */, B7A56DC0286A7E1200EA639D /* Decoder.swift in Sources */, B724DC9528605915007DAC1A /* HomeViewController.swift in Sources */, @@ -705,19 +705,19 @@ D2A9997F2862BE9500910F7D /* IssueAddListEntity.swift in Sources */, D2861E86286D882000E544A5 /* HomeViewModel.swift in Sources */, B7AB7E46286D73490051095E /* FetchOpenIssueListURLConfiguration.swift in Sources */, - D2915381285B740500B5CDA8 /* DefaultLoginUsecase.swift in Sources */, + D2915381285B740500B5CDA8 /* LoginUsecase.swift in Sources */, B7A56DC5286A937600EA639D /* TokenURLConfiguration.swift in Sources */, B7A836EE285B319500A06C77 /* Bundle+.swift in Sources */, - B7A83710285C1A1300A06C77 /* GithubAuthorizationUsecase.swift in Sources */, - B7AB7E44286D70510051095E /* FetchIssueCardRepository.swift in Sources */, + B7A83710285C1A1300A06C77 /* GithubLoginUsecase.swift in Sources */, + B7AB7E44286D70510051095E /* ViewFilteredIssueCardRepository.swift in Sources */, B7A56D9D2861C79D00EA639D /* SelectionLabel.swift in Sources */, - B7A56DBE286A77FA00EA639D /* UserInfoRepository.swift in Sources */, + B7A56DBE286A77FA00EA639D /* DefaultRequestTokenInfoRepository.swift in Sources */, B7A56DA02862B8B300EA639D /* IssueAddButton.swift in Sources */, B7A56D932861835B00EA639D /* TableViewDataSource.swift in Sources */, D2D5264C285850A100581C88 /* LoginInputView.swift in Sources */, D2915385286013DB00B5CDA8 /* OAuth.swift in Sources */, D2A9998B2864055400910F7D /* CommentTitleContainerView.swift in Sources */, - D2861E81286D826600E544A5 /* FetchIssueCardUsecase.swift in Sources */, + D2861E81286D826600E544A5 /* ViewIssueCardUsecase.swift in Sources */, B7A836F3285B32C900A06C77 /* GitURLConfiguration.swift in Sources */, D2D5264E2858557700581C88 /* UIView+.swift in Sources */, ); diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift b/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCardDTO.swift similarity index 82% rename from iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift rename to iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCardDTO.swift index 98e3ec05de..45b3b377bc 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCard.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/DTO/IssueCardDTO.swift @@ -8,17 +8,17 @@ import Foundation // MARK: - Empty -struct Empty: Codable { - let issues: [IssueCard] +struct IssueCardArrayDTO: Codable { + let issues: [IssueCardDTO] } // MARK: - Issue -struct IssueCard: Codable { +struct IssueCardDTO: Codable { let issueID: Int let title, content: String let milestoneID: Int let milestoneName: String - let labels: [Label] + let labels: [LabelDTO] enum CodingKeys: String, CodingKey { case issueID = "issueId" @@ -29,7 +29,7 @@ struct IssueCard: Codable { } // MARK: - Label -struct Label: Codable { +struct LabelDTO: Codable { let labelID: Int? let labelName, labelColor: String @@ -39,14 +39,14 @@ struct Label: Codable { } } -extension IssueCard { +extension IssueCardDTO { func toDomain() -> IssueCardEntity { return .init(id: issueID, title: title, content: content, isSelected: false, mileStone: milestoneName, labels: labels.map { $0.toDomain() }) } } -extension Label { +extension LabelDTO { func toDomain() -> LabelEntity { return .init(id: labelID, labelName: labelName, labelColor: labelColor) diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/ViewFilteredIssueCardRepository.swift similarity index 75% rename from iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift rename to iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/ViewFilteredIssueCardRepository.swift index b7e85b53fc..d37f628324 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/FetchIssueCardRepository.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/ViewFilteredIssueCardRepository.swift @@ -7,7 +7,7 @@ import Foundation -final class FetchIssueCardRepository: DefaultIssueCardRepository { +final class ViewFilteredIssueCardRepository: ViewIssueCardRepository { var endPoint: EndPoint @@ -15,11 +15,11 @@ final class FetchIssueCardRepository: DefaultIssueCardRepository { self.endPoint = endPoint } - func fetchIssueCard(completion: @escaping (Empty?) -> Void) { + func fetchIssueCard(completion: @escaping (IssueCardArrayDTO?) -> Void) { NetworkService.request(endPoint: endPoint) { result in switch result { case .success(let data): - let decoder = Decoder() + let decoder = Decoder() let issuecards = decoder.decode(data: data) completion(issuecards) case .failure(let error): diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/DefaultIssueCardRepository.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/ViewIssueCardRepository.swift similarity index 58% rename from iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/DefaultIssueCardRepository.swift rename to iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/ViewIssueCardRepository.swift index 197b08b113..a456e8f2e0 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/DefaultIssueCardRepository.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultIssueCardRepository/ViewIssueCardRepository.swift @@ -7,7 +7,7 @@ import Foundation -protocol DefaultIssueCardRepository { +protocol ViewIssueCardRepository { var endPoint: EndPoint {get} - func fetchIssueCard(completion: @escaping (Empty?) -> Void) + func fetchIssueCard(completion: @escaping (IssueCardArrayDTO?) -> Void) } diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/UserInfoRepository.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/DefaultRequestTokenInfoRepository.swift similarity index 79% rename from iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/UserInfoRepository.swift rename to iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/DefaultRequestTokenInfoRepository.swift index a68655948e..fb4583e5eb 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/UserInfoRepository.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/DefaultRequestTokenInfoRepository.swift @@ -7,7 +7,7 @@ import Foundation -final class UserInfoRepository: DefaultUserInfoRepository { +final class DefaultRequestTokenInfoRepository: RequestTokenInfoRepository { var endPoint: EndPoint @@ -15,7 +15,7 @@ final class UserInfoRepository: DefaultUserInfoRepository { self.endPoint = endPoint } - func fetchUserInfo(completion: @escaping (TokenInfo?) -> Void) { + func fetchTokenInfo(completion: @escaping (TokenInfo?) -> Void) { NetworkService.request(endPoint: endPoint) { result in switch result { case .success(let data): diff --git a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/DefaultUserInfoRepository.swift b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/RequestTokenInfoRepository.swift similarity index 59% rename from iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/DefaultUserInfoRepository.swift rename to iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/RequestTokenInfoRepository.swift index 72e611623a..ba4f972c62 100644 --- a/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/DefaultUserInfoRepository.swift +++ b/iOS/IssueTracker/IssueTracker/DataLayer/Repository/DefaultUserInfoRepository/RequestTokenInfoRepository.swift @@ -7,7 +7,7 @@ import Foundation -protocol DefaultUserInfoRepository { +protocol RequestTokenInfoRepository { var endPoint: EndPoint {get} - func fetchUserInfo(completion: @escaping (TokenInfo?) -> Void) + func fetchTokenInfo(completion: @escaping (TokenInfo?) -> Void) } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestUserInfo/RequestUserInfoUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestUserInfo/RequestUserInfoUsecase.swift deleted file mode 100644 index 2702c91280..0000000000 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestUserInfo/RequestUserInfoUsecase.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// requestUserInfoUsecase.swift -// IssueTracker -// -// Created by Kai Kim on 2022/06/28. -// - -import Foundation - -final class RequestUserInfoUsecase: DefaultRequestUserInfoUsecase { - - var userInfoRepository: DefaultUserInfoRepository? - - init(userInfoRepository: DefaultUserInfoRepository? = UserInfoRepository(endPoint: EndPoint(urlConfigure: TokenURLConfiguration(), method: .POST, body: nil))) { - self.userInfoRepository = userInfoRepository - } - - func execute(completion: @escaping (TokenInfo?) -> Void) { - userInfoRepository?.fetchUserInfo(completion: { userInfo in - guard let userInfo = userInfo else { - completion(nil) - return - } - completion(userInfo) - }) - } - -} diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestGrantCode/AppleAuthorizationUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/LoginUsecase/AppleLoginUsecase.swift similarity index 84% rename from iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestGrantCode/AppleAuthorizationUsecase.swift rename to iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/LoginUsecase/AppleLoginUsecase.swift index 9f252e70dd..78dd331a92 100644 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestGrantCode/AppleAuthorizationUsecase.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/LoginUsecase/AppleLoginUsecase.swift @@ -7,12 +7,12 @@ import AuthenticationServices -final class AppleAuthorizationUsecase: NSObject, DefaultLoginUsecase { +final class AppleLoginUsecase: NSObject, LoginUsecase { // private(set) var endPoint: EndPoint private var presentationAnchor: UIWindow? private var authorizationController: ASAuthorizationController? - var requestUserInfoUsecase: DefaultRequestUserInfoUsecase? + var requestUserInfoUsecase: RequestTokenInfoUsecase? init(presentationAnchor: UIWindow?) { self.presentationAnchor = presentationAnchor @@ -28,7 +28,7 @@ final class AppleAuthorizationUsecase: NSObject, DefaultLoginUsecase { func setRequestUserInfo(_ grantResource: DefaultGrantResource) { guard let resource = grantResource as? AppleGrantResource, let data = encodeModel(model: resource) else {return} - self.requestUserInfoUsecase = RequestUserInfoUsecase(userInfoRepository: UserInfoRepository(endPoint: EndPoint(urlConfigure: TokenURLConfiguration(), method: .POST, body: data))) + self.requestUserInfoUsecase = DefaultRequestTokenInfoUsecase(userInfoRepository: DefaultRequestTokenInfoRepository(endPoint: EndPoint(urlConfigure: TokenURLConfiguration(), method: .POST, body: data))) } func enquireForGrant(handler: @escaping (URL?) -> Void) { @@ -38,7 +38,7 @@ final class AppleAuthorizationUsecase: NSObject, DefaultLoginUsecase { } } -private extension AppleAuthorizationUsecase { +private extension AppleLoginUsecase { func prepareToRequest() { let appleIDProvider = ASAuthorizationAppleIDProvider() @@ -58,7 +58,7 @@ private extension AppleAuthorizationUsecase { } -extension AppleAuthorizationUsecase: ASAuthorizationControllerDelegate { +extension AppleLoginUsecase: ASAuthorizationControllerDelegate { func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) { switch authorization.credential { @@ -77,7 +77,7 @@ extension AppleAuthorizationUsecase: ASAuthorizationControllerDelegate { } } -extension AppleAuthorizationUsecase: ASAuthorizationControllerPresentationContextProviding { +extension AppleLoginUsecase: ASAuthorizationControllerPresentationContextProviding { func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor { guard let window = presentationAnchor else { return ASPresentationAnchor() } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestGrantCode/GithubAuthorizationUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/LoginUsecase/GithubLoginUsecase.swift similarity index 50% rename from iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestGrantCode/GithubAuthorizationUsecase.swift rename to iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/LoginUsecase/GithubLoginUsecase.swift index e65a3d1426..ccd621c241 100644 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestGrantCode/GithubAuthorizationUsecase.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/LoginUsecase/GithubLoginUsecase.swift @@ -7,9 +7,9 @@ import Foundation -final class GithubAuthorizationUsecase: DefaultLoginUsecase { +final class GithubLoginUsecase: LoginUsecase { - var requestUserInfoUsecase: DefaultRequestUserInfoUsecase? + var requestUserInfoUsecase: RequestTokenInfoUsecase? func execute() { NetworkService.requestURL(endPoint: EndPoint(urlConfigure: GitURLConfiguration(), method: .GET, body: nil)) { result in @@ -24,29 +24,14 @@ final class GithubAuthorizationUsecase: DefaultLoginUsecase { func setRequestUserInfo(_ grantResource: DefaultGrantResource) { guard let resource = grantResource as? GitHubGrantResource, let data = encodeModel(model: resource) else {return} - self.requestUserInfoUsecase = RequestUserInfoUsecase(userInfoRepository: UserInfoRepository(endPoint: EndPoint(urlConfigure: TokenURLConfiguration(), method: .POST, body: data))) + self.requestUserInfoUsecase = DefaultRequestTokenInfoUsecase(userInfoRepository: DefaultRequestTokenInfoRepository(endPoint: EndPoint(urlConfigure: TokenURLConfiguration(), method: .POST, body: data))) } } -private extension GithubAuthorizationUsecase { +private extension GithubLoginUsecase { func encodeModel(model: GitHubGrantResource) -> Data? { let encoder = Encoder() return encoder.encode(model: model) } - -// func requestAPI(with endPoint: EndPoint) { -// self.responseHandler(true) -//// NetworkService.request(endPoint: endPoint, completion: { result in -//// switch result { -//// case .success(let data): -//// // TODO: Decode response data -//// print(data) -//// self.responseHandler?(true) -//// case .failure(let error): -//// print(error) -//// self.responseHandler?(false) -//// } -//// }) -// } } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestGrantCode/DefaultLoginUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/LoginUsecase/LoginUsecase.swift similarity index 66% rename from iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestGrantCode/DefaultLoginUsecase.swift rename to iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/LoginUsecase/LoginUsecase.swift index 9135fedaf9..ef5ae63bcb 100644 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestGrantCode/DefaultLoginUsecase.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/LoginUsecase/LoginUsecase.swift @@ -7,9 +7,9 @@ import Foundation -protocol DefaultLoginUsecase { +protocol LoginUsecase { - var requestUserInfoUsecase: DefaultRequestUserInfoUsecase? {get} + var requestUserInfoUsecase: RequestTokenInfoUsecase? {get} func execute() func setRequestUserInfo(_ grantResource: DefaultGrantResource) } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/DefaultRequestTokenInfoUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/DefaultRequestTokenInfoUsecase.swift new file mode 100644 index 0000000000..1e7c316a61 --- /dev/null +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/DefaultRequestTokenInfoUsecase.swift @@ -0,0 +1,28 @@ +// +// requestUserInfoUsecase.swift +// IssueTracker +// +// Created by Kai Kim on 2022/06/28. +// + +import Foundation + +final class DefaultRequestTokenInfoUsecase: RequestTokenInfoUsecase { + + var tokenInfoRepository: RequestTokenInfoRepository? + + init(userInfoRepository: RequestTokenInfoRepository? = DefaultRequestTokenInfoRepository(endPoint: EndPoint(urlConfigure: TokenURLConfiguration(), method: .POST, body: nil))) { + self.tokenInfoRepository = userInfoRepository + } + + func execute(completion: @escaping (TokenInfo?) -> Void) { + tokenInfoRepository?.fetchTokenInfo(completion: { userInfo in + guard let userInfo = userInfo else { + completion(nil) + return + } + completion(userInfo) + }) + } + +} diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestUserInfo/DefaultRequestUserInfoUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/RequestTokenInfoUsecase.swift similarity index 64% rename from iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestUserInfo/DefaultRequestUserInfoUsecase.swift rename to iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/RequestTokenInfoUsecase.swift index dd2ac986d5..afae755c22 100644 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefaultRequestUserInfo/DefaultRequestUserInfoUsecase.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/RequestTokenInfoUsecase.swift @@ -7,7 +7,7 @@ import Foundation -protocol DefaultRequestUserInfoUsecase { - var userInfoRepository: DefaultUserInfoRepository? {get} +protocol RequestTokenInfoUsecase { + var tokenInfoRepository: TokenInfoRepository? {get} func execute(completion: @escaping (TokenInfo?) -> Void) } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchOpenIssueCardUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/ViewIssueCardUsecase/ViewFilteredIssueCardUsecase.swift similarity index 70% rename from iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchOpenIssueCardUsecase.swift rename to iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/ViewIssueCardUsecase/ViewFilteredIssueCardUsecase.swift index da26d16c06..e18eb5c2dc 100644 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchOpenIssueCardUsecase.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/ViewIssueCardUsecase/ViewFilteredIssueCardUsecase.swift @@ -7,11 +7,11 @@ import Foundation -final class FetchOpenIssueCardUsecase: FetchIssueCardUsecase { +final class ViewFilteredIssueCardUsecase: ViewIssueCardUsecase { - private(set) var fetchIssueCardRepository: DefaultIssueCardRepository + private(set) var fetchIssueCardRepository: ViewIssueCardRepository - init(repository: DefaultIssueCardRepository = FetchIssueCardRepository()) { + init(repository: ViewIssueCardRepository = ViewFilteredIssueCardRepository()) { self.fetchIssueCardRepository = repository } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/ViewIssueCardUsecase/ViewIssueCardUsecase.swift similarity index 89% rename from iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift rename to iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/ViewIssueCardUsecase/ViewIssueCardUsecase.swift index 02a2ffaaea..98087509c6 100644 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/DefatultIssueCard/FetchIssueCardUsecase.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/ViewIssueCardUsecase/ViewIssueCardUsecase.swift @@ -7,7 +7,7 @@ import Foundation -protocol FetchIssueCardUsecase { +protocol ViewIssueCardUsecase { var fetchIssueCardRepository: DefaultIssueCardRepository { get } func execute(completion: @escaping ([IssueCardEntity]) -> Void) diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift index 587cc7fc67..fa73bfb008 100644 --- a/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/HomeScene/ViewModel/HomeViewModel.swift @@ -9,11 +9,11 @@ import Foundation final class HomeViewModel { - private var fetchOpenIssueCardUsecase: FetchIssueCardUsecase + private var fetchOpenIssueCardUsecase: ViewIssueCardUsecase var issueCards: Observable<[IssueCardEntity]?> = Observable(nil) - init(fetchIssueUsecase: FetchIssueCardUsecase = FetchOpenIssueCardUsecase()) { + init(fetchIssueUsecase: ViewIssueCardUsecase = ViewFilteredIssueCardUsecase()) { self.fetchOpenIssueCardUsecase = fetchIssueUsecase } diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/View/LoginViewController.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/View/LoginViewController.swift index 5e88371f65..4f0f53270b 100644 --- a/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/View/LoginViewController.swift +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/View/LoginViewController.swift @@ -54,7 +54,7 @@ extension LoginViewController: OAuthButtonDelegate { private extension LoginViewController { func setViewModel() { - self.loginVM = LoginViewModel(AppleAuthorizationUsecase(presentationAnchor: self.view.window)) + self.loginVM = LoginViewModel(AppleLoginUsecase(presentationAnchor: self.view.window)) } func setLoginViewModelBinding() { diff --git a/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/ViewModel/LoginViewModel.swift b/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/ViewModel/LoginViewModel.swift index 56122fbaf4..40845537f1 100644 --- a/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/ViewModel/LoginViewModel.swift +++ b/iOS/IssueTracker/IssueTracker/PresentationLayer/LoginScene/ViewModel/LoginViewModel.swift @@ -10,8 +10,8 @@ import UIKit final class LoginViewModel { - private var githubAuthorizationUsecase: DefaultLoginUsecase? - private var appleAuthorizationUsecase: DefaultLoginUsecase? + private var githubAuthorizationUsecase: LoginUsecase? + private var appleAuthorizationUsecase: LoginUsecase? var gitOAuthPageURL: Observable = Observable(nil) var tokenInfo: Observable = Observable(nil) @@ -23,14 +23,14 @@ final class LoginViewModel { } } - init(_ github: DefaultLoginUsecase?, _ apple: DefaultLoginUsecase?) { + init(_ github: LoginUsecase?, _ apple: LoginUsecase?) { self.githubAuthorizationUsecase = github self.appleAuthorizationUsecase = apple setNotificationObserver() } - convenience init(_ apple: DefaultLoginUsecase?) { - self.init(GithubAuthorizationUsecase(), apple) + convenience init(_ apple: LoginUsecase?) { + self.init(GithubLoginUsecase(), apple) } func enquireGrant(buttonCase: OAuth) { @@ -74,7 +74,7 @@ private extension LoginViewModel { switch grantResource { case is GitHubGrantResource: githubAuthorizationUsecase?.setRequestUserInfo(grantResource) - githubAuthorizationUsecase?.requestUserInfoUsecase?.userInfoRepository?.fetchUserInfo(completion: { userInfo in + githubAuthorizationUsecase?.requestUserInfoUsecase?.tokenInfoRepository?.fetchTokenInfo(completion: { userInfo in guard let userInfo = userInfo else {return} self.tokenInfo.updateValue(value: userInfo) }) From e2abbb4524a01450b480aed305f989fa1c370473 Mon Sep 17 00:00:00 2001 From: wnsxor1993 Date: Fri, 1 Jul 2022 12:12:07 +0900 Subject: [PATCH 7/7] =?UTF-8?q?[wnsxor1993#107]refactor:=20rename=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EC=9D=80=20=EB=B6=80=EB=B6=84=EC=97=90=20?= =?UTF-8?q?=EB=8C=80=ED=95=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RequestTokenInfoUsecase/RequestTokenInfoUsecase.swift | 2 +- .../Usecase/ViewIssueCardUsecase/ViewIssueCardUsecase.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/RequestTokenInfoUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/RequestTokenInfoUsecase.swift index afae755c22..518a722b31 100644 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/RequestTokenInfoUsecase.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/RequestTokenInfoUsecase/RequestTokenInfoUsecase.swift @@ -8,6 +8,6 @@ import Foundation protocol RequestTokenInfoUsecase { - var tokenInfoRepository: TokenInfoRepository? {get} + var tokenInfoRepository: RequestTokenInfoRepository? {get} func execute(completion: @escaping (TokenInfo?) -> Void) } diff --git a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/ViewIssueCardUsecase/ViewIssueCardUsecase.swift b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/ViewIssueCardUsecase/ViewIssueCardUsecase.swift index 98087509c6..1b57998106 100644 --- a/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/ViewIssueCardUsecase/ViewIssueCardUsecase.swift +++ b/iOS/IssueTracker/IssueTracker/DomainLayer/Usecase/ViewIssueCardUsecase/ViewIssueCardUsecase.swift @@ -9,6 +9,6 @@ import Foundation protocol ViewIssueCardUsecase { - var fetchIssueCardRepository: DefaultIssueCardRepository { get } + var fetchIssueCardRepository: ViewIssueCardRepository { get } func execute(completion: @escaping ([IssueCardEntity]) -> Void) }