-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 도서 검색 실패 기능 개발 #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: 도서 검색 실패 기능 개발 #267
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b3a222f
[BOOK-476] feat: 도서 등록 요청 화면 개발
doyeonk429 5d927f5
Revert "[BOOK-476] feat: 도서 등록 요청 화면 개발"
doyeonk429 611979d
[BOOK-476] feat: EmptyStateView 내 버튼 General하게 사용할 수 있도록 수정
doyeonk429 dbdfb51
[BOOK-476] feat: EmptyStateView에 외부에서 텍스트 주입 가능하도록 수정
doyeonk429 b7db61d
[BOOK-476] feat: SearchView에 EmptyView 상태 적용
doyeonk429 80479a9
[BOOK-476] chore: kakao_chat_url 추가 및 Copyright 수정
doyeonk429 1713628
[BOOK-476] feat: ExternalLinkRepository & OpenExternalLinkUseCase 추가
doyeonk429 945e321
[BOOK-476] feat: DefaultExternalLinkRepository 구현
doyeonk429 cd75dc4
[BOOK-476] feat: AppScheme 처리하는 로직 추가
doyeonk429 dc5a21c
[BOOK-476] feat: SearchCoordinator에서 웹페이지 이동 처리
doyeonk429 5a934c5
[BOOK-476] chore: kakao plus chat account 관리
doyeonk429 6842263
[BOOK-476] fix: 리뷰 반영
doyeonk429 5e153a3
[BOOK-476] fix: view 상태 업데이트 함수로 일괄처리
doyeonk429 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/Projects/BKData/Sources/Repository/DefaultExternalLinkRepository.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // Copyright © 2026 Booket. All rights reserved | ||
|
|
||
| import BKCore | ||
| import BKDomain | ||
| import Combine | ||
| import UIKit | ||
|
|
||
| final class DefaultExternalLinkRepository: ExternalLinkRepository { | ||
| func canOpen(_ urlString: String) -> Bool { | ||
| guard let url = URL(string: urlString) else { | ||
| Log.error("유효하지 않은 URL 형식: \(urlString)", logger: AppLogger.network) | ||
| return false | ||
| } | ||
| return UIApplication.shared.canOpenURL(url) | ||
| } | ||
|
|
||
| func open(_ urlString: String) -> AnyPublisher<Bool, Never> { | ||
| return Future<Bool, Never> { promise in | ||
| guard let url = URL(string: urlString) else { | ||
| Log.error("URL 객체 생성 실패: \(urlString)", logger: AppLogger.network) | ||
| promise(.success(false)) | ||
| return | ||
| } | ||
|
|
||
| DispatchQueue.main.async { | ||
| if UIApplication.shared.canOpenURL(url) { | ||
| UIApplication.shared.open(url, options: [:]) { success in | ||
| promise(.success(success)) | ||
| } | ||
| } else { | ||
| promise(.success(false)) | ||
| } | ||
| } | ||
| } | ||
| .eraseToAnyPublisher() | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/Projects/BKDomain/Sources/Interface/Repository/ExternalLinkRepository.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // Copyright © 2026 Booket. All rights reserved | ||
|
|
||
| import Combine | ||
| import Foundation | ||
|
|
||
| /// 외부 시스템(앱 스킴 또는 웹 브라우저)으로 링크를 연결하고 상태를 확인하는 인터페이스입니다. | ||
| public protocol ExternalLinkRepository { | ||
|
|
||
| /// 전달받은 URL 문자열이 현재 시스템에서 실행 가능한지 여부를 확인합니다. | ||
| /// | ||
| /// - Parameter urlString: 확인할 대상 URL 문자열 (예: "kakaoplus://...", "https://...") | ||
| /// - Returns: 실행 가능 여부 (true: 실행 가능, false: 실행 불가 또는 스킴 미등록) | ||
| func canOpen(_ urlString: String) -> Bool | ||
|
|
||
| /// 전달받은 URL 문자열을 통해 외부 링크를 실행합니다. | ||
| /// | ||
| /// - Parameter urlString: 실행할 대상 URL 문자열 | ||
| /// - Returns: 실행 성공 여부를 전달하는 Publisher (true: 실행 성공, false: 실행 실패) | ||
| func open(_ urlString: String) -> AnyPublisher<Bool, Never> | ||
| } |
10 changes: 10 additions & 0 deletions
10
src/Projects/BKDomain/Sources/Interface/Usecase/OpenExternalLinkUseCase.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // Copyright © 2026 Booket. All rights reserved | ||
|
|
||
| import Combine | ||
| import Foundation | ||
|
|
||
| public protocol OpenExternalLinkUseCase { | ||
| /// 외부 링크를 실행합니다. | ||
| /// appScheme이 있고 실행 가능한 경우 우선 실행하며, 실패 시 urlString을 실행합니다. | ||
| func execute(urlString: String, appScheme: String?) -> AnyPublisher<Bool, Never> | ||
| } |
20 changes: 20 additions & 0 deletions
20
src/Projects/BKDomain/Sources/UseCase/DefaultOpenExternalLinkUseCase.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // Copyright © 2026 Booket. All rights reserved | ||
|
|
||
| import Combine | ||
| import Foundation | ||
|
|
||
| public struct DefaultOpenExternalLinkUseCase: OpenExternalLinkUseCase { | ||
| private let repository: ExternalLinkRepository | ||
|
|
||
| init(repository: ExternalLinkRepository) { | ||
| self.repository = repository | ||
| } | ||
|
|
||
| public func execute(urlString: String, appScheme: String?) -> AnyPublisher<Bool, Never> { | ||
| if let appScheme = appScheme, repository.canOpen(appScheme) { | ||
| return repository.open(appScheme) | ||
| } | ||
|
|
||
| return repository.open(urlString) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/Projects/BKPresentation/Sources/Constant/URLConstants.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // Copyright © 2026 Booket. All rights reserved | ||
|
|
||
| import Foundation | ||
|
|
||
| private final class PresentationBundleToken {} | ||
|
|
||
| public enum URLConstants { | ||
| private static let bundle = Bundle(for: PresentationBundleToken.self) | ||
|
|
||
| private static let kakaoAccount: String = { | ||
| guard let value = bundle.object(forInfoDictionaryKey: "KAKAO_ACCOUNT") as? String else { | ||
| fatalError("Can't load KAKAO_ACCOUNT") | ||
| } | ||
| return value | ||
| }() | ||
|
|
||
| public static let kakaoAppScheme = "kakaoplus://plusfriend/home/\(kakaoAccount)" | ||
| public static let kakaoChatURL = "https://pf.kakao.com/\(kakaoAccount)/chat" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.