Skip to content

Commit

Permalink
Merge pull request #262 from APP-iOS5th/Refactor/SplitLetterManager
Browse files Browse the repository at this point in the history
Refactor/splitLetterManager
  • Loading branch information
the-hye authored Dec 8, 2024
2 parents ad3eb91 + eceaee1 commit 45a27d6
Show file tree
Hide file tree
Showing 10 changed files with 272 additions and 236 deletions.
12 changes: 8 additions & 4 deletions Kabinett.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@
AFA58F222C6A004C00A7C569 /* WriteLetterUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA58F212C6A004C00A7C569 /* WriteLetterUseCase.swift */; };
AFA58F242C6A02BF00A7C569 /* ImportLetterUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA58F232C6A02BF00A7C569 /* ImportLetterUseCase.swift */; };
AFA58F302C6C4B2A00A7C569 /* LetterBoxUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA58F2F2C6C4B2A00A7C569 /* LetterBoxUseCase.swift */; };
AFA75B272D013F8900DA418F /* FirestoreLetterWriteManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA75B262D013F8900DA418F /* FirestoreLetterWriteManager.swift */; };
AFB88B592C89410600E79F90 /* DefaultWriteLetterUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFB88B582C89410600E79F90 /* DefaultWriteLetterUseCase.swift */; };
AFCFDFC32C7C3F2A00BEFFDF /* DefaultProfileUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83949C892C71BC0F0080D72C /* DefaultProfileUseCase.swift */; };
AFCFDFC42C7C3F2A00BEFFDF /* FirestoreLetterManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA58F252C6AE33D00A7C569 /* FirestoreLetterManager.swift */; };
AFCFDFC42C7C3F2A00BEFFDF /* FirestoreLetterBoxManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA58F252C6AE33D00A7C569 /* FirestoreLetterBoxManager.swift */; };
AFDE7D2E2C75797A0019F2DE /* FirestorageLetterManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFDE7D2D2C75797A0019F2DE /* FirestorageLetterManager.swift */; };
E2E0DCD12CAED20800596DF7 /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E0DCD02CAED20800596DF7 /* LoadingView.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -269,8 +270,9 @@
AFA58F172C69DB1300A7C569 /* Writer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Writer.swift; sourceTree = "<group>"; };
AFA58F212C6A004C00A7C569 /* WriteLetterUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WriteLetterUseCase.swift; sourceTree = "<group>"; };
AFA58F232C6A02BF00A7C569 /* ImportLetterUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImportLetterUseCase.swift; sourceTree = "<group>"; };
AFA58F252C6AE33D00A7C569 /* FirestoreLetterManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirestoreLetterManager.swift; sourceTree = "<group>"; };
AFA58F252C6AE33D00A7C569 /* FirestoreLetterBoxManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirestoreLetterBoxManager.swift; sourceTree = "<group>"; };
AFA58F2F2C6C4B2A00A7C569 /* LetterBoxUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LetterBoxUseCase.swift; sourceTree = "<group>"; };
AFA75B262D013F8900DA418F /* FirestoreLetterWriteManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirestoreLetterWriteManager.swift; sourceTree = "<group>"; };
AFB88B582C89410600E79F90 /* DefaultWriteLetterUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultWriteLetterUseCase.swift; sourceTree = "<group>"; };
AFDE7D2D2C75797A0019F2DE /* FirestorageLetterManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirestorageLetterManager.swift; sourceTree = "<group>"; };
E2E0DCD02CAED20800596DF7 /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -416,7 +418,8 @@
children = (
83F0D6842C705E42001B8733 /* AuthManager.swift */,
83F0D6862C7072DB001B8733 /* FirestoreWriterManager.swift */,
AFA58F252C6AE33D00A7C569 /* FirestoreLetterManager.swift */,
AFA75B262D013F8900DA418F /* FirestoreLetterWriteManager.swift */,
AFA58F252C6AE33D00A7C569 /* FirestoreLetterBoxManager.swift */,
83CA92AD2C8181DB00DFB68B /* FirestorageWriterManager.swift */,
AFDE7D2D2C75797A0019F2DE /* FirestorageLetterManager.swift */,
);
Expand Down Expand Up @@ -958,7 +961,8 @@
buildActionMask = 2147483647;
files = (
AFCFDFC32C7C3F2A00BEFFDF /* DefaultProfileUseCase.swift in Sources */,
AFCFDFC42C7C3F2A00BEFFDF /* FirestoreLetterManager.swift in Sources */,
AFCFDFC42C7C3F2A00BEFFDF /* FirestoreLetterBoxManager.swift in Sources */,
AFA75B272D013F8900DA418F /* FirestoreLetterWriteManager.swift in Sources */,
577157052C75DD9900E21162 /* Writer.swift in Sources */,
04DEC0FE2C7EDB1100D289EA /* KabinettNumberFormatter.swift in Sources */,
83F0D6872C7072DB001B8733 /* FirestoreWriterManager.swift in Sources */,
Expand Down
8 changes: 6 additions & 2 deletions Kabinett/Application/DIContainer/Keys/ServiceKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ struct FirestoreWriterManagerKey: InjectionKey {
typealias Value = FirestoreWriterManager
}

struct FirestoreLetterManagerKey: InjectionKey {
typealias Value = FirestoreLetterManager
struct FirestoreLetterWriteManagerKey: InjectionKey {
typealias Value = FirestoreLetterWriteManager
}

struct FirestoreLetterBoxManagerKey: InjectionKey {
typealias Value = FirestoreLetterBoxManager
}

struct FirestorageWriterManagerKey: InjectionKey {
Expand Down
22 changes: 14 additions & 8 deletions Kabinett/Application/KabinettApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct KabinettApp: App {
UIEdgeInsets(top: 0, left: -13, bottom: 0, right: 0)
)
appearance.setBackIndicatorImage(image, transitionMaskImage: image)

UINavigationBar.appearance().standardAppearance = appearance
UINavigationBar.appearance().scrollEdgeAppearance = appearance
UINavigationBar.appearance().compactAppearance = appearance
Expand Down Expand Up @@ -86,8 +86,11 @@ struct KabinettApp: App {
Module(FirestoreWriterManagerKey.self) {
FirestoreWriterManager()
}
Module(FirestoreLetterManagerKey.self) {
FirestoreLetterManager()
Module(FirestoreLetterWriteManagerKey.self) {
FirestoreLetterWriteManager()
}
Module(FirestoreLetterBoxManagerKey.self) {
FirestoreLetterBoxManager()
}
}

Expand All @@ -109,8 +112,11 @@ struct KabinettApp: App {
@Injected(FirestoreWriterManagerKey.self)
var firestoreWriterManager: FirestoreWriterManager

@Injected(FirestoreLetterManagerKey.self)
var firestoreLetterManager: FirestoreLetterManager
@Injected(FirestoreLetterWriteManagerKey.self)
var firestoreLetterWriteManager: FirestoreLetterWriteManager

@Injected(FirestoreLetterBoxManagerKey.self)
var firestoreLetterBoxManager: FirestoreLetterBoxManager

@Injected(FirestorageWriterManagerKey.self)
var firestorageWriterManager: FirestorageWriterManager
Expand All @@ -136,21 +142,21 @@ struct KabinettApp: App {
DefaultWriteLetterUseCase(
authManager: authManager,
writerManager: firestoreWriterManager,
letterManager: firestoreLetterManager,
letterManager: firestoreLetterWriteManager,
letterStorageManager: firestorageLetterManager
)
}
Module(LetterBoxUseCaseKey.self) {
DefaultLetterBoxUseCase(
letterManager: firestoreLetterManager,
letterManager: firestoreLetterBoxManager,
authManager: authManager
)
}
Module(ImportLetterUseCaseKey.self) {
DefaultImportLetterUseCase(
authManager: authManager,
writerManager: firestoreWriterManager,
letterManager: firestoreLetterManager,
letterManager: firestoreLetterWriteManager,
letterStorageManager: firestorageLetterManager
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ final class DefaultImportLetterUseCase {
private let logger: Logger
private let authManager: AuthManager
private let writerManager: FirestoreWriterManager
private let letterManager: FirestoreLetterManager
private let letterManager: FirestoreLetterWriteManager
private let letterStorageManager: FirestorageLetterManager

init(
authManager: AuthManager,
writerManager: FirestoreWriterManager,
letterManager: FirestoreLetterManager,
letterManager: FirestoreLetterWriteManager,
letterStorageManager: FirestorageLetterManager
) {
self.logger = Logger(
Expand Down
4 changes: 2 additions & 2 deletions Kabinett/Data/DefaultUseCases/DefaultLetterBoxUseCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import os

final class DefaultLetterBoxUseCase {
private let logger: Logger
private let letterManager: FirestoreLetterManager
private let letterManager: FirestoreLetterBoxManager
private let authManager: AuthManager

init(
letterManager: FirestoreLetterManager,
letterManager: FirestoreLetterBoxManager,
authManager: AuthManager
) {
self.logger = Logger(
Expand Down
6 changes: 3 additions & 3 deletions Kabinett/Data/DefaultUseCases/DefaultWriteLetterUseCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ final class DefaultWriteLetterUseCase {
private let logger: Logger
private let authManager: AuthManager
private let writerManager: FirestoreWriterManager
private let letterManager: FirestoreLetterManager
private let letterManager: FirestoreLetterWriteManager
private let letterStorageManager: FirestorageLetterManager

init(
authManager: AuthManager,
writerManager: FirestoreWriterManager,
letterManager: FirestoreLetterManager,
letterManager: FirestoreLetterWriteManager,
letterStorageManager: FirestorageLetterManager
) {
self.logger = Logger(
Expand All @@ -34,7 +34,7 @@ final class DefaultWriteLetterUseCase {
}

extension DefaultWriteLetterUseCase: WriteLetterUseCase {
func saveLetter(font: String,
func saveLetter(font: String,
postScript: String?,
envelope: String,
stamp: String,
Expand Down
Loading

0 comments on commit 45a27d6

Please sign in to comment.