Skip to content

Commit

Permalink
[FEAT] suggestionItemClick 로깅을 위한 수동 맵핑 로직 추가 (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
915dbfl committed Apr 8, 2024
1 parent fb8c650 commit 380a515
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import com.lgtm.android.common_ui.base.BaseComposeActivity
import com.lgtm.android.common_ui.theme.LGTMTheme
import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.SuggestionDashboardScreen
import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract.SuggestionDashboardUiEffect
import com.lgtm.domain.constants.UNKNOWN
import com.lgtm.domain.logging.SwmCommonLoggingScheme
import com.lgtm.domain.mission_suggestion.SuggestionContent
import com.lgtm.domain.mission_suggestion.SuggestionVO
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch

Expand Down Expand Up @@ -65,7 +66,7 @@ class SuggestionDashboardActivity : BaseComposeActivity() {
}

is SuggestionDashboardUiEffect.ShotSuggestionClickLogging -> {
val scheme = getHomeSuggestionItemClickLoggingScheme(effect.suggestionContent)
val scheme = getHomeSuggestionItemClickLoggingScheme(effect.suggestionVO)
suggestionDashboardViewModel.shotSwmLogging(scheme)
}
}
Expand All @@ -74,11 +75,19 @@ class SuggestionDashboardActivity : BaseComposeActivity() {
}
}

private fun getHomeSuggestionItemClickLoggingScheme(suggestionContent: SuggestionContent): SwmCommonLoggingScheme {
private fun getHomeSuggestionItemClickLoggingScheme(suggestionVO: SuggestionVO): SwmCommonLoggingScheme {
return SwmCommonLoggingScheme.Builder()
.setEventLogName("suggestionItemClick")
.setScreenName(this.javaClass)
.setLogData(mapOf("suggestionItem" to suggestionContent))
.setLogData(mapOf(
"title" to suggestionVO.title,
"description" to suggestionVO.description,
"suggestionId" to suggestionVO.suggestionId,
"dateTime" to (suggestionVO.dateTime ?: UNKNOWN),
"likeNum" to suggestionVO.likeNum,
"isLiked" to suggestionVO.isLiked,
"isMyPost" to suggestionVO.isMyPost
))
.build()
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract

import com.lgtm.domain.mission_suggestion.SuggestionContent
import com.lgtm.domain.mission_suggestion.SuggestionVO

sealed class SuggestionDashboardUiEffect {
object GoBack: SuggestionDashboardUiEffect()
object CreateSuggestion: SuggestionDashboardUiEffect()
data class SuggestionDetail(val suggestionId: Int): SuggestionDashboardUiEffect()
data class ShotSuggestionClickLogging(val suggestionContent: SuggestionContent): SuggestionDashboardUiEffect()
data class ShotSuggestionClickLogging(val suggestionVO: SuggestionVO): SuggestionDashboardUiEffect()
}

0 comments on commit 380a515

Please sign in to comment.