Skip to content

Commit

Permalink
[BE] API 명세 변경에 따른 수정 (#1041)
Browse files Browse the repository at this point in the history
* [BE] 페어룸 입장 시 발생되는 하위 정보 한 API로 병합 (#1034)

* refactor: 컨벤션 위반 패키지 구조 수정

* refactor: 컨벤션 위반 패키지 구조 수정

* feat: 페어룸 조회시 todo, category, referenceLink, timer 연관 객체 정보 함께 서빙

* docs: 문서화 오류 및 변경에 따른 수정

* [BE] API 명세 수정에 따른 응답 페이로드 변경  (#1039)

* refactor: 컨벤션 위반 패키지 구조 수정

* refactor: 컨벤션 위반 패키지 구조 수정

* feat: 페어룸 조회시 todo, category, referenceLink, timer 연관 객체 정보 함께 서빙

* docs: 문서화 오류 및 변경에 따른 수정

* fix: api 명세 변경에 따른 응답 속성 변경

* fix: api 명세 변경에 따른 응답 속성 변경
  • Loading branch information
koust6u authored Jan 13, 2025
1 parent e3f17e0 commit ca0716f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,49 @@

import java.util.List;

import io.swagger.v3.oas.annotations.media.Schema;

import site.coduo.referencelink.service.dto.CategoryReadResponse;
import site.coduo.referencelink.service.dto.ReferenceLinkResponse;
import site.coduo.todo.service.dto.TodoReadResponse;

public record PairRoomEntireResponse(
PairRoomReadResponse pairRoomInfo,
List<TodoReadResponse> todoInfo,
List<CategoryReadResponse> categoryInfo,
List<ReferenceLinkResponse> referenceInfo) {

@Schema(description = "첫 번째 페어의 이름", example = "해시")
String navigator,

@Schema(description = "두 번째 페어의 이름", example = "파슬리")
String driver,

@Schema(description = "페어룸의 상태", example = "IN_PROGRESS")
String status,

@Schema(description = "타이머 시간 (millisecond 기준)", example = "10000")
long duration,

@Schema(description = "타이머 남은 시간 (millisecond 기준)", example = "5000")
long remainingTime,

@Schema(description = "미션 리포지토리 링크", example = "https://github.com/coduo-missions/coduo-javascript-rps")
String missionUrl,

@Schema(description = "생성된 투두 응답 목록")
List<TodoReadResponse> todos,

@Schema(description = "생성된 카테고르 응답 목록")
List<CategoryReadResponse> categories,

@Schema(description = "생성된 레퍼런스 링크 목록")
List<ReferenceLinkResponse> references) {

public static PairRoomEntireResponse of(
PairRoomReadResponse pairRoomReadResponse,
List<TodoReadResponse> todoResponses,
List<CategoryReadResponse> categoryReadResponses,
List<ReferenceLinkResponse> referenceLinkResponses
) {
return new PairRoomEntireResponse(pairRoomReadResponse, todoResponses, categoryReadResponses,
referenceLinkResponses);
return new PairRoomEntireResponse(pairRoomReadResponse.navigator(), pairRoomReadResponse.driver(),
pairRoomReadResponse.status(), pairRoomReadResponse.duration(), pairRoomReadResponse.remainingTime(),
pairRoomReadResponse.missionUrl(), todoResponses, categoryReadResponses, referenceLinkResponses);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void update_pair_room_status() {
pairRoomService.updatePairRoomStatus(accessCode, PairRoomStatus.COMPLETED.name());

// then
assertThat(PairRoomStatus.findByName(pairRoomService.findEntirePairRoom(accessCode).pairRoomInfo().status()))
assertThat(PairRoomStatus.findByName(pairRoomService.findEntirePairRoom(accessCode).status()))
.isEqualTo(PairRoomStatus.COMPLETED);
}

Expand Down Expand Up @@ -263,8 +263,8 @@ void get_pair_room_and_timer() {

// then
assertThat(actual)
.extracting("pairRoomInfo.navigator", "pairRoomInfo.driver", "pairRoomInfo.status",
"pairRoomInfo.duration", "pairRoomInfo.remainingTime")
.extracting("navigator", "driver", "status",
"duration", "remainingTime")
.contains(pairRoomEntity.getNavigator(), pairRoomEntity.getDriver(),
pairRoomEntity.getStatus().toString(), timer.getDuration(), timer.getRemainingTime());
}
Expand Down

0 comments on commit ca0716f

Please sign in to comment.