-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] 채팅방 들어왔을 때 해당 채팅방 알림 모두 읽기 (#164)
* style: 코드 포맷팅 * feat: 특정 채팅방에 대한 알림을 모두 읽는 서비스 메서드 구현 * feat: 회원과 url에 해당하는 알림을 모두 읽는 벌크 쿼리 구현 * refactor: 다른 서비스들처럼 findByIdOrThrow 메서드 분리 * feat: 리터럴 상수를 관리하는 BuddyBridgeStatic 클래스 구현 - 채팅방, 게시글 URL 접두사 상수 정의 - 알림 메시지 포맷 상수 정의 - 알림 URL 생성을 위한 유틸리티 메서드 추가 * style: 불필요한 공백 제거
- Loading branch information
1 parent
5a676de
commit 6987c52
Showing
7 changed files
with
68 additions
and
33 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
23 changes: 23 additions & 0 deletions
23
src/main/java/econo/buddybridge/common/consts/BuddyBridgeStatic.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,23 @@ | ||
package econo.buddybridge.common.consts; | ||
|
||
import econo.buddybridge.post.entity.PostType; | ||
|
||
public class BuddyBridgeStatic { | ||
|
||
public static final String CHAT_ROOM_PREFIX = "/chat/"; | ||
public static final String POST_TAKER_PREFIX = "/help-me/"; | ||
public static final String POST_GIVER_PREFIX = "/help-you/"; | ||
|
||
public static final String CHAT_NOTIFICATION_MESSAGE = "%s님이 메시지를 보냈습니다. - %s"; | ||
public static final String COMMENT_NOTIFICATION_MESSAGE = "%s님이 댓글을 남겼습니다. - %s"; | ||
|
||
public static final String CHAT_NOTIFICATION_URL = CHAT_ROOM_PREFIX + "%d"; | ||
public static final String COMMENT_NOTIFICATION_URL_TAKER = POST_TAKER_PREFIX + "%d"; | ||
public static final String COMMENT_NOTIFICATION_URL_GIVER = POST_GIVER_PREFIX + "%d"; | ||
|
||
public static String getCommentNotificationUrl(PostType postType, Long postId) { | ||
return PostType.TAKER.equals(postType) | ||
? String.format(COMMENT_NOTIFICATION_URL_TAKER, postId) | ||
: String.format(COMMENT_NOTIFICATION_URL_GIVER, postId); | ||
} | ||
} |
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