Skip to content

Commit 5f78a4a

Browse files
committed
feat: 프로필 이미지 데이터 유스케이스 추가
1 parent 6ce0574 commit 5f78a4a

4 files changed

Lines changed: 48 additions & 0 deletions

File tree

Application/DevLogDomain/Sources/DomainAssembler.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ private extension DomainAssembler {
116116
FetchUserDataUseCaseImpl(container.resolve(UserDataRepository.self))
117117
}
118118

119+
container.register(FetchProfileImageDataUseCase.self) {
120+
FetchProfileImageDataUseCaseImpl(container.resolve(ProfileImageDataRepository.self))
121+
}
122+
119123
container.register(UpsertStatusMessageUseCase.self) {
120124
UpsertStatusMessageUseCaseImpl(container.resolve(UserDataRepository.self))
121125
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// ProfileImageDataRepository.swift
3+
// DevLogDomain
4+
//
5+
// Created by opfic on 6/11/26.
6+
//
7+
8+
import Foundation
9+
10+
public protocol ProfileImageDataRepository {
11+
func fetchImageData(from url: URL) async throws -> Data
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// FetchProfileImageDataUseCase.swift
3+
// DevLogDomain
4+
//
5+
// Created by opfic on 6/11/26.
6+
//
7+
8+
import Foundation
9+
10+
public protocol FetchProfileImageDataUseCase {
11+
func execute(from url: URL) async throws -> Data
12+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// FetchProfileImageDataUseCaseImpl.swift
3+
// DevLogDomain
4+
//
5+
// Created by opfic on 6/11/26.
6+
//
7+
8+
import Foundation
9+
10+
public final class FetchProfileImageDataUseCaseImpl: FetchProfileImageDataUseCase {
11+
private let repository: ProfileImageDataRepository
12+
13+
public init(_ repository: ProfileImageDataRepository) {
14+
self.repository = repository
15+
}
16+
17+
public func execute(from url: URL) async throws -> Data {
18+
try await repository.fetchImageData(from: url)
19+
}
20+
}

0 commit comments

Comments
 (0)