Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import com.back.catchmate.domain.game.converter.GameConverter;
import com.back.catchmate.domain.game.dto.GameResponse.GameInfo;
import com.back.catchmate.domain.game.entity.Game;
import com.back.catchmate.domain.user.converter.UserConverter;
import com.back.catchmate.domain.user.dto.UserResponse;
import com.back.catchmate.domain.user.dto.UserResponse.UserInfo;
import com.back.catchmate.domain.user.entity.User;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
Expand All @@ -21,6 +24,7 @@
@RequiredArgsConstructor
public class BoardConverter {
private final GameConverter gameConverter;
private final UserConverter userConverter;

public Board toEntity(User user, Game game, Club cheerClub, CreateOrUpdateBoardRequest boardRequest) {
return Board.builder()
Expand Down Expand Up @@ -51,6 +55,7 @@ public PagedBoardInfo toPagedBoardInfoFromBoardList(Page<Board> boardList) {

public BoardInfo toBoardInfo(Board board, Game game) {
GameInfo gameInfo = gameConverter.toGameInfo(game);
UserInfo userInfo = userConverter.toUserInfo(board.getUser());

return BoardInfo.builder()
.boardId(board.getId())
Expand All @@ -61,6 +66,7 @@ public BoardInfo toBoardInfo(Board board, Game game) {
.preferredGender(board.getPreferredGender())
.preferredAgeRange(board.getPreferredAgeRange())
.gameInfo(gameInfo)
.userInfo(userInfo)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.back.catchmate.domain.board.dto;

import com.back.catchmate.domain.game.dto.GameResponse.GameInfo;
import com.back.catchmate.domain.user.dto.UserResponse;
import com.back.catchmate.domain.user.dto.UserResponse.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
Expand All @@ -24,6 +26,7 @@ public static class BoardInfo {
private String preferredGender;
private String preferredAgeRange;
private GameInfo gameInfo;
private UserInfo userInfo;
}

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class Board extends BaseTimeEntity {
@JoinColumn(name = "game_id", nullable = false)
private Game game;

@OneToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "club_id", nullable = false)
private Club club;

Expand Down
Loading