-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Member fcmToken 필드 추가 및 로그인 필드 추가 * feat: 공모 참여 시 총대에게 알림 전송 * feat: 공모 참여 취소 시 총대에게 알림 전송 * feat: 댓글방 상태 변경 시 참여자에게 알림 전송 * feat: 댓글 작성 시 작성자 제외 참여자에게 알림 전송 * refactor: FcmMessageManager 메시지 생성 로직 추출 * chore: FCM key 관리 * style: .gitignore EOF * chore: FCM key path 관리 * chore: dev CI/CD script 수정 * chore: dev CI/CD script 트리거 수정 * chore: dev CI/CD script 트리거 수정 * chore: dev CI/CD script 수정 * chore: fcm key 빈 파일 생성 * chore: properties 파일 수정 * chore: yml 파일 수정 * chore: dev CI/CD 파일 수정 * chore: test fcm key 파일 추가 * chore: dev CI/CD 스크립트 수정 * chore: dev CI/CD 스크립트 수정 * chore: dev CI/CD 스크립트 수정 * chore: dev CI/CD 스크립트 수정 * chore: dev CI/CD 스크립트 수정 * chore: dev CI/CD 스크립트 수정 * chore: dev CI/CD 스크립트 수정 * chore: dev CI/CD 스크립트 수정 * feat: notification 방식에서 data 방식으로 변경 * feat: 전달 데이터에 offering_id 추가 * chore: 파일 읽는 방식 변경 * fix: 토픽 이름 변경 * refactor: QA 위한 로그 * refactor: 로그인 시 fcmToken 비교 후 다를 경우 갱신 * refactor: 거래 상태 알림 문구 변경 * feat: 안드로이드 리다이렉트를 위한 필드 추가 * refactor: 필드명 변경 및 패키지 정리 * refactor: FcmTopic 구현 * refactor: 토큰 갱신 여부 로깅 * feat: 공모 작성 시 본인 제외 broadcasting * refactor: 공모 작성 시 본인 제외 broadcasting 주제 구독 방식 * refactor: FcmCondition, FcmTopic 도메인 추출 * refactor: notification 상수 정리 * refactor: 로그인 요청시 fcmToken 필드 비어있는지 검증 * refactor: offering_member 토픽 이름 변경 * feat: 유효하지 않은 토큰을 가진 사용자에 대한 예외 처리 * refactor: 개발 환경과 로컬 환경 분리 * chore: CI/CD 스크립트 정리 * refactor: notificationService에서 repository 의존성 제거 * refactor: MessageManager 계층 도메인에서 서비스로 이동 * chore: dev CI/CD 스크립트 트리거 수정 * fix: 오래된 토큰을 가진 사용자에 대한 알림 전송 무시 * chore: dev CI/CD 트리거 변경 * refactor: yml 중복 필드 제거 * refactor: 불필요한 어노테이션 제거 * refactor: 민감 정보 로깅 제거 * refactor: fcmToken null 처리 * refactor: 방상태 변경 시 토픽 변경 * refactor: FcmMessageCreator 빈 등록 * refactor: FcmNotificationService 코드 순서 변경 * refactor: NotificationService 반환값 변경 * test: 리팩터링 변경 사항 반영 * chore: dev CI/CD 복구
- Loading branch information
Showing
36 changed files
with
515 additions
and
330 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,4 @@ openapi3.yaml | |
.idea | ||
|
||
### FCM ### | ||
/src/main/resources/fcm | ||
/src/main/resources/fcm |
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
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
4 changes: 0 additions & 4 deletions
4
backend/src/main/java/com/zzang/chongdae/auth/service/dto/KakaoLoginRequest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
package com.zzang.chongdae.auth.service.dto; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
public record KakaoLoginRequest(String accessToken, | ||
|
||
@Nullable | ||
String fcmToken) { | ||
} |
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
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
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
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
45 changes: 0 additions & 45 deletions
45
backend/src/main/java/com/zzang/chongdae/notification/domain/CommentNotification.java
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
backend/src/main/java/com/zzang/chongdae/notification/domain/FcmCondition.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
package com.zzang.chongdae.notification.domain; | ||
|
||
import com.zzang.chongdae.offering.repository.entity.OfferingEntity; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class FcmCondition { | ||
|
||
private static final String CONDITION_FORMAT_TRUE_AND_FALSE = "'%s' in topics && !('%s' in topics)"; | ||
|
||
private final String value; | ||
|
||
public static FcmCondition offeringCondition(OfferingEntity offering) { | ||
FcmTopic memberTopic = FcmTopic.memberTopic(); | ||
FcmTopic proposerTopic = FcmTopic.proposerTopic(offering); | ||
String value = CONDITION_FORMAT_TRUE_AND_FALSE.formatted(memberTopic.getValue(), proposerTopic.getValue()); | ||
return new FcmCondition(value); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
backend/src/main/java/com/zzang/chongdae/notification/domain/FcmData.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.zzang.chongdae.notification.domain; | ||
|
||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
public class FcmData { | ||
|
||
private final Map<String, String> data = new HashMap<>(); | ||
|
||
public void addData(String key, Object value) { | ||
data.put(key, value.toString()); | ||
} | ||
|
||
public Map<String, String> getData() { | ||
data.forEach(this::logWithoutBody); | ||
return Collections.unmodifiableMap(data); | ||
} | ||
|
||
private void logWithoutBody(String key, String value) { | ||
if (!key.equals("body")) { | ||
log.info("{} : {}", key, value); | ||
} | ||
} | ||
} |
7 changes: 5 additions & 2 deletions
7
backend/src/main/java/com/zzang/chongdae/notification/domain/FcmToken.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package com.zzang.chongdae.notification.domain; | ||
|
||
import com.zzang.chongdae.member.repository.entity.MemberEntity; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class FcmToken { | ||
|
||
private final String value; | ||
|
||
public FcmToken(MemberEntity member) { | ||
this.value = member.getFcmToken(); | ||
} | ||
} |
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
31 changes: 31 additions & 0 deletions
31
backend/src/main/java/com/zzang/chongdae/notification/domain/FcmTopic.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.zzang.chongdae.notification.domain; | ||
|
||
import com.zzang.chongdae.offering.repository.entity.OfferingEntity; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class FcmTopic { | ||
|
||
private static final String TOPIC_FORMAT_MEMBER = "member"; | ||
private static final String TOPIC_FORMAT_OFFERING_PROPOSER = "proposer_of_offering_%d"; | ||
private static final String TOPIC_FORMAT_OFFERING_PARTICIPANT = "participant_of_offering_%d"; | ||
|
||
private final String value; | ||
|
||
public static FcmTopic proposerTopic(OfferingEntity offering) { | ||
String value = TOPIC_FORMAT_OFFERING_PROPOSER.formatted(offering.getId()); | ||
return new FcmTopic(value); | ||
} | ||
|
||
public static FcmTopic participantTopic(OfferingEntity offering) { | ||
String value = TOPIC_FORMAT_OFFERING_PARTICIPANT.formatted(offering.getId()); | ||
return new FcmTopic(value); | ||
} | ||
|
||
public static FcmTopic memberTopic() { | ||
return new FcmTopic(TOPIC_FORMAT_MEMBER); | ||
} | ||
} |
Oops, something went wrong.