Skip to content

Commit

Permalink
Merge pull request #172 from Modagbul/feat/alarm_minsu
Browse files Browse the repository at this point in the history
feat: 게시글 전체 조회에서 작성자 id 추가
  • Loading branch information
minsu20 authored Dec 28, 2023
2 parents 99da5d3 + afecf96 commit 6c020f3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ public class BoardBlocks {

private boolean isNotice;

private Long makerId;


@QueryProjection
public BoardBlocks(Long boardId, String writerNickName, Boolean writerIsLeader, String writerProfileImage, String title, String content, Integer commentNum, Boolean writerIsDeleted, boolean isNotice) {
public BoardBlocks(Long boardId, String writerNickName, Boolean writerIsLeader, String writerProfileImage, String title, String content, Integer commentNum, Boolean writerIsDeleted, boolean isNotice, Long makerId) {
this.boardId = boardId;
this.writerNickName = writerNickName;
this.writerIsLeader = writerIsLeader;
Expand All @@ -43,6 +45,7 @@ public BoardBlocks(Long boardId, String writerNickName, Boolean writerIsLeader,
this.isRead = false;
this.writerIsDeleted=writerIsDeleted;
this.isNotice=isNotice;
this.makerId = makerId;
deleteMember();
}

Expand All @@ -58,6 +61,7 @@ public void deleteMember() {
if(Boolean.TRUE.equals(writerIsDeleted)) {
this.writerNickName = "(알 수 없음)";
this.writerProfileImage = null;
this.makerId = null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public GetAllBoardResponse findBoardAll(Long teamId, Long memberId) {
board.content,
board.commentNum,
board.teamMember.isDeleted,
board.isNotice
board.isNotice,
board.teamMember.member.memberId
))
.from(board)
.leftJoin(board.teamMember, teamMember)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ public void get_board_all() throws Exception {
.commentNum(2)
.isRead(false)
.isNotice(true)
.makerId(1L)
.build();

BoardBlocks notNoticeBlock = BoardBlocks.builder()
Expand All @@ -213,6 +214,7 @@ public void get_board_all() throws Exception {
.commentNum(2)
.isRead(false)
.isNotice(false)
.makerId(1L)
.build();

noticeBlocks.add(noticeBlock);
Expand Down Expand Up @@ -246,27 +248,29 @@ public void get_board_all() throws Exception {
fieldWithPath("isSuccess").description("true"),
fieldWithPath("message").description("게시글 목록을 모두 조회했습니다."),
fieldWithPath("data.noticeNum").description("공지 개수"),
fieldWithPath("data.noticeBlocks[0].boardId").description("공지 아이디"),
fieldWithPath("data.noticeBlocks[0].writerNickName").description("작성자 닉네임"),
fieldWithPath("data.noticeBlocks[0].writerIsLeader").description("작성자 소모임장 여부"),
fieldWithPath("data.noticeBlocks[0].writerProfileImage").description("작성자 프로필 이미지"),
fieldWithPath("data.noticeBlocks[0].writerIsDeleted").description("작성자 삭제 여부"),
fieldWithPath("data.noticeBlocks[0].title").description("공지 제목"),
fieldWithPath("data.noticeBlocks[0].content").description("공지 내용"),
fieldWithPath("data.noticeBlocks[0].commentNum").description("공지 댓글 개수"),
fieldWithPath("data.noticeBlocks[0].isRead").description("공지 읽음 처리 여부"),
fieldWithPath("data.noticeBlocks[0].notice").description("true"),
fieldWithPath("data.noticeBlocks[].boardId").description("공지 아이디"),
fieldWithPath("data.noticeBlocks[].writerNickName").description("작성자 닉네임"),
fieldWithPath("data.noticeBlocks[].writerIsLeader").description("작성자 소모임장 여부"),
fieldWithPath("data.noticeBlocks[].writerProfileImage").description("작성자 프로필 이미지"),
fieldWithPath("data.noticeBlocks[].writerIsDeleted").description("작성자 삭제 여부"),
fieldWithPath("data.noticeBlocks[].title").description("공지 제목"),
fieldWithPath("data.noticeBlocks[].content").description("공지 내용"),
fieldWithPath("data.noticeBlocks[].commentNum").description("공지 댓글 개수"),
fieldWithPath("data.noticeBlocks[].isRead").description("공지 읽음 처리 여부"),
fieldWithPath("data.noticeBlocks[].notice").description("true"),
fieldWithPath("data.noticeBlocks[].makerId").description("작성자 Id"),
fieldWithPath("data.notNoticeNum").description("일반 게시글 개수"),
fieldWithPath("data.notNoticeBlocks[0].boardId").description("일반 게시글 아이디"),
fieldWithPath("data.notNoticeBlocks[0].writerNickName").description("작성자 닉네임"),
fieldWithPath("data.notNoticeBlocks[0].writerIsLeader").description("작성자 소모임장 여부"),
fieldWithPath("data.notNoticeBlocks[0].writerProfileImage").description("작성자 프로필 이미지"),
fieldWithPath("data.notNoticeBlocks[0].writerIsDeleted").description("작성자 삭제 여부"),
fieldWithPath("data.notNoticeBlocks[0].title").description("일반 게시글 제목"),
fieldWithPath("data.notNoticeBlocks[0].content").description("일반 게시글 내용"),
fieldWithPath("data.notNoticeBlocks[0].commentNum").description("일반 게시글 댓글 개수"),
fieldWithPath("data.notNoticeBlocks[0].isRead").description("일반 게시글 읽음 처리 여부"),
fieldWithPath("data.notNoticeBlocks[0].notice").description("false")
fieldWithPath("data.notNoticeBlocks[].boardId").description("일반 게시글 아이디"),
fieldWithPath("data.notNoticeBlocks[].writerNickName").description("작성자 닉네임"),
fieldWithPath("data.notNoticeBlocks[].writerIsLeader").description("작성자 소모임장 여부"),
fieldWithPath("data.notNoticeBlocks[].writerProfileImage").description("작성자 프로필 이미지"),
fieldWithPath("data.notNoticeBlocks[].writerIsDeleted").description("작성자 삭제 여부"),
fieldWithPath("data.notNoticeBlocks[].title").description("일반 게시글 제목"),
fieldWithPath("data.notNoticeBlocks[].content").description("일반 게시글 내용"),
fieldWithPath("data.notNoticeBlocks[].commentNum").description("일반 게시글 댓글 개수"),
fieldWithPath("data.notNoticeBlocks[].isRead").description("일반 게시글 읽음 처리 여부"),
fieldWithPath("data.notNoticeBlocks[].notice").description("false"),
fieldWithPath("data.notNoticeBlocks[].makerId").description("작성자 Id")
)

)
Expand Down

0 comments on commit 6c020f3

Please sign in to comment.