-
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.
- Loading branch information
Showing
17 changed files
with
173 additions
and
150 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
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
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
52 changes: 52 additions & 0 deletions
52
src/main/java/com/gdschongik/gdsc/domain/member/dto/response/AdminMemberResponse.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,52 @@ | ||
package com.gdschongik.gdsc.domain.member.dto.response; | ||
|
||
import com.gdschongik.gdsc.domain.member.domain.Department; | ||
import com.gdschongik.gdsc.domain.member.domain.Member; | ||
import com.gdschongik.gdsc.domain.member.domain.Requirement; | ||
import java.util.Optional; | ||
|
||
public record AdminMemberResponse( | ||
Long memberId, | ||
String studentId, | ||
String name, | ||
String phone, | ||
DepartmentDto department, | ||
String email, | ||
String discordUsername, | ||
String nickname, | ||
RequirementDto requirement) { | ||
|
||
public static AdminMemberResponse from(Member member) { | ||
return new AdminMemberResponse( | ||
member.getId(), | ||
member.getStudentId(), | ||
member.getName(), | ||
Optional.ofNullable(member.getPhone()) | ||
.map(phone -> String.format( | ||
"%s-%s-%s", phone.substring(0, 3), phone.substring(3, 7), phone.substring(7))) | ||
.orElse(null), | ||
DepartmentDto.from(member.getDepartment()), | ||
member.getEmail(), | ||
member.getDiscordUsername(), | ||
member.getNickname(), | ||
RequirementDto.from(member.getRequirement())); | ||
} | ||
|
||
record DepartmentDto(Department code, String name) { | ||
public static DepartmentDto from(Department department) { | ||
return Optional.ofNullable(department) | ||
.map(code -> new DepartmentDto(code, code.getDepartmentName())) | ||
.orElse(new DepartmentDto(null, null)); | ||
} | ||
} | ||
|
||
record RequirementDto(String univStatus, String discordStatus, String paymentStatus, String bevyStatus) { | ||
public static RequirementDto from(Requirement requirement) { | ||
return new RequirementDto( | ||
requirement.getUnivStatus().name(), | ||
requirement.getDiscordStatus().name(), | ||
requirement.getPaymentStatus().name(), | ||
requirement.getBevyStatus().name()); | ||
} | ||
} | ||
} |
33 changes: 0 additions & 33 deletions
33
src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberFindAllResponse.java
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
...ain/java/com/gdschongik/gdsc/domain/member/dto/response/MemberPaymentFindAllResponse.java
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
...ain/java/com/gdschongik/gdsc/domain/member/dto/response/MemberPendingFindAllResponse.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
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
Oops, something went wrong.