-
Notifications
You must be signed in to change notification settings - Fork 17
[Feat]#731 - 딥링크 로직 구현 #737
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
base: develop
Are you sure you want to change the base?
Changes from all commits
a793819
697b343
41631e5
502e729
593feee
8f02fa9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // | ||
| // SoptampEntirePartRankingDeepLink.swift | ||
| // StampFeature | ||
| // | ||
| // Created by 성현주 on 10/20/25. | ||
| // Copyright © 2025 SOPT-iOS. All rights reserved. | ||
| // | ||
|
|
||
|
|
||
| import Foundation | ||
| import BaseFeatureDependency | ||
| import Core | ||
|
|
||
| public struct SoptampEntirePartRankingDeepLink: DeepLinkExecutable { | ||
| public let name = "entire-part-ranking" | ||
| public let children: [DeepLinkExecutable] = [SoptampPartRankingDeepLink()] | ||
| public var isDestination: Bool = false | ||
|
|
||
| public init() {} | ||
|
|
||
| public func execute(with coordinator: Coordinator, queryItems: [URLQueryItem]?) -> Coordinator? { | ||
| switch Config.coordinatorFlag { | ||
| case .legacy: | ||
| guard let coordinator = coordinator as? LegacyStampCoordinator else { return nil } | ||
| coordinator.runRankingFlow(rankingViewType: .partRanking) | ||
| case .new: | ||
| guard let coordinator = coordinator as? StampCoordinator else { return nil } | ||
| coordinator.runRankingFlow(rankingViewType: .partRanking) | ||
| } | ||
| return coordinator | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // | ||
| // SoptampMissionDetailDeepLink.swift | ||
| // StampFeature | ||
| // | ||
| // Created by 성현주 on 10/21/25. | ||
| // Copyright © 2025 SOPT-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
| import BaseFeatureDependency | ||
| import Core | ||
|
|
||
| public struct SoptampMissionDetailDeepLink: DeepLinkExecutable { | ||
| public let name = "missionDetail" | ||
| public let children: [DeepLinkExecutable] = [] | ||
| public var isDestination: Bool = true | ||
|
|
||
| public init() {} | ||
|
|
||
| public func execute(with coordinator: Coordinator, queryItems: [URLQueryItem]?) -> Coordinator? { | ||
| guard let idString = queryItems?.getQueryValue(key: "id"), | ||
| let missionId = Int(idString) else { | ||
| return nil | ||
| } | ||
|
|
||
| let nickname = queryItems?.getQueryValue(key: "nickname") | ||
|
|
||
| switch Config.coordinatorFlag { | ||
| case .legacy: | ||
| guard let coordinator = coordinator as? LegacyStampCoordinator else { | ||
| return nil | ||
| } | ||
|
|
||
| case .new: | ||
| guard let coordinator = coordinator as? StampCoordinator else { | ||
| return nil | ||
| } | ||
| coordinator.runMissionDetailById(missionId: missionId, username: nickname) | ||
| } | ||
| return coordinator | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,37 @@ | ||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||
| // SoptampPartMissionListDeepLink.swift | ||||||||||||||||||||||||||||||
| // StampFeature | ||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||
| // Created by 성현주 on 10/21/25. | ||||||||||||||||||||||||||||||
| // Copyright © 2025 SOPT-iOS. All rights reserved. | ||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 파일명 불일치 헤더 주석의 파일명이 실제 파일명과 다릅니다.
//
-// SoptampPartMissionListDeepLink.swift
+// SoptampMissionListDeepLink.swift
// StampFeature📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| import Foundation | ||||||||||||||||||||||||||||||
| import BaseFeatureDependency | ||||||||||||||||||||||||||||||
| import Core | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| public struct SoptampMissionListDeepLink: DeepLinkExecutable { | ||||||||||||||||||||||||||||||
| public let name = "missions" | ||||||||||||||||||||||||||||||
| public let children: [DeepLinkExecutable] = [SoptampMissionDetailDeepLink()] | ||||||||||||||||||||||||||||||
| public var isDestination: Bool = false | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| public init() {} | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| public func execute(with coordinator: Coordinator, queryItems: [URLQueryItem]?) -> Coordinator? { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| guard let username = queryItems?.getQueryValue(key: "nickname"), !username.isEmpty else { | ||||||||||||||||||||||||||||||
| return nil | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| let sentence = queryItems?.getQueryValue(key: "sentence") ?? "" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| switch Config.coordinatorFlag { | ||||||||||||||||||||||||||||||
| case .legacy: | ||||||||||||||||||||||||||||||
| guard let coordinator = coordinator as? LegacyStampCoordinator else { return nil } | ||||||||||||||||||||||||||||||
| case .new: | ||||||||||||||||||||||||||||||
| guard let coordinator = coordinator as? StampCoordinator else { return nil } | ||||||||||||||||||||||||||||||
| coordinator.runOtherMissionList(username: username, sentence: sentence) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| return coordinator | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // | ||
| // SoptampPartRankingDeepLink.swift | ||
| // StampFeature | ||
| // | ||
| // Created by 성현주 on 10/20/25. | ||
| // Copyright © 2025 SOPT-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
| import BaseFeatureDependency | ||
| import Core | ||
|
|
||
| public struct SoptampPartRankingDeepLink: DeepLinkExecutable { | ||
| public let name = "part-ranking" | ||
| public let children: [DeepLinkExecutable] = [SoptampMissionListDeepLink()] | ||
| public var isDestination: Bool = false | ||
|
|
||
| public init() {} | ||
|
|
||
| public func execute(with coordinator: Coordinator, queryItems: [URLQueryItem]?) -> Coordinator? { | ||
|
|
||
| guard let partString = queryItems?.getQueryValue(key: "part") else { | ||
| return coordinator | ||
| } | ||
|
|
||
| guard let part = Part.allCases.first(where: { | ||
| $0.uppercasedName() == partString.uppercased() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오 디테일하네요 |
||
| }) else { | ||
| print("[DeepLink][Soptamp][Error] Invalid part parameter: \(partString)") | ||
| return coordinator | ||
| } | ||
|
|
||
| switch Config.coordinatorFlag { | ||
| case .legacy: | ||
| guard let coordinator = coordinator as? LegacyStampCoordinator else { return nil } | ||
| coordinator.runRankingFlow(rankingViewType: .individualRankingInPart(part: part)) | ||
| case .new: | ||
| guard let coordinator = coordinator as? StampCoordinator else { return nil } | ||
| coordinator.runRankingFlow(rankingViewType: .individualRankingInPart(part: part)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 분기까지 굿! 근데 이제 coordinatorFlag 들어가보면 알겠지만 legacy 쪽은 안 쓰긴 해요 |
||
| } | ||
|
|
||
| return coordinator | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,6 +99,20 @@ public final class StampCoordinator: BaseCoordinator { | |
| // MARK: - MissionDetailFlow | ||
|
|
||
| extension StampCoordinator { | ||
| public func runOtherMissionList(username: String, sentence: String) { | ||
| showOtherMissionList(username, sentence) | ||
| } | ||
|
|
||
| public func runMissionDetailById(missionId: Int, username: String?) { | ||
| let model = MissionListModel( | ||
| id: missionId, | ||
| title: "", | ||
| level: 1, | ||
| isCompleted: true | ||
| ) | ||
| showMissionDetail(model, username) | ||
| } | ||
|
Comment on lines
+106
to
+114
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 더미 데이터로 인한 잠재적 문제
PR 설명에서 언급하신 대로, 미션 레벨 정보 누락 문제에 대한 다음 해결 방안을 검토해 주세요:
public func runMissionDetailById(missionId: Int, username: String?) {
+ // 옵션 1: 쿼리 파라미터에서 레벨 정보를 추가로 받기
+ // public func runMissionDetailById(missionId: Int, username: String?, level: Int?)
+
+ // 옵션 2: 미션 디테일 뷰에서 ID로 전체 정보 fetch 후 업데이트
let model = MissionListModel(
id: missionId,
- title: "",
- level: 1,
+ title: "", // TODO: Fetch from server or pass via query
+ level: 1, // TODO: Get actual level from query parameter
isCompleted: true
)
showMissionDetail(model, username)
}
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 적어주신 내용 확인했는데, 2로 가는 게 깔끔할 듯 ! 안드랑 논의하고 결정해주세요 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dlwogus0128 넵, 알겠습니다! 딥링크 파라미터로 |
||
|
|
||
| private func showMissionDetail(_ model: MissionListModel, _ username: String?) { | ||
| guard let starLevel = StarViewLevel.init(rawValue: model.level) else { return } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
길긴 길다 ㅋㅋㅋㅋ