-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from Team-Going/feature/134
[feat] 개별 프로필 조회 API 구현
- Loading branch information
Showing
3 changed files
with
69 additions
and
4 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
35 changes: 35 additions & 0 deletions
35
doorip-api/src/main/java/org/doorip/trip/dto/response/TripParticipantProfileResponse.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,35 @@ | ||
package org.doorip.trip.dto.response; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import org.doorip.trip.domain.Participant; | ||
import org.doorip.user.domain.User; | ||
|
||
@Builder(access = AccessLevel.PRIVATE) | ||
public record TripParticipantProfileResponse( | ||
String name, | ||
String intro, | ||
int result, | ||
int styleA, | ||
int styleB, | ||
int styleC, | ||
int styleD, | ||
int styleE, | ||
boolean isOwner | ||
|
||
) { | ||
|
||
public static TripParticipantProfileResponse of(User user, int validatedResult, Participant participant, boolean isOwner) { | ||
return TripParticipantProfileResponse.builder() | ||
.name(user.getName()) | ||
.intro(user.getIntro()) | ||
.result(validatedResult) | ||
.styleA(participant.getStyleA()) | ||
.styleB(participant.getStyleB()) | ||
.styleC(participant.getStyleC()) | ||
.styleD(participant.getStyleD()) | ||
.styleE(participant.getStyleE()) | ||
.isOwner(isOwner) | ||
.build(); | ||
} | ||
} |
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