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

Notification fluent bit 연결 #57

Merged
merged 23 commits into from
Oct 15, 2023
Merged

Notification fluent bit 연결 #57

merged 23 commits into from
Oct 15, 2023

Conversation

13wjdgk
Copy link
Contributor

@13wjdgk 13wjdgk commented Oct 14, 2023

Changes 📝

작업 내용을 작성합니다.

  • notification fluent bit 연결
  • 회원가입 시, 체중 중복 저장 핸들링
  • 닉네임 중복 조회 조건 수정
  • fcmToken 등록 api

Details 🌼

구현 방식, 공유 사항, 스크린샷 등 해당 PR에 대한 상세한 내용을 작성합니다.

  • 오후 6시마다 오늘 접속하지 않은 유저를 조회해 femMessage를 전송합니다.
  • 클라이언트에서 회원가입을 두번 요청하는 경우가 있어, 중복 저장 핸들링을 하였습니다
  • 클라이언트에서, fcmToken을 새로 갱신 받았을 때 저장할 수 있는 api를 구현하였습니다.

Check List ☑️

  • 테스트 코드를 통과했다.
  • merge할 브랜치의 위치를 확인했다. (main ❌)
  • Assignee를 지정했다.
  • Label을 지정했다.

[Optional] Etc

Reference 등 추가적인 내용이 있을 경우 작성합니다. 이외에는 Etc를 삭제합니다.

@coniverse-github-app

This comment has been minimized.

@13wjdgk 13wjdgk force-pushed the feat/makeNotification branch from 3bf0d97 to 5899140 Compare October 14, 2023 18:15
@coniverse-github-app

This comment has been minimized.

@coniverse-github-app

This comment has been minimized.

* @author EVE
* @since 1.1.0
*/
public record FcmMessage(String registrationTokens, String title, String body) {
Copy link
Member

Choose a reason for hiding this comment

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

P2) lambda function에서 데이터를 읽을 때

{
    "registration_token" : "fcm 토큰",
    "title" : "푸시 알림 제목",
    "body" : "알림 내용"
}

의 값을 기대해요

token 복수형 제거해주시고

Suggested change
public record FcmMessage(String registrationTokens, String title, String body) {
public record FcmMessage(@JsonProperty("registration_token")String registrationToken, String title, String body) {

으로 수정이 필요할 것 같습니다

@Slf4j
@Service
@RequiredArgsConstructor
public class NotificationFluentbitService {
Copy link
Member

Choose a reason for hiding this comment

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

P3) FluentBit이 만약 다른 도구로 변경되면 클래스명, 메서드명 전부 수정해야 하는 상황이 생길 것 같아요

@@ -10,5 +11,6 @@
* @author EVE
* @since 1.1.0
*/
public interface NotificationTypeRepository extends JpaRepository<NotificationType, Long> {
@Repository
public interface NotificationTypeRepository extends JpaRepository<NotificationType, String> {
Copy link
Member

Choose a reason for hiding this comment

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

P3) 1차 MVP 배포 후에 타입은 ENUM으로 관리하도록 수정하는건 어떨까 싶습니다

@@ -10,6 +16,14 @@
* @author EVE
* @since 1.1.0
*/
@Repository
Copy link
Member

Choose a reason for hiding this comment

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

P3) 불필요한 어노테이션입니당

@@ -10,5 +11,6 @@
* @author EVE
* @since 1.1.0
*/
public interface NotificationTypeRepository extends JpaRepository<NotificationType, Long> {
@Repository
Copy link
Member

Choose a reason for hiding this comment

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

P3) 불필요한 어노테이션입니당

* @author EVE
* @since 1.0.0
*/
public class InvalidNotificationTypeException extends BusinessException {
Copy link
Member

Choose a reason for hiding this comment

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

P3) notification 패키지 하위에 있는게 좋을 것 같아요

-- ("운동 기록 !", "오늘 운동을 기록해보세요 ~ ", '2023-10-10', "기록", "11111111", false),
-- ("체중 기록!", "오늘 체중을 기록해보세요 ~ ", '2023-10-08', "기록", "22222222", true),
-- ("접속해주세요!", "오늘은 접속 안하셨네요 ~ 접속해서 포인트 받아가세요", '2023-10-09', "접속", "22222222", false),
-- ("운동 기록 !", "오늘 운동을 기록해보세요 ~ ", '2023-10-10', "기록", "11111111", false);
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
Contributor Author

Choose a reason for hiding this comment

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

나중에 알림 더미테이터가 필요할때를 대비해서 남겨뒀어요 !

* notificationType을 찾을 수 없을 때 발생
*
* @author EVE
* @since 1.0.0
Copy link
Member

Choose a reason for hiding this comment

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

P3) since 수정 필요

@Test
void notificationType을_조회한다() {
//given
LocalDate date = LocalDate.now();
Copy link
Member

Choose a reason for hiding this comment

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

P3) 사용하지 않는 변수


@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@SpringBootTest
class NotificationSearchServiceTest {
Copy link
Member

Choose a reason for hiding this comment

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

P3) JavaDoc 필요

@coniverse-github-app

This comment has been minimized.

@coniverse-github-app

This comment has been minimized.

@coniverse-github-app
Copy link

Passed

Analysis Details

1 Issue

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 1 Code Smell

Coverage and Duplications

  • Coverage 91.43% Coverage (97.10% Estimated after merge)
  • Duplications 0.00% Duplicated Code (0.80% Estimated after merge)

Project ID: co-niverse_dangjang-backend_AYj2jZJELehUZAlqDvRk

View in SonarQube

Copy link
Member

@GIVEN53 GIVEN53 left a comment

Choose a reason for hiding this comment

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

👍🏻

@13wjdgk 13wjdgk merged commit 89ce126 into dev Oct 15, 2023
1 check passed
@13wjdgk 13wjdgk added the feature 기능 label Oct 15, 2023
@13wjdgk 13wjdgk self-assigned this Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 기능
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants