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

✨ feat(notification): change memory storage -> mongoDB storage #210

Merged
merged 28 commits into from
Jul 15, 2023

Conversation

siyeonSon
Copy link
Member

@siyeonSon siyeonSon commented Jul 14, 2023

@siyeonSon siyeonSon added ✨feature New feature or request ♻️refactor Refactor code. labels Jul 14, 2023
@siyeonSon siyeonSon self-assigned this Jul 14, 2023
Comment on lines +73 to +75
public void save(TopicPushRequestDto tokenPushRequestDto) {
// TODO: 토픽 저장에 따른 스키마 변경 후 구체화
}
Copy link
Member Author

Choose a reason for hiding this comment

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

현재 스키마로는 UserDevice 정보에 사용자가 구독하는 topic 정보를 저장하지 않아요.

토픽 별로 사용자에게 알림을 보내는 로직 구체화 후에 스키마를 변경해야 할 것 같아요!

@siyeonSon siyeonSon marked this pull request as ready for review July 15, 2023 10:26
@siyeonSon
Copy link
Member Author

siyeonSon commented Jul 15, 2023

알림 정보를 저장하는 로직은 NotificationService 이고, 알림을 보내는 로직은 PushService 입니다.
여기에 TokenService, TopicService 까지 추가되고 있어요.
Service 네이밍이 애매모호한 문제가 있어요.

좋은 방법을 생각해보고, 추가 이슈로 리팩토링하겠습니다!

@siyeonSon
Copy link
Member Author

저장되는 json 정보💁‍♀️

  • Notification
    image

  • UserDevice
    image

Copy link
Collaborator

@seonghun-dev seonghun-dev left a comment

Choose a reason for hiding this comment

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

LGTM 😄

@seonghun-dev seonghun-dev changed the base branch from main to dev July 15, 2023 10:41
Copy link
Collaborator

@yunyoung1819 yunyoung1819 left a comment

Choose a reason for hiding this comment

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

Good!

@siyeonSon siyeonSon merged commit ab7a95d into dev Jul 15, 2023
1 check passed
@siyeonSon siyeonSon deleted the feature/notification/mongodb branch July 15, 2023 12:51
seonghun-dev pushed a commit that referenced this pull request Jul 18, 2023
* ✨ feat: create UserDeviceRepository

* ✨ chore: find device token by userId

* ✨ chore: find all device tokens

* ✨ feat: save token

* ✨ feat: update token

* ✨ feat: delete token

* ✨ chore: combine saveToken and insertToken

* ✨ chore: add Transactional annotation

* ✨ chore: change TokenRepository -> UserDeviceRepository in PushService

* ✨ chore: change TokenRepository -> UserDeviceRepository in TopicService

* ✨ chore: delete TokenRepository and MemoryTokenRepository

* ✨ chore: rename createToken -> saveToken

* ✨ feat: save notification

* 🐛 fix: fix Query annotation of findAllDeviceTokens

* ♻️ refactor: delete UserDevice

* ♻️ refactor: delete deleteToken service logic

* ♻️ refactor: change findDeviceTokenByUserId -> findByUserId

* ♻️ refactor: find tokens using findDeviceTokenByUserId -> findByUserId

* ♻️ refactor: add transactional annotation

* ♻️ refactor: extract getting tokens logic into private method

* ♻️ refactor: give space

* ♻️ refactor: change token not found error message

* 🔥 chore: remove Param annotation

* ♻️ refactor: find tokens using findByUserId -> findDeviceTokenByUserId

* ♻️ refactor: change token not found error message

* ♻️ refactor: remove unused import statement

* ♻️ refactor: notificationList save -> saveAll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨feature New feature or request ♻️refactor Refactor code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change memory storage -> mongoDB storage
3 participants