-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OING-381] refact: Comment, VoiceComment 및 댓글 조회 로직 리팩터링 (#279)
* feat: add BaseComment * refact: refactor Comment and VoiceComment entity * refact: refactor getPostComments logic * fix: add missing field's value * refact: delete audioUrl field in Response
- Loading branch information
Showing
7 changed files
with
52 additions
and
60 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.oing.domain; | ||
|
||
import jakarta.persistence.MappedSuperclass; | ||
|
||
import java.util.Comparator; | ||
|
||
@MappedSuperclass | ||
public abstract class BaseComment extends BaseAuditEntity { | ||
public abstract String getContent(); | ||
public abstract String getMemberId(); | ||
public abstract String getId(); | ||
|
||
public static Comparator<BaseComment> getComparator(String sort) { | ||
if (sort == null || sort.equalsIgnoreCase("ASC")) { | ||
return Comparator.comparing(BaseComment::getCreatedAt); | ||
} else { | ||
return Comparator.comparing(BaseComment::getCreatedAt).reversed(); | ||
} | ||
} | ||
} |
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