Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] 현재 행사에 참여 중인 참여자 목록 조회 API 응답 형식 수정 #361

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import java.util.List;
import server.haengdong.application.response.CurrentMemberAppResponse;

public record CurrentMembersResponse(List<CurrentMemberResponse> members) {
public record CurrentMembersResponse(List<String> memberNames) {

public static CurrentMembersResponse of(List<CurrentMemberAppResponse> currentMembers) {
List<CurrentMemberResponse> responses = currentMembers.stream()
.map(CurrentMemberResponse::of)
List<String> responses = currentMembers.stream()
.map(CurrentMemberAppResponse::name)
.toList();

return new CurrentMembersResponse(responses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ void getCurrentMembers() throws Exception {
.accept(MediaType.APPLICATION_JSON))
.andDo(print())
.andExpect(status().isOk())
.andExpect(jsonPath("$.members[0].name").value(equalTo("소하")))
.andExpect(jsonPath("$.members[1].name").value(equalTo("토다리")))
.andExpect(jsonPath("$.memberNames[0]").value(equalTo("소하")))
.andExpect(jsonPath("$.memberNames[1]").value(equalTo("토다리")))
.andDo(
document("getCurrentMembers",
preprocessRequest(prettyPrint()),
Expand All @@ -98,10 +98,8 @@ void getCurrentMembers() throws Exception {
parameterWithName("eventId").description("행사 ID")
),
responseFields(
fieldWithPath("members").type(JsonFieldType.ARRAY)
.description("액션 대상 참여자 목록"),
fieldWithPath("members[0].name").type(JsonFieldType.STRING)
.description("참여자 이름")
fieldWithPath("memberNames").type(JsonFieldType.ARRAY)
.description("현재 탈주 가능한 참여 인원 이름 목록")
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ void getCurrentMembers() throws Exception {
.accept(MediaType.APPLICATION_JSON))
.andDo(print())
.andExpect(status().isOk())
.andExpect(jsonPath("$.members[0].name").value(equalTo("소하")))
.andExpect(jsonPath("$.members[1].name").value(equalTo("토다리")));
.andExpect(jsonPath("$.memberNames[0]").value(equalTo("소하")))
.andExpect(jsonPath("$.memberNames[1]").value(equalTo("토다리")));
}

@DisplayName("이벤트에 속한 멤버 액션을 삭제하면 이후에 기록된 해당 참여자의 모든 멤버 액션을 삭제한다.")
Expand Down
Loading