-
Notifications
You must be signed in to change notification settings - Fork 1
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
[DPMBE-128] 유저 도착 이벤트를 받아 FCM Message 발송과 알림을 저장한다 #220
Conversation
|
||
val promiseUsers = promiseUserAdaptor.findByPromiseId(promiseId) | ||
|
||
// 약속에 참여한 유저들 조회 (자기 자신 제외) | ||
val users = promiseUsers | ||
.map { promiseUser -> userAdapter.queryUser(promiseUser.userId) } | ||
.filter { user -> user.id != userId } | ||
|
||
// 도착한 유저 | ||
val arrivalUser = userAdapter.queryUser(userId) | ||
|
||
// 앱 알람 허용한 유저 | ||
val appAlarmPermitUsers = users | ||
.filter { user -> user.fcmNotification.fcmToken != "" && user.fcmNotification.appAlarm } | ||
|
||
val data: MutableMap<String, String> = mutableMapOf() | ||
data["notificationType"] = NotificationType.ARRIVAL.name | ||
data["promiseId"] = promiseId.toString() | ||
data["senderUserId"] = promiseUserUpdateLocationEvent.userId.toString() | ||
|
||
// 행정동 조회 | ||
val intersects = districtRepository.findByLocationIntersects( | ||
Point( | ||
Position(promise.meetPlace!!.coordinate.longitude, promise.meetPlace!!.coordinate.latitude), | ||
), | ||
) | ||
val district = intersects.properties.adm_nm | ||
|
||
// 앱 알람 허용한 유저에게 알람 보내기 |
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.
전체적으로 SRP 준수하게 변경해도 좋을 것 같아요 private 하게 data, intersects district 관련 조회들은 분리해볼 수 있지 않을까요? ㅎㅎ 동작 하기만 하면 상관 없지만 리펙토링 다음에 같이 해요 ㅎ
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.
fcm 발송하는 쪽 전체적으로 리팩토링이 필요할 것 같아요!!
감사합니다 🙇🏻
Kudos, SonarCloud Quality Gate passed! |
개요
작업사항
always true
로 잠재적인 버그 해결(String 값 == 비교, 동일 객체 비교는 === 쓰는거 몰랐었네요 😥)