Skip to content

Commit

Permalink
Merge pull request #50 from 9oormthon-univ/dev
Browse files Browse the repository at this point in the history
♻️Refactor: 사용자 이름 가져오는 로직 추가
  • Loading branch information
eunxeum authored Nov 23, 2024
2 parents fc0f394 + 7ec3250 commit 06e8d60
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@
<p align="center">
<img src="https://skillicons.dev/icons?i=figma"><img src="https://skillicons.dev/icons?i=notion"><img src="https://skillicons.dev/icons?i=discord">
</p>

<br>
<br>

## 서버 플로우 동작
<p align="center">
![image](https://github.com/user-attachments/assets/2fbff691-83bb-4a19-980e-72c617ab4321)
</p>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
public record BoardInfoResDto(
Long myMemberId,
Long writerMemberId,
String writerMemberName,
Long boardId,
String title,
String content,
Expand All @@ -29,10 +30,10 @@ public static BoardInfoResDto of(Member member, Board board, boolean isLike) {
.map(BoardPicture::getImageUrl)
.toList();

// 투자하기 버튼 누른 사용자도 포함해야됨
return BoardInfoResDto.builder()
.myMemberId(member.getId())
.writerMemberId(board.getWriter().getId())
.writerMemberName(board.getWriter().getUsername())
.boardId(board.getBoardId())
.title(board.getTitle())
.content(board.getContent())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public List<BoardInfoResDto> allBoardInfoBySummitId(Long summitId, Long memberId
List<Board> boards = boardRepository.findBySummitId(summitId);
Member member = memberId != null ? memberRepository.findById(memberId).orElse(null) : null; // memberId로 member 조회
return boards.stream()
.map(board -> BoardInfoResDto.of(member, board, false)) // member 정보를 전달
.map(board -> BoardInfoResDto.of(board.getWriter(), board, false)) // member 정보를 전달
.collect(Collectors.toList());
}

Expand Down

0 comments on commit 06e8d60

Please sign in to comment.