-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor : 게시글 이모지와 댓글 좋아요 누르기/취소하기 API 응답 DTO 반환하도록 수정 (#635)
- Loading branch information
1 parent
ba19038
commit 3dd26a8
Showing
11 changed files
with
90 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...java/page/clab/api/domain/community/board/application/dto/mapper/BoardEmojiDtoMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package page.clab.api.domain.community.board.application.dto.mapper; | ||
|
||
import org.springframework.stereotype.Component; | ||
import page.clab.api.domain.community.board.application.dto.response.BoardEmojiToggleResponseDto; | ||
import page.clab.api.domain.community.board.domain.BoardEmoji; | ||
|
||
@Component | ||
public class BoardEmojiDtoMapper { | ||
|
||
public BoardEmojiToggleResponseDto toDto(BoardEmoji boardEmoji) { | ||
return BoardEmojiToggleResponseDto.builder() | ||
.boardId(boardEmoji.getBoardId()) | ||
.emoji(boardEmoji.getEmoji()) | ||
.isDeleted(boardEmoji.getIsDeleted()) | ||
.build(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...clab/api/domain/community/board/application/dto/response/BoardEmojiToggleResponseDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package page.clab.api.domain.community.board.application.dto.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class BoardEmojiToggleResponseDto { | ||
|
||
private Long boardId; | ||
private String emoji; | ||
private Boolean isDeleted; | ||
} |
4 changes: 3 additions & 1 deletion
4
...ava/page/clab/api/domain/community/board/application/port/in/ToggleBoardEmojiUseCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package page.clab.api.domain.community.board.application.port.in; | ||
|
||
import page.clab.api.domain.community.board.application.dto.response.BoardEmojiToggleResponseDto; | ||
|
||
public interface ToggleBoardEmojiUseCase { | ||
String toggleEmojiStatus(Long boardId, String emoji); | ||
BoardEmojiToggleResponseDto toggleEmojiStatus(Long boardId, String emoji); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...a/page/clab/api/domain/community/comment/application/dto/mapper/CommentLikeDtoMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package page.clab.api.domain.community.comment.application.dto.mapper; | ||
|
||
import org.springframework.stereotype.Component; | ||
import page.clab.api.domain.community.comment.application.dto.response.CommentLikeToggleResponseDto; | ||
|
||
@Component | ||
public class CommentLikeDtoMapper { | ||
|
||
public CommentLikeToggleResponseDto of(Long boardId, Long commentLikes, Boolean isDeleted) { | ||
return CommentLikeToggleResponseDto.builder() | ||
.boardId(boardId) | ||
.likes(commentLikes) | ||
.isDeleted(isDeleted) | ||
.build(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...b/api/domain/community/comment/application/dto/response/CommentLikeToggleResponseDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package page.clab.api.domain.community.comment.application.dto.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
public class CommentLikeToggleResponseDto { | ||
|
||
private Long boardId; | ||
private Long likes; | ||
private Boolean isDeleted; | ||
} |
4 changes: 3 additions & 1 deletion
4
.../page/clab/api/domain/community/comment/application/port/in/ToggleCommentLikeUseCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package page.clab.api.domain.community.comment.application.port.in; | ||
|
||
import page.clab.api.domain.community.comment.application.dto.response.CommentLikeToggleResponseDto; | ||
|
||
public interface ToggleCommentLikeUseCase { | ||
Long toggleLikeStatus(Long commentId); | ||
CommentLikeToggleResponseDto toggleLikeStatus(Long commentId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters