-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: fcm 푸시 알림 리팩토링 #110
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kimyu0218
commented
Dec 19, 2024
created_at datetime(6) null, | ||
deleted_at datetime(6) null, | ||
updated_at datetime(6) null, | ||
device_identifier varchar(255) not null, |
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.
device_token
이 변할 수 있는 값이고 푸시 알림을 활성화하지 않은 경우 없는 값이기 때문에 기기를 구별하는 고유 식별자를 클라이언트한테서 전달 받을 예정입니다 (aos는 있다고 합니당)- aos는 식별자가 20자 정도라고 하는데 아직 ios는 몰라서 일단 255자로 두었습니다~
kimyu0218
commented
Dec 20, 2024
Comment on lines
+27
to
+35
@Transactional | ||
public void updateDeviceToken(final UpdateDeviceTokenCommand command) { | ||
if (command.deviceIdentifier().isBlank() // TODO: 추후 앞의 조건 삭제 | ||
|| !deviceRepository.existsByDeviceIdentifier(command.deviceIdentifier())) { | ||
createDevice(command.memberId(), command.deviceIdentifier(), command.deviceToken(), command.osType()); | ||
} else { | ||
updateDevice(command.memberId(), command.deviceIdentifier(), command.deviceToken()); | ||
} | ||
} |
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.
Warning
PATCH 시 insert가 발생합니다
updateDeviceToken
이 실행되었을 때device
테이블을 확인하여 insert나 update를 수행하고 있습니다.- insert가 POST가 아닌 PATCH에서 발생하게 되는데 404를 내려주고
createDevice
를 실행하도록 하는 것이 좋을까요?
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Number
close: #108
작업 개요
다중 로그인, 멀티 디바이스 지원을 위해 fcm 푸시 알림을 리팩토링 했습니다.
작업 사항
device
,device_subscription
테이블을 만들었습니다.member
테이블에 두었던device_token
필드를 삭제하고device
라는 별도의 테이블을 만들었습니다.device_subscription
테이블에 멤버의 특정 디바이스가 구독한 미션 목록을 저장하도록 만들었습니다.device
와member
도메인을 분리했습니다. (service, presentation, domain 등)고민한 점들(필수 X)
Note
(aos의 경우) 하나의 디바이스로 여러 계정에 로그인할 수 있습니다.
A 계정
과B 계정
이 디바이스 토큰을 공유할 때,A 계정
에게B 계정
의 푸시 알림이,B 계정
에게A 계정
의 푸시 알림이 전송될 수 있습니다.Note
(현재는 사용하지 않지만) 디바이스 운영체제 정보를
device
테이블에os_type
으로 저장하고 있습니다.스크린샷(필수 X)
여기에 작성하세요