Skip to content
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

[Feature/#68] : fcm, like api #72

Merged
merged 24 commits into from
Sep 6, 2024
Merged

Conversation

sohyun127
Copy link
Collaborator

โœ… ๐—–๐—ต๐—ฒ๐—ฐ๐—ธ-๐—Ÿ๐—ถ๐˜€๐˜

  • mergeํ•  ๋ธŒ๋žœ์น˜์˜ ์œ„์น˜๋ฅผ ํ™•์ธํ•ด ์ฃผ์„ธ์š”(mainโŒ/developโญ•)
  • ๋ฆฌ๋ทฐ๊ฐ€ ํ•„์š”ํ•œ ๊ฒฝ์šฐ ๋ฆฌ๋ทฐ์–ด๋ฅผ ์ง€์ •ํ•ด ์ฃผ์„ธ์š”
  • P1 ๋‹จ๊ณ„์˜ ๋ฆฌ๋ทฐ๋Š” ํ•„์ˆ˜๋กœ ๋ฐ˜์˜ํ•ฉ๋‹ˆ๋‹ค.
  • Approve๋œ PR์€ assigner๊ฐ€ ๋จธ์ง€ํ•˜๊ณ , ์ˆ˜์ • ์š”์ฒญ์ด ์˜จ ๊ฒฝ์šฐ ์ˆ˜์ • ํ›„ ๋‹ค์‹œ push๋ฅผ ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ“Œ ๐—œ๐˜€๐˜€๐˜‚๐—ฒ๐˜€

๐Ÿ“Ž๐—ช๐—ผ๐—ฟ๐—ธ ๐——๐—ฒ๐˜€๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜๐—ถ๐—ผ๐—ป

  • ํ”ผ๋“œ, ๋‹ต๊ธ€ ์ข‹์•„์š” api
  • fcm
  • ์•ฑ ๋กœ๊ณ  ๋„ฃ๊ธฐ
  • ๋‹ต๊ธ€ ์ž‘์„ฑ ์‹œ ์•„๋ž˜๋กœ ์Šคํฌ๋กค

๐Ÿ“ท ๐—ฆ๐—ฐ๐—ฟ๐—ฒ๐—ฒ๐—ป๐˜€๐—ต๐—ผ๐˜

์ข‹์•„์š”

20240905_174735.mp4

๋‹ต๊ธ€ ์ž‘์„ฑ ์™„๋ฃŒ์‹œ

scroll.webm

๐Ÿ’ฌ ๐—ง๐—ผ ๐—ฅ๐—ฒ๐˜ƒ๐—ถ๐—ฒ๐˜„๐—ฒ๐—ฟ๐˜€

  • ์ผ๋‹จ ์š”๊ธฐ๊นŒ์ง€ ํ•ด์„œ QA ๋ฐ›์„๊ฒŒ์š”!
  • ์ข‹์•„์š” ๊ธฐ๋Šฅ์€ ์—ฌ๋Ÿฌ๋ฒˆ ํด๋ฆญ์‹œ API ๋ฐ˜๋ณต ํ˜ธ์ถœ์„ ๋ง‰๊ธฐ ์œ„ํ•ด ๋””๋ฐ”์šด์Šค๋ฅผ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฒคํŠธ ์ข…๋ฃŒ ์‹œ์  0.5 ๋™์•ˆ ์ถ”๊ฐ€ ์ด๋ฒคํŠธ ์—†์œผ๋ฉด api ํ˜ธ์ถœํ•˜๋Š” ํ˜•ํƒœ์ž…๋‹ˆ๋‹ค!
  • fcm์€ ์ข€ ์ˆ˜์ •ํ•ด์•ผํ•  ๊ฑฐ ๊ฐ™์•„์š”!

@sohyun127 sohyun127 added โญ [FEAT] ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ๊ตฌํ˜„ ๐Ÿฑ ์†Œํ˜„ ๋ฆฌ๋‚˜ labels Sep 5, 2024
@sohyun127 sohyun127 requested review from a team, Eonji-sw and chanubc and removed request for a team September 5, 2024 08:53
Copy link
Member

@Eonji-sw Eonji-sw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@@ -29,6 +29,7 @@ interface ProfileService {
@PATCH("api/v1/withdrawal")
suspend fun patchWithdrawal(@Body requestWithdrawalDto: RequestWithdrawalDto): BaseUnitResponse<Unit>

@Multipart
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 : ์•„! ํ—ท

@@ -159,4 +174,44 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(FragmentHomeBinding::i
if (isUploaded) scrollToTop()
}
}

private val requestPermission = registerForActivityResult(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 : ๋‹ค ํ•ฉ์น˜๊ณ  ์•Œ๋ฆผ๋„ ๊ฐค๋Ÿฌ๋ฆฌ์™€ ๊ฐ™์ด ์ฒจ ์‹œ์ž‘ํ•  ๋•Œ ๋ฐ›์„๊ฑด๊ฐ€์š”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ฐค๋Ÿฌ๋ฆฌ ๋™์˜๋Š” ์˜จ๋ณด๋”ฉ ์ค‘ ํ”„๋กœํ•„ ์„ค์ • ๋ทฐ์—์„œ ๋ฐ›๊ณ , ํ‘ธ์‹œ ์•Œ๋ฆผ ๋™์˜๋Š” ํ™ˆ์—์„œ ๋ฐ›๊ธฐ๋กœ ํ–ˆ์Šต๋‹ˆ๋‹ค! (๊ธฐํš ์š”์ฒญ)

toast("like")
override fun onLikeBtnClick(viewHolder: FeedViewHolder, id: Long, isLiked: Boolean) {
feedActionHandler.onLikeBtnClick(viewHolder, id) { feedId, likeState ->
singleEventHandler.debounce(coroutineScope = lifecycleScope) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 : debounce ๋ง๊ณ  throttle๋Š” ์–ด๋•Œ์š”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debounce์™€ throttle์˜ ์ฐจ์ด์ ์€ throttle์€ ์ ์–ด๋„ n ๋ฐ€๋ฆฌ ์ดˆ๋งˆ๋‹ค ์ •๊ธฐ์ ์œผ๋กœ ๊ธฐ๋Šฅ ์‹คํ–‰์„ ๋ณด์žฅํ•œ๋‹ค๋Š” ์ ์ž…๋‹ˆ๋‹ค!
๋””๋ฐ”์šด์Šค๋Š” ์•„๋ฌด๋ฆฌ ๋งŽ์€ ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•ด๋„ ๋ชจ๋‘ ๋ฌด์‹œํ•˜๊ณ  ํŠน์ • ์‹œ๊ฐ„์‚ฌ์ด์— ์–ด๋–ค ์ด๋ฒคํŠธ๋„ ๋ฐœ์ƒํ•˜์ง€ ์•Š์•˜์„ ๋•Œ ๋”ฑ ํ•œ๋ฒˆ๋งŒ ๋งˆ์ง€๋ง‰ ์ด๋ฒคํŠธ๋ฅผ ๋ฐœ์ƒ์‹œํ‚ค๋Š” ๊ธฐ๋ฒ•์ด๊ตฌ์š”!

throttle์„ ์“ด๋‹ค๋ฉด ์ข‹์•„์š”๋ฅผ ์—ฐ์†ํ•ด์„œ ๋ˆ„๋ฅด๋Š” ํ–‰์œ„๋ฅผ ์™„์ „ํžˆ ๋ง‰๊ธฐ ๋ณด๋‹ค๋Š” api ํ˜ธ์ถœ์„ ์ค„์—ฌ์ค€๋‹ค๋Š” ํ‘œํ˜„์ด ๋งž์„ ๊ฒƒ ๊ฐ™๋„ค์š”! throttle์€ ์ผ์ • ์‹œ๊ฐ„๋งˆ๋‹ค ์š”์ฒญ์„ ๋ณด๋‚ด๋ฏ€๋กœ ์—ฌ๋Ÿฌ๋ฒˆ ํด๋ฆญ ์‹œ ๊ทธ ๊ฐ„๊ฒฉ์— ๋”ฐ๋ผ ์š”์ฒญ์ด ๋ฐœ์ƒํ•  ์ˆ˜ ๋„ ์žˆ์Šต๋‹ˆ๋‹ค ๊ทธ๋ž˜์„œ debounce๋กœ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹น

Copy link
Member

@Eonji-sw Eonji-sw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊นŒ๋จน์Œ ใ…‹ใ…‹

Copy link
Member

@chanubc chanubc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ฒœ์žฌ ๊ฐœ๋ฐœ์ž์˜ ๊ฐœ๋ฏธ์นœ์ฝ”๋“œ ์ž˜๋ณด๊ณ  ๊ฐ‘๋‹ˆ๋‹ค ๐Ÿฅ‡

Comment on lines +74 to +75
implementation(libs.google.play.services)
implementation(libs.firebase.messaging.ktx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ˜น์‹œ ์ด๊ฑฐ ์ตœ์‹  ๋ฒ„์ „์—์„œ ๋Œ์•„๊ฐ€๋‚˜์š”? zํ”Œ๋ฆฝ6์—์„œ fcm์•ˆ์˜ค๊ธธ๋ž˜ ๋ฒ„์ „ ์—…ํ•˜๋‹ˆ๊นŒ ์˜ค๊ธด ํ–ˆ์Šต๋‹ˆ๋‹ค
์ €๋„ ์ •ํ™•ํ•œ ์›์ธ์€ ๋ชจ๋ฅด๊ฒ ์–ด์š”ใ… 

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„์ง ํ‘ธ์‹œ์•Œ๋ฆผ ์•ˆ๋ ๊ฑฐ์—์š” ใ… .ใ…  ์ˆ˜์ • ์ค‘ ใ…Žใ…Ž ๋‹ค์Œ PR์—์„œ ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค-!!

Comment on lines +26 to +28
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/white" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๋ฒˆ์—” meta data์— icon์ถ”๊ฐ€ ์•ˆ ํ•ด๋„ ๋˜๋‚˜์š”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ถ”๊ฐ€ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค!!! ์ˆ˜์ •ํ•˜๋‹ค๊ฐ€ ๋นผ๋†“๊ณ  ์ถ”๊ฐ€ ์•ˆํ–ˆ๋„ค์š” ..ใ…Žใ…Ž

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ทธ๋Œ€๋กœ ๋ณต๋ถ™ํ–ˆ๋Š”๋ฐ ๋Œ์•„๊ฐ€๋Š” ๋ฏธ์นœ์ฝ”๋“œ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

}

viewHolder.likeCountTv.text = updatedLikeCount.toString()
saveLike(id, LikeState(viewHolder.likeBtn.isChecked, updatedLikeCount.toString()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์šฐ์™€..

Comment on lines 92 to 94
likeFeedsFlow.value = likeFeedsFlow.value.toMutableMap().apply {
put(feedId, likeState)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
likeFeedsFlow.value = likeFeedsFlow.value.toMutableMap().apply {
put(feedId, likeState)
}
likeFeedsFlow.update { currentMap ->
currentMap.toMutableMap().apply {
put(feedId, likeState)
}
}

๋งŒ์•ฝ likeFeedsFlow ์—ฌ๋Ÿฌ๊ตฐ๋ฐ์„œ ์ ‘๊ทผ์ด ๋œ๋‹ค๋ฉด update ํ•จ์ˆ˜๋ฅผ ํ†ตํ•ด ์Šค๋ ˆ๋“œ ์•ˆ์ •์„ฑ์„ ์ค„ ์ˆ˜ ์žˆ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค!
์‚ฌ์‹ค ํฐ ์ฐจ์ด๋Š” ๋ชจ๋ฅด๊ฒ ๋Š”๋ฐ ์ €๋„ ๊ฐ’ ๋ณ€ํ™” ๋งŽ์€ ๊ณณ๋“ค์€ ์ด๋ฒˆ์— upate์‚ฌ์šฉํ•ด ๋ณด์•—์–ด์š”

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์˜ค!!!! ์ •๋ง ์ข‹์€ ์ง€์‹์ด๋„ค์š”!! ๋ฐฐ์šฐ๊ณ  ๊ฐ‘๋‹ˆ๋‹ค-! ๋ฉ‹์ง€๋„ค์š”

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ฐ˜์˜ํ–ˆ์Šต๋‹ˆ๋‹ค! 25bcd3a

Comment on lines +80 to +85
.filter { removedCommentIds.contains(it.commentId).not() }
.map { data ->
val likeState = likeStates[data.commentId] ?: LikeState(data.isLiked, data.likedNumber)
val transformedGhost = if (ghostedUserIds.contains(data.postAuthorId)) data.copy(isPostAuthorGhost = true) else data
transformedGhost.copy(likedNumber = likeState.count, isLiked = likeState.isLiked)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋‚˜์ค‘์— ์š”๊ธด usecase๋กœ ๋บ„์ˆ˜๋„ ์žˆ์„๊ฒƒ ๊ฐ™์•„์š”!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋„˜ ์ข‹์•„์š”! ์˜›๋‚ ์— usecase ์“ธ ๋•Œ๋Š” ํ•„์š”์„ฑ์„ ์ž˜ ๋ชฐ๋ž๋Š”๋ฐ, ์š”์ฆ˜ wableํ•˜๋ฉด์„œ ํ•„์š”์„ฑ์„ ๋„ˆ๋ฌด ๋Š๋ผ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹
๋‹ค์Œ ์Šคํ”„๋ฆฐํŠธ ๋•Œ ๋„์ž…ํ•ด๋ด์š” ~!

@sohyun127
Copy link
Collaborator Author

FCM์€ ๋‹ค์Œ pr์—์„œ ์™„๋ฃŒํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค~!

@sohyun127 sohyun127 merged commit 4afbb68 into develop Sep 6, 2024
1 check passed
@sohyun127 sohyun127 deleted the feature/#68-fcm-like-api branch September 7, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
โญ [FEAT] ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ๊ตฌํ˜„ ๐Ÿฑ ์†Œํ˜„ ๋ฆฌ๋‚˜
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] : FCM, like api
3 participants