|
9 | 9 | import Swinject
|
10 | 10 | import BitcoinKit
|
11 | 11 | import CommonKit
|
| 12 | +import FilesStorageKit |
| 13 | +import FilesPickerKit |
12 | 14 |
|
13 | 15 | struct AppAssembly: Assembly {
|
14 | 16 | func assemble(container: Container) {
|
15 | 17 | // MARK: - Standalone services
|
16 | 18 | // MARK: AdamantCore
|
17 | 19 | container.register(AdamantCore.self) { _ in NativeAdamantCore() }.inObjectScope(.container)
|
18 | 20 |
|
| 21 | + // MARK: FilesStorageProtocol |
| 22 | + container.register(FilesStorageProtocol.self) { _ in FilesStorageKit() }.inObjectScope(.container) |
| 23 | + |
| 24 | + container.register(FilesPickerProtocol.self) { r in |
| 25 | + FilesPickerKit(storageKit: r.resolve(FilesStorageProtocol.self)!) |
| 26 | + } |
| 27 | + |
19 | 28 | // MARK: CellFactory
|
20 | 29 | container.register(CellFactory.self) { _ in AdamantCellFactory() }.inObjectScope(.container)
|
21 | 30 |
|
@@ -120,6 +129,23 @@ struct AppAssembly: Assembly {
|
120 | 129 | )
|
121 | 130 | }.inObjectScope(.container)
|
122 | 131 |
|
| 132 | + // MARK: IPFSApiService |
| 133 | + container.register(IPFSApiService.self) { r in |
| 134 | + IPFSApiService( |
| 135 | + healthCheckWrapper: .init( |
| 136 | + service: .init(apiCore: r.resolve(APICoreProtocol.self)!), |
| 137 | + nodesStorage: r.resolve(NodesStorageProtocol.self)!, |
| 138 | + nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!, |
| 139 | + nodeGroup: .ipfs |
| 140 | + ) |
| 141 | + ) |
| 142 | + }.inObjectScope(.container) |
| 143 | + |
| 144 | + // MARK: FilesNetworkManagerProtocol |
| 145 | + container.register(FilesNetworkManagerProtocol.self) { r in |
| 146 | + FilesNetworkManager(ipfsService: r.resolve(IPFSApiService.self)!) |
| 147 | + }.inObjectScope(.container) |
| 148 | + |
123 | 149 | // MARK: BtcApiService
|
124 | 150 | container.register(BtcApiService.self) { r in
|
125 | 151 | BtcApiService(api: .init(
|
@@ -264,6 +290,24 @@ struct AppAssembly: Assembly {
|
264 | 290 | )
|
265 | 291 | }.inObjectScope(.container)
|
266 | 292 |
|
| 293 | + // MARK: ChatFileService |
| 294 | + container.register(ChatFileProtocol.self) { r in |
| 295 | + ChatFileService( |
| 296 | + accountService: r.resolve(AccountService.self)!, |
| 297 | + filesStorage: r.resolve(FilesStorageProtocol.self)!, |
| 298 | + chatsProvider: r.resolve(ChatsProvider.self)!, |
| 299 | + filesNetworkManager: r.resolve(FilesNetworkManagerProtocol.self)!, |
| 300 | + adamantCore: r.resolve(AdamantCore.self)! |
| 301 | + ) |
| 302 | + }.inObjectScope(.container) |
| 303 | + |
| 304 | + // MARK: FilesStorageProprietiesService |
| 305 | + container.register(FilesStorageProprietiesProtocol.self) { r in |
| 306 | + FilesStorageProprietiesService( |
| 307 | + securedStore: r.resolve(SecuredStore.self)! |
| 308 | + ) |
| 309 | + }.inObjectScope(.container) |
| 310 | + |
267 | 311 | // MARK: Chats
|
268 | 312 | container.register(ChatsProvider.self) { r in
|
269 | 313 | AdamantChatsProvider(
|
|
0 commit comments