Skip to content

Commit

Permalink
modify: 방 입장 응답 데이터에 영상의 재생 시간 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonise committed Jun 4, 2024
1 parent 9855d9d commit 92882a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/main/java/site/youtogether/room/dto/RoomDetail.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class RoomDetail {
private String currentVideoId;
private String currentVideoTitle;
private String currentChannelTitle;
private double currentVideoTime;

public RoomDetail(Room room, User user, Optional<PlayingVideo> playingVideo) {
this.roomCode = room.getCode();
Expand All @@ -34,6 +35,7 @@ public RoomDetail(Room room, User user, Optional<PlayingVideo> playingVideo) {
this.currentVideoId = p.getVideoId();
this.currentVideoTitle = p.getVideoTitle();
this.currentChannelTitle = p.getChannelTitle();
this.currentVideoTime = p.getCurrentTime();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ void enterRoom() throws Exception {

Participant participantInfo = new Participant(10L, "황똥땡", Role.HOST);
RoomDetail createdRoomDetail = new RoomDetail(roomCode, roomTitle, participantInfo, capacity, 2, false, "phuiiNCxRMg", "aespa 에스파 'Supernova' MV",
"SMTOWN");
"SMTOWN", 10.0);
Optional<User> user = Optional.of(User.builder()
.currentRoomCode(null)
.build());
Expand Down Expand Up @@ -370,6 +370,7 @@ void enterRoom() throws Exception {
.andExpect(jsonPath("$.data.passwordExist").value(false))
.andExpect(jsonPath("$.data.currentVideoTitle").value(createdRoomDetail.getCurrentVideoTitle()))
.andExpect(jsonPath("$.data.currentChannelTitle").value(createdRoomDetail.getCurrentChannelTitle()))
.andExpect(jsonPath("$.data.currentVideoTime").value(createdRoomDetail.getCurrentVideoTime()))
.andDo(document("enter-room-success",
preprocessRequest(prettyPrint()),
preprocessResponse(prettyPrint()),
Expand All @@ -389,7 +390,8 @@ void enterRoom() throws Exception {
fieldWithPath("data.passwordExist").type(JsonFieldType.BOOLEAN).description("비밀번호 존재 여부"),
fieldWithPath("data.currentVideoId").type(JsonFieldType.STRING).description("현재 재생중인 영상의 아이디").optional(),
fieldWithPath("data.currentVideoTitle").type(JsonFieldType.STRING).description("현재 재생중인 영상의 제목").optional(),
fieldWithPath("data.currentChannelTitle").type(JsonFieldType.STRING).description("현재 재생중인 영상의 채널 이름").optional()
fieldWithPath("data.currentChannelTitle").type(JsonFieldType.STRING).description("현재 재생중인 영상의 채널 이름").optional(),
fieldWithPath("data.currentVideoTime").type(JsonFieldType.NUMBER).description("현재 재생중인 영상의 재생 시간").optional()
)
));
}
Expand All @@ -405,7 +407,7 @@ void enterRoomFail() throws Exception {

Participant participantInfo = new Participant(10L, "황똥땡", Role.HOST);
RoomDetail createdRoomDetail = new RoomDetail(roomCode, roomTitle, participantInfo, capacity, 2, false, "phuiiNCxRMg", "aespa 에스파 'Supernova' MV",
"SMTOWN");
"SMTOWN", 10.0);
Optional<User> user = Optional.of(User.builder()
.currentRoomCode("1e7050f7d7")
.build());
Expand Down Expand Up @@ -453,7 +455,7 @@ void enterPasswordRoom() throws Exception {

Participant participantInfo = new Participant(10L, "황똥땡", Role.HOST);
RoomDetail createdRoomDetail = new RoomDetail(roomCode, roomTitle, participantInfo, capacity, 2, true, "phuiiNCxRMg", "aespa 에스파 'Supernova' MV",
"SMTOWN");
"SMTOWN", 10.0);
Optional<User> user = Optional.of(User.builder()
.currentRoomCode(null)
.build());
Expand Down Expand Up @@ -483,6 +485,7 @@ void enterPasswordRoom() throws Exception {
.andExpect(jsonPath("$.data.passwordExist").value(true))
.andExpect(jsonPath("$.data.currentVideoTitle").value(createdRoomDetail.getCurrentVideoTitle()))
.andExpect(jsonPath("$.data.currentChannelTitle").value(createdRoomDetail.getCurrentChannelTitle()))
.andExpect(jsonPath("$.data.currentVideoTime").value(createdRoomDetail.getCurrentVideoTime()))
.andDo(document("enter-password-room-success",
preprocessRequest(prettyPrint()),
preprocessResponse(prettyPrint()),
Expand All @@ -505,7 +508,8 @@ void enterPasswordRoom() throws Exception {
fieldWithPath("data.passwordExist").type(JsonFieldType.BOOLEAN).description("비밀번호 존재 여부"),
fieldWithPath("data.currentVideoId").type(JsonFieldType.STRING).description("현재 재생중인 영상의 아이디").optional(),
fieldWithPath("data.currentVideoTitle").type(JsonFieldType.STRING).description("현재 재생중인 영상의 제목").optional(),
fieldWithPath("data.currentChannelTitle").type(JsonFieldType.STRING).description("현재 재생중인 영상의 채널 이름").optional()
fieldWithPath("data.currentChannelTitle").type(JsonFieldType.STRING).description("현재 재생중인 영상의 채널 이름").optional(),
fieldWithPath("data.currentVideoTime").type(JsonFieldType.NUMBER).description("현재 재생중인 영상의 재생 시간").optional()
)
));
}
Expand Down

0 comments on commit 92882a0

Please sign in to comment.