-
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.
๐ฅ[FEAT]-#4-Member ์ ๊ฒฐ๊ณผ ์กฐํ
## ๊ฐ์ /my/result
- Loading branch information
1 parent
36baa71
commit 388808e
Showing
6 changed files
with
65 additions
and
1 deletion.
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
16 changes: 16 additions & 0 deletions
16
...ava/com/codingwasabi/trti/domain/member/model/response/ResponseMemberDetailResultDto.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,16 @@ | ||
package com.codingwasabi.trti.domain.member.model.response; | ||
|
||
import com.codingwasabi.trti.domain.result.model.values.AnswerType; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class ResponseMemberDetailResultDto { | ||
private Long id; | ||
private Integer selected; | ||
|
||
public static ResponseMemberDetailResultDto from(AnswerType answerType) { | ||
return new ResponseMemberDetailResultDto(answerType.getId(), answerType.getSelected()); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...main/java/com/codingwasabi/trti/domain/member/model/response/ResponseMemberResultDto.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,32 @@ | ||
package com.codingwasabi.trti.domain.member.model.response; | ||
|
||
import com.codingwasabi.trti.domain.member.model.entity.Member; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class ResponseMemberResultDto { | ||
private String name; | ||
private List<ResponseMemberDetailResultDto> answer; | ||
|
||
public static ResponseMemberResultDto from(Member member) { | ||
return new ResponseMemberResultDto(member.getNickname(), getDetailResult(member)); | ||
} | ||
|
||
private static List<ResponseMemberDetailResultDto> getDetailResult(Member member) { | ||
List<ResponseMemberDetailResultDto> resultList = new ArrayList<>(); | ||
resultList.add(ResponseMemberDetailResultDto.from(member.getResult().getToMove())); | ||
resultList.add(ResponseMemberDetailResultDto.from(member.getResult().getToEat_1())); | ||
resultList.add(ResponseMemberDetailResultDto.from(member.getResult().getToEat_2())); | ||
resultList.add(ResponseMemberDetailResultDto.from(member.getResult().getToStay_1())); | ||
resultList.add(ResponseMemberDetailResultDto.from(member.getResult().getToStay_2())); | ||
resultList.add(ResponseMemberDetailResultDto.from(member.getResult().getToStay_3())); | ||
resultList.add(ResponseMemberDetailResultDto.from(member.getResult().getToActive())); | ||
|
||
return resultList; | ||
} | ||
} |
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