-
Notifications
You must be signed in to change notification settings - Fork 1
feat: 어드민 채팅 수신 시 슬랙 알림 기능 구현 #202
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
Conversation
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.
Pull request overview
어드민이 새로운 채팅을 수신했을 때(= ADMIN 계정이 메시지 수신자일 때) 트랜잭션 커밋 이후 비동기로 슬랙 Incoming Webhook 알림을 전송하도록 이벤트 기반 연동을 추가한 PR입니다.
Changes:
- 어드민 채팅 수신 시 발행되는
AdminChatReceivedEvent도입 및ChatService에서 조건부 발행 로직 추가 - 트랜잭션 커밋 이후
@Async리스너(ChatSlackListener)에서 슬랙 알림 트리거 - 슬랙 메시지 템플릿(
ADMIN_CHAT_RECEIVED) 및 알림 서비스 메서드 추가
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/gg/agit/konect/infrastructure/slack/service/SlackNotificationService.java | 어드민 채팅 수신 알림 전송 메서드 추가 |
| src/main/java/gg/agit/konect/infrastructure/slack/listener/ChatSlackListener.java | 커밋 이후 비동기 이벤트 리스너로 슬랙 알림 연결 |
| src/main/java/gg/agit/konect/infrastructure/slack/enums/SlackMessageTemplate.java | 어드민 채팅 수신 알림 메시지 템플릿 추가 |
| src/main/java/gg/agit/konect/domain/chat/service/ChatService.java | ADMIN 수신자일 때 이벤트 발행하도록 서비스 로직 확장 |
| src/main/java/gg/agit/konect/domain/chat/event/AdminChatReceivedEvent.java | 어드민 채팅 수신 이벤트 record 신규 추가 |
| public void notifyAdminChatReceived(String senderName, String content) { | ||
| String message = ADMIN_CHAT_RECEIVED.format(senderName, content); | ||
| slackClient.sendMessage(message, slackProperties.webhooks().event()); |
Copilot
AI
Feb 11, 2026
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.
Slack으로 보내는 senderName/content가 사용자 입력 그대로라서 @channel, @here, 특정 사용자 멘션, 링크/마크다운 주입 등으로 원치 않는 알림/포맷이 발생할 수 있습니다. 전송 전에 멘션/마크다운을 무력화(escape 또는 plain_text 전송)하거나, 최소한 @ 치환/필터링 등 정책을 정해 적용하는 처리가 필요합니다.
| Integer userId, | ||
| String senderName, | ||
| String content | ||
| ) { | ||
| public static AdminChatReceivedEvent of(Integer userId, String senderName, String content) { | ||
| return new AdminChatReceivedEvent(userId, senderName, content); |
Copilot
AI
Feb 11, 2026
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.
AdminChatReceivedEvent의 userId 필드가 실제로는 sender.getId()를 담고 있어 의미가 불일치합니다(현재도 listener에서 사용되지 않음). 혼동을 줄이기 위해 필드/팩토리 파라미터를 senderId로 변경하거나, 필요 없다면 제거하는 쪽으로 정리하는 것이 좋습니다.
| Integer userId, | |
| String senderName, | |
| String content | |
| ) { | |
| public static AdminChatReceivedEvent of(Integer userId, String senderName, String content) { | |
| return new AdminChatReceivedEvent(userId, senderName, content); | |
| Integer senderId, | |
| String senderName, | |
| String content | |
| ) { | |
| public static AdminChatReceivedEvent of(Integer senderId, String senderName, String content) { | |
| return new AdminChatReceivedEvent(senderId, senderName, content); |
🔍 개요
🚀 주요 변경 내용
💬 참고 사항
✅ Checklist (완료 조건)