Skip to content

Commit 90c3a60

Browse files
authored
refactor: 좌석 웹소켓 응답구조 변경
1 parent 3cf8725 commit 90c3a60

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

backend/src/main/java/com/back/api/seat/dto/response/SeatStatusMessage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
public record SeatStatusMessage(
99
Long eventId,
1010
Long seatId,
11-
String status,
11+
String seatCode,
12+
String currentStatus,
1213
int price,
1314
String grade
1415
) {
1516
public static SeatStatusMessage from(Seat seat) {
1617
return new SeatStatusMessage(
1718
seat.getEvent().getId(),
1819
seat.getId(),
20+
seat.getSeatCode(),
1921
seat.getSeatStatus().name(),
2022
seat.getPrice(),
2123
seat.getGrade().name()

backend/src/main/java/com/back/api/seat/event/SeatEventHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public class SeatEventHandler {
1818

1919
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
2020
public void handleSeatStatus(SeatStatusMessage msg) {
21-
log.debug("SEAT_EVENT_RECEIVED eventId={} seatId={} status={}", msg.eventId(), msg.seatId(), msg.status());
21+
log.debug("SEAT_EVENT_RECEIVED eventId={} seatId={} currentStatus={}", msg.eventId(), msg.seatId(),
22+
msg.currentStatus());
2223
publisher.publish(msg);
2324
}
2425
}

backend/src/main/java/com/back/api/seat/event/SeatWebSocketPublisher.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ public class SeatWebSocketPublisher {
1717

1818
public void publish(SeatStatusMessage msg) {
1919
String destination = "/topic/events/" + msg.eventId() + "/seats";
20-
log.debug("WS_PUBLISH destination={} eventId={} seatId={} status={}", destination, msg.eventId(), msg.seatId(),
21-
msg.status());
20+
log.debug("WS_PUBLISH destination={} eventId={} seatId={} currentStatus={}", destination, msg.eventId(),
21+
msg.seatId(),
22+
msg.currentStatus());
2223
messagingTemplate.convertAndSend(destination, msg);
2324
log.debug("WS_PUBLISH_COMPLETE destination={}", destination);
2425
}

0 commit comments

Comments
 (0)