-
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.
Browse files
Browse the repository at this point in the history
[FEAT] 대댓글 목록 조회 및 삭제 API 구현
- Loading branch information
Showing
6 changed files
with
219 additions
and
9 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
42 changes: 42 additions & 0 deletions
42
...com/wable/www/WableServer/api/comment/dto/response/CommentAllByMemberResponseDtoVer3.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,42 @@ | ||
package com.wable.www.WableServer.api.comment.dto.response; | ||
|
||
import com.wable.www.WableServer.api.comment.domain.Comment; | ||
import com.wable.www.WableServer.api.member.domain.Member; | ||
import com.wable.www.WableServer.common.util.TimeUtilCustom; | ||
|
||
public record CommentAllByMemberResponseDtoVer3( | ||
long memberId, // 답글 작성자 Id | ||
String memberProfileUrl, // 작성자 프로필 사진url | ||
String memberNickname, // 답글 작성자 닉네임 | ||
Boolean isLiked, // 유저가 답글에 대해 좋아요를 눌렀는지 | ||
Boolean isGhost, //답글 작성자를 투명도 처리 했는지 | ||
int memberGhost, // 답글 작성자의 전체 투명도 | ||
int commentLikedNumber, // 답글 좋아요 개수 | ||
String commentText, // 답글 내용 | ||
String time, //답글이 작성된 시간 (년-월-일 시:분:초) | ||
long commentId, //댓글 Id | ||
long contentId , // 해당 댓글이 적힌 게시물 Id | ||
String commentImageUrl, | ||
String memberFanTeam, | ||
Boolean isBlind | ||
) { | ||
public static CommentAllByMemberResponseDtoVer3 of(Member writerMember, boolean isLiked, boolean isGhost, | ||
int memberGhost, int commentLikedNumber, Comment comment){ | ||
return new CommentAllByMemberResponseDtoVer3( | ||
writerMember.getId() , | ||
writerMember.getProfileUrl(), | ||
writerMember.getNickname(), | ||
isLiked, | ||
isGhost, | ||
memberGhost, | ||
commentLikedNumber, | ||
comment.getCommentText(), | ||
TimeUtilCustom.refineTime(comment.getCreatedAt()), | ||
comment.getId(), | ||
comment.getContent().getId(), | ||
comment.getCommentImage(), | ||
writerMember.getMemberFanTeam(), | ||
comment.isBlind() | ||
); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...in/java/com/wable/www/WableServer/api/comment/dto/response/CommentAllResponseDtoVer4.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,50 @@ | ||
package com.wable.www.WableServer.api.comment.dto.response; | ||
|
||
import com.wable.www.WableServer.api.member.domain.Member; | ||
|
||
import java.util.List; | ||
|
||
public record CommentAllResponseDtoVer4( | ||
Long commentId, //답글 고유 id | ||
Long memberId, // 댓글 작성자 Id | ||
String memberProfileUrl, //작성자 프로필 사진url | ||
String memberNickname, //댓글 작성자 닉네임 | ||
Boolean isGhost, //현재 유저가 작성자에 대해 투명도 처리를 했는지 | ||
int memberGhost, //작성자의 전체 투명도 | ||
Boolean isLiked, //유저가 게시물에 대해 좋아요를 눌렀는지 | ||
int commentLikedNumber, //댓글의 좋아요 개수 | ||
String commentText, //댓글 내용 | ||
String time, //답글이 작성된 시간을 (년-월-일 시:분:초) | ||
Boolean isDeleted, // 댓글 작성자가 탈퇴한 회원인지 아닌지 | ||
String commentImageUrl, | ||
String memberFanTeam, | ||
Long parentCommentId, | ||
Boolean isBlind, | ||
List<CommentAllResponseDtoVer4> childComments // 대댓글 리스트 추가 | ||
|
||
) { | ||
public static CommentAllResponseDtoVer4 of( | ||
Long commentId, Member writerMember, boolean isGhost, int memberGhost, | ||
boolean isLiked, String time, int likedNumber, String commentText, | ||
String commentImageUrl,Long parentCommentId, Boolean isBlind, List<CommentAllResponseDtoVer4> childComments | ||
) { | ||
return new CommentAllResponseDtoVer4( | ||
commentId, | ||
writerMember.getId(), | ||
writerMember.getProfileUrl(), | ||
writerMember.getNickname(), | ||
isGhost, | ||
memberGhost, | ||
isLiked, | ||
likedNumber, | ||
commentText, | ||
time, | ||
writerMember.isDeleted(), | ||
commentImageUrl, | ||
writerMember.getMemberFanTeam(), | ||
parentCommentId, | ||
isBlind, | ||
childComments | ||
); | ||
} | ||
} |
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
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