Skip to content

Commit

Permalink
Refactor: "Mapper 줄바꿈 수정"
Browse files Browse the repository at this point in the history
  • Loading branch information
tioon committed Feb 5, 2024
1 parent c3297f9 commit b523428
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public interface GameMapper {
@Mapping(target = "answer", source = "participationAnswerDto.answer")
PlayerAnswer toPlayerAnswer (Player player, ParticipationAnswerDto participationAnswerDto);


@Mappings({
@Mapping(target = "room", source = "room"),
@Mapping(target = "customQuestion", source = "customQuestionDto.question")
Expand All @@ -33,20 +32,15 @@ public interface GameMapper {




@Mappings({
@Mapping(target = "roomId", source = "room.roomId"),
@Mapping(target = "question", source = "defaultQuestion.defaultQuestion")
})
QuestionResponseDto toQuestionResponse (Room room , DefaultQuestion defaultQuestion);


QuestionResponseDto toQuestionResponse(Room room, String question);

@Mapping(target = "correctAnswer", source = "correctAnswer")
CorrectResultResponseDto toCorrectResultResponse (Integer correctAnswer);


@Mapping(target = "playerId", source = "player.playerId")
@Mapping(target = "nickName", source = "player.nickName")
ItResponseDto toItResponseDto (Player player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ public interface ParticipateMapper {
@Mapping(target = "nickName", source = "nickName")
HostResponseDto toHostResponse (Player player);


default List<ParticipationResponseDto> toParticipationResponse(List<Player> players) {
return players.stream()
.map(player -> new ParticipationResponseDto(player.getPlayerId(), player.getNickName()))
.collect(Collectors.toList());
}


@Mapping(target = "playerId", source = "player.playerId")
@Mapping(target = "nickName", source = "player.nickName")
ItResponseDto toItResponseDto (Player player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public interface QuestionMapper {




@Mappings({
@Mapping(target = "roomId", source = "room.roomId"),
@Mapping(target = "question", source = "defaultQuestion.defaultQuestion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ public interface RoomMapper {
@Mapping(target = "gameRepeat", constant = "0")
@Mapping(target = "currentRound", constant = "0")
Room toRoom(ParticipationRequestDto participationRequestDTO); // 방생성 Mapper

@Mapping(target = "room", source = "room")
@Mapping(target = "nickName", source = "participationRequestDto.nickName")
@Mapping(target = "roomOwner", constant = "true")
@Mapping(target = "correctAnswer", constant = "0")
@Mapping(target = "it", constant = "false")
Player toRoomManager(Room room , ParticipationRequestDto participationRequestDto); // 방장 참가 Mapper

@Mapping(target = "room", source = "room")
@Mapping(target = "nickName", source = "participationRequestDto.nickName")
@Mapping(target = "roomOwner", constant = "false")
Expand All @@ -33,10 +31,6 @@ public interface RoomMapper {







@Mapping(target = "roomId", source = "room.roomId")
@Mapping(target = "playerId", source = "player.playerId")
@Mapping(target = "nickName", source = "player.nickName")
Expand Down

0 comments on commit b523428

Please sign in to comment.