diff --git a/main-server/src/main/java/com/sickgyun/server/coffeechat/presentation/CoffeeChatController.java b/main-server/src/main/java/com/sickgyun/server/coffeechat/presentation/CoffeeChatController.java index 9ffdcf2..66e1534 100644 --- a/main-server/src/main/java/com/sickgyun/server/coffeechat/presentation/CoffeeChatController.java +++ b/main-server/src/main/java/com/sickgyun/server/coffeechat/presentation/CoffeeChatController.java @@ -18,7 +18,7 @@ import com.sickgyun.server.auth.repository.AuthRepository; import com.sickgyun.server.coffeechat.presentation.dto.AcceptResponse; import com.sickgyun.server.coffeechat.presentation.dto.CoffeeChatRequest; -import com.sickgyun.server.coffeechat.presentation.dto.CoffeeChatResponse; +import com.sickgyun.server.coffeechat.presentation.dto.MySentCoffeeChatResponse; import com.sickgyun.server.coffeechat.presentation.dto.ReceivedCoffeeChatResponse; import com.sickgyun.server.coffeechat.service.CommandCoffeeChatService; import com.sickgyun.server.coffeechat.service.QueryCoffeeChatService; @@ -75,9 +75,9 @@ public List getReceiveCoffeeChat() { @GetMapping("/my/send") @LoginRequired - public List getSendPendingChat() { + public List getSendPendingChat() { return queryCoffeeChatService.getByFromUser(authRepository.getCurrentUser()).stream() - .map(CoffeeChatResponse::from) + .map(MySentCoffeeChatResponse::from) .toList(); } diff --git a/main-server/src/main/java/com/sickgyun/server/coffeechat/presentation/dto/CoffeeChatResponse.java b/main-server/src/main/java/com/sickgyun/server/coffeechat/presentation/dto/MySentCoffeeChatResponse.java similarity index 58% rename from main-server/src/main/java/com/sickgyun/server/coffeechat/presentation/dto/CoffeeChatResponse.java rename to main-server/src/main/java/com/sickgyun/server/coffeechat/presentation/dto/MySentCoffeeChatResponse.java index 6556938..9d1d599 100644 --- a/main-server/src/main/java/com/sickgyun/server/coffeechat/presentation/dto/CoffeeChatResponse.java +++ b/main-server/src/main/java/com/sickgyun/server/coffeechat/presentation/dto/MySentCoffeeChatResponse.java @@ -4,17 +4,21 @@ import com.sickgyun.server.coffeechat.domain.value.State; import com.sickgyun.server.user.presentation.dto.UserResponse; -public record CoffeeChatResponse( +public record MySentCoffeeChatResponse( Long id, State state, + String message, + ContactResponse contact, UserResponse toUser, UserResponse fromUser ) { - public static CoffeeChatResponse from(CoffeeChat coffeeChat) { - return new CoffeeChatResponse( + public static MySentCoffeeChatResponse from(CoffeeChat coffeeChat) { + return new MySentCoffeeChatResponse( coffeeChat.getId(), coffeeChat.getState(), + coffeeChat.getMessage(), + coffeeChat.getState().equals(State.ACCEPT) ? ContactResponse.from(coffeeChat.getToUser().getContact()) : null, UserResponse.from(coffeeChat.getToUser()), UserResponse.from(coffeeChat.getFromUser()) );