Skip to content

Commit 9ed1677

Browse files
committed
[FEAT/#380] DeeplinkType 네이밍 변경
1 parent 23a9abf commit 9ed1677

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package com.terning.core.designsystem.type
22

3-
enum class DeeplinkHost(val path: String) {
3+
enum class DeeplinkType(val path: String) {
44
CALENDAR("calendar"),
55
HOME("home"),
66
SEARCH("search"),
77
KAKAOLINK("kakaolink"),
88
INTERN("intern");
99

1010
companion object {
11-
fun from(type: String?): DeeplinkHost? =
11+
fun from(type: String?): DeeplinkType? =
1212
entries.firstOrNull { it.path.equals(type, ignoreCase = true) }
1313
}
1414
}

core/firebase/src/main/java/com/terning/core/firebase/messageservice/TerningMessagingService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import com.google.firebase.messaging.FirebaseMessagingService
1616
import com.google.firebase.messaging.RemoteMessage
1717
import com.terning.core.analytics.AmplitudeTracker
1818
import com.terning.core.analytics.EventType
19-
import com.terning.core.designsystem.type.DeeplinkHost
19+
import com.terning.core.designsystem.type.DeeplinkType
2020
import com.terning.core.designsystem.util.DeeplinkDefaults
2121
import com.terning.core.firebase.R
2222
import com.terning.domain.user.repository.UserRepository
@@ -161,7 +161,7 @@ class TerningMessagingService : FirebaseMessagingService() {
161161
}
162162

163163
private fun buildDeeplink(type: String, isForeground: Boolean): String {
164-
val base = DeeplinkHost.from(type) ?: return ""
164+
val base = DeeplinkType.from(type) ?: return ""
165165

166166
return if (isForeground) DeeplinkDefaults.build(host = base.path)
167167
else DeeplinkDefaults.build(host = BACKGROUND_HOST, redirect = base.path)

feature/main/src/main/java/com/terning/feature/main/MainNavigator.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import androidx.navigation.NavHostController
88
import androidx.navigation.compose.currentBackStackEntryAsState
99
import androidx.navigation.compose.rememberNavController
1010
import androidx.navigation.navOptions
11-
import com.terning.core.designsystem.type.DeeplinkHost
11+
import com.terning.core.designsystem.type.DeeplinkType
1212
import com.terning.feature.calendar.calendar.navigation.Calendar
1313
import com.terning.feature.calendar.calendar.navigation.navigateCalendar
1414
import com.terning.feature.home.navigation.Home
@@ -30,11 +30,11 @@ class MainNavigator(
3030
host: String?,
3131
redirect: String?,
3232
internId: String?
33-
) = when (DeeplinkHost.from(host)) {
34-
DeeplinkHost.SEARCH -> Search
35-
DeeplinkHost.HOME -> Home(internId = null)
36-
DeeplinkHost.CALENDAR -> Calendar
37-
DeeplinkHost.KAKAOLINK -> Splash(redirect = redirect, internId = internId)
33+
) = when (DeeplinkType.from(host)) {
34+
DeeplinkType.SEARCH -> Search
35+
DeeplinkType.HOME -> Home(internId = null)
36+
DeeplinkType.CALENDAR -> Calendar
37+
DeeplinkType.KAKAOLINK -> Splash(redirect = redirect, internId = internId)
3838

3939
else -> Splash(redirect = redirect)
4040
}

feature/splash/src/main/java/com/terning/feature/splash/SplashRoute.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import com.terning.core.designsystem.extension.launchPlayStore
2828
import com.terning.core.designsystem.theme.TerningMain
2929
import com.terning.core.designsystem.theme.TerningPointTheme
3030
import com.terning.core.designsystem.theme.White
31-
import com.terning.core.designsystem.type.DeeplinkHost
31+
import com.terning.core.designsystem.type.DeeplinkType
3232
import com.terning.domain.update.entity.UpdateState
3333
import com.terning.feature.splash.component.TerningMajorUpdateDialog
3434
import com.terning.feature.splash.component.TerningPatchUpdateDialog
@@ -87,11 +87,11 @@ internal fun SplashRoute(
8787
when (sideEffect) {
8888
is SplashSideEffect.HasAccessToken -> {
8989
if (sideEffect.hasAccessToken) {
90-
when (DeeplinkHost.from(redirect)) {
91-
DeeplinkHost.CALENDAR -> navigateToCalendar()
92-
DeeplinkHost.HOME -> navigateToHome(null)
93-
DeeplinkHost.SEARCH -> navigateToSearch()
94-
DeeplinkHost.INTERN -> navigateToHome(internId.orEmpty())
90+
when (DeeplinkType.from(redirect)) {
91+
DeeplinkType.CALENDAR -> navigateToCalendar()
92+
DeeplinkType.HOME -> navigateToHome(null)
93+
DeeplinkType.SEARCH -> navigateToSearch()
94+
DeeplinkType.INTERN -> navigateToHome(internId.orEmpty())
9595

9696
else -> navigateToHome(null)
9797
}

0 commit comments

Comments
 (0)