-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DDING-66] ClubMember 목록 조회 API 응답값 변경 (#201)
- Loading branch information
Showing
8 changed files
with
84 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
.../ddingdong/ddingdongBE/domain/club/controller/dto/response/AllClubMemberInfoResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package ddingdong.ddingdongBE.domain.club.controller.dto.response; | ||
|
||
import ddingdong.ddingdongBE.domain.clubmember.entity.ClubMember; | ||
import ddingdong.ddingdongBE.domain.clubmember.service.dto.query.AllClubMemberInfoQuery; | ||
import io.swagger.v3.oas.annotations.media.ArraySchema; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.List; | ||
|
||
public record AllClubMemberInfoResponse( | ||
@Schema(name = "동아리명", example = "COW") | ||
String clubName, | ||
@ArraySchema(schema = @Schema(implementation = ClubMemberListResponse.class)) | ||
List<ClubMemberListResponse> clubMembers | ||
) { | ||
|
||
public static AllClubMemberInfoResponse from(AllClubMemberInfoQuery query) { | ||
List<ClubMemberListResponse> responses = query.clubMembers().stream() | ||
.map(ClubMemberListResponse::from) | ||
.toList(); | ||
return new AllClubMemberInfoResponse(query.clubName(), responses); | ||
} | ||
|
||
@Schema( | ||
name = "ClubMemberResponse", | ||
description = "중앙동아리 - 동아리원 조회 응답" | ||
) | ||
record ClubMemberListResponse( | ||
@Schema(description = "식별자", example = "1") | ||
Long id, | ||
@Schema(description = "이름", example = "홍길동") | ||
String name, | ||
@Schema(description = "학번", example = "60001111") | ||
String studentNumber, | ||
@Schema(description = "전화번호", example = "010-1234-5678") | ||
String phoneNumber, | ||
@Schema(description = "동아리원 역할", | ||
example = "LEADER", | ||
allowableValues = {"LEADER", "EXECUTION", "MEMBER"} | ||
) | ||
String position, | ||
@Schema(description = "학과", example = "학과") | ||
String department | ||
) { | ||
|
||
public static ClubMemberListResponse from(ClubMember clubMember) { | ||
return new ClubMemberListResponse( | ||
clubMember.getId(), | ||
clubMember.getName(), | ||
clubMember.getStudentNumber(), | ||
clubMember.getPhoneNumber(), | ||
clubMember.getPosition().getName(), | ||
clubMember.getDepartment() | ||
); | ||
} | ||
|
||
} | ||
} |
39 changes: 0 additions & 39 deletions
39
...ngdong/ddingdongBE/domain/club/controller/dto/response/CentralClubMemberListResponse.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...ava/ddingdong/ddingdongBE/domain/clubmember/service/dto/query/AllClubMemberInfoQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package ddingdong.ddingdongBE.domain.clubmember.service.dto.query; | ||
|
||
import ddingdong.ddingdongBE.domain.clubmember.entity.ClubMember; | ||
import java.util.List; | ||
|
||
public record AllClubMemberInfoQuery( | ||
String clubName, | ||
List<ClubMember> clubMembers | ||
) { | ||
|
||
public static AllClubMemberInfoQuery of(String clubName, List<ClubMember> clubMembers) { | ||
return new AllClubMemberInfoQuery(clubName, clubMembers); | ||
} | ||
} |
25 changes: 0 additions & 25 deletions
25
...ddingdong/ddingdongBE/domain/clubmember/service/dto/query/CentralClubMemberListQuery.java
This file was deleted.
Oops, something went wrong.