Skip to content

Commit d684236

Browse files
authored
[REFACTOR] 채팅 요구사항 반영 (#202)
* ♻️refactor: 채팅 도메인 요구사항 반영 - 채팅방 목록 조회 시 썸네일 필드 추가 - 채팅방 상세 조회 시 방장을 나타내는 필드 추가 - 채팅방 목록 조회 시 최근 메시지 순 정렬 적용 * ♻️refactor: 채팅 도메인 요구사항 추가 반영 건 - 모임 조회 시 채팅방 ID도 함께 전달 - 모임 승인제 채팅방 참여 이벤트 추가 - 모임 추방 시 채팅방 탈퇴 이벤트 추가 * ♻️refactor: 채팅 도메인 요구사항 반영 - 기억을 잃어버리고 모임 정보 조회 시 ID를 던지는 로직을 추가를 안하고 커밋을 올려, 재커밋 * ♻️refactor: 채팅 요구사항 반영 - 채팅 유저 목록 조회 API 응답에서 프로필 메시지 필드 추가 - 채팅 추방 시 모임 추방 로직 연동 * ♻️refactor: 채팅 요구사항 반영 - 추방 시스템 메시지 적용 * 🐛fix: 코드 리뷰 피드백 적용
1 parent d14e980 commit d684236

6 files changed

Lines changed: 148 additions & 80 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package team.wego.wegobackend.chat.application.dto.response;
2+
3+
import java.time.LocalDateTime;
4+
import team.wego.wegobackend.chat.domain.entity.MessageType;
5+
6+
/**
7+
* 채팅방 추방 시 WebSocket을 통해 전송되는 페이로드
8+
*/
9+
public record ChatKickPayload(
10+
Long chatRoomId,
11+
Long targetUserId,
12+
String targetUserName,
13+
MessageType messageType,
14+
LocalDateTime timestamp
15+
) {
16+
public static ChatKickPayload of(Long chatRoomId, Long targetUserId, String targetUserName) {
17+
return new ChatKickPayload(
18+
chatRoomId,
19+
targetUserId,
20+
targetUserName,
21+
MessageType.KICK,
22+
LocalDateTime.now()
23+
);
24+
}
25+
}

src/main/java/team/wego/wegobackend/chat/application/dto/response/ParticipantResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public record ParticipantResponse(
99
Long userId,
1010
String nickName,
1111
String profileImage,
12+
String profileMessage,
1213
ParticipantStatus status,
1314
boolean isOwner,
1415
LocalDateTime joinedAt
@@ -19,6 +20,7 @@ public static ParticipantResponse from(ChatParticipant participant, boolean isOw
1920
participant.getUser().getId(),
2021
participant.getUser().getNickName(),
2122
participant.getUser().getProfileImage(),
23+
participant.getUser().getProfileMessage(),
2224
participant.getStatus(),
2325
isOwner,
2426
participant.getJoinedAt()

src/main/java/team/wego/wegobackend/chat/application/listener/ChatEventListener.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import team.wego.wegobackend.group.v2.application.event.GroupJoinedEvent;
1414
import team.wego.wegobackend.group.v2.application.event.GroupJoinKickedEvent;
1515
import team.wego.wegobackend.group.v2.application.event.GroupLeftEvent;
16+
import team.wego.wegobackend.group.v2.application.service.GroupV2AttendanceService;
1617

1718
@Component
1819
@RequiredArgsConstructor
@@ -134,6 +135,8 @@ public void handleGroupKicked(GroupJoinKickedEvent event) {
134135
event.groupId(),
135136
event.targetUserId()
136137
);
138+
139+
137140
log.info("채팅방 추방 처리 완료 - groupId: {}, userId: {}",
138141
event.groupId(), event.targetUserId());
139142
} catch (Exception e) {

0 commit comments

Comments
 (0)