Skip to content

Conversation

@JanooGwan
Copy link
Contributor

@JanooGwan JanooGwan commented Feb 11, 2026

🔍 개요

  • close #이슈번호

🚀 주요 변경 내용

  • 어드민에게 새로운 채팅이 수신되면 슬랙에 알림을 보낼 수 있도록 하였습니다.

💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

@JanooGwan JanooGwan requested a review from Copilot February 11, 2026 04:50
@JanooGwan JanooGwan self-assigned this Feb 11, 2026
@JanooGwan JanooGwan added the 기능 새로운 기능을 개발합니다. label Feb 11, 2026
Copy link
Contributor

Copilot AI left a 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 신규 추가

Comment on lines +36 to +38
public void notifyAdminChatReceived(String senderName, String content) {
String message = ADMIN_CHAT_RECEIVED.format(senderName, content);
slackClient.sendMessage(message, slackProperties.webhooks().event());
Copy link

Copilot AI Feb 11, 2026

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 전송)하거나, 최소한 @ 치환/필터링 등 정책을 정해 적용하는 처리가 필요합니다.

Copilot uses AI. Check for mistakes.
Comment on lines 4 to 9
Integer userId,
String senderName,
String content
) {
public static AdminChatReceivedEvent of(Integer userId, String senderName, String content) {
return new AdminChatReceivedEvent(userId, senderName, content);
Copy link

Copilot AI Feb 11, 2026

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로 변경하거나, 필요 없다면 제거하는 쪽으로 정리하는 것이 좋습니다.

Suggested change
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);

Copilot uses AI. Check for mistakes.
@JanooGwan JanooGwan merged commit 9968311 into develop Feb 11, 2026
1 check passed
@JanooGwan JanooGwan deleted the feat/admin-chat-slack-alert branch February 12, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

기능 새로운 기능을 개발합니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant