Skip to content

Commit

Permalink
refactor : 게시글 이모지 누르기/취소하기 api 응답에서 board category 추가 (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingmingmon authored Dec 21, 2024
1 parent 3dd26a8 commit ec1ecda
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
@Component
public class BoardEmojiDtoMapper {

public BoardEmojiToggleResponseDto toDto(BoardEmoji boardEmoji) {
public BoardEmojiToggleResponseDto toDto(BoardEmoji boardEmoji, String category) {
return BoardEmojiToggleResponseDto.builder()
.boardId(boardEmoji.getBoardId())
.category(category)
.emoji(boardEmoji.getEmoji())
.isDeleted(boardEmoji.getIsDeleted())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class BoardEmojiToggleResponseDto {

private Long boardId;
private String category;
private String emoji;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ public BoardEmojiToggleResponseDto toggleEmojiStatus(Long boardId, String emoji)
})
.orElseGet(() -> BoardEmoji.create(memberId, boardId, emoji));
registerBoardEmojiPort.save(boardEmoji);
return mapper.toDto(boardEmoji);
return mapper.toDto(boardEmoji, board.getCategory().getKey());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public enum BoardCategory {

NOTICE("notice", "공지사항"),
FREE("free", "자유 게시판"),
DEVELOPMENT_QNA("development_qna", "개발 질문 게시판"),
INFORMATION_REVIEWS("information_reviews", "정보 및 후기 게시판"),
DEVELOPMENT_QNA("developmentQna", "개발 질문 게시판"),
INFORMATION_REVIEWS("informationReviews", "정보 및 후기 게시판"),
ORGANIZATION("organization", "동아리 소식");

private final String key;
Expand Down

0 comments on commit ec1ecda

Please sign in to comment.