forked from halo-dev/halo
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for fetching replies alongside comment list (halo-d…
…ev#5505) #### What type of PR is this? /kind feature /area core /milestone 2.14.x /kind api-change #### What this PR does / why we need it: 主题端评论列表支持同时获得评论数据 Resolves halo-dev#5435 #### Does this PR introduce a user-facing change? ```release-note 主题端评论列表支持同时获得评论数据 ```
- Loading branch information
Showing
5 changed files
with
85 additions
and
10 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
31 changes: 31 additions & 0 deletions
31
application/src/main/java/run/halo/app/theme/finders/vo/CommentWithReplyVo.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,31 @@ | ||
package run.halo.app.theme.finders.vo; | ||
|
||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.experimental.Accessors; | ||
import org.springframework.beans.BeanUtils; | ||
import run.halo.app.extension.ListResult; | ||
|
||
/** | ||
* <p>A value object for comment with reply.</p> | ||
* | ||
* @author guqing | ||
* @since 2.14.0 | ||
*/ | ||
@Data | ||
@Accessors(chain = true) | ||
@EqualsAndHashCode(callSuper = true) | ||
public class CommentWithReplyVo extends CommentVo { | ||
|
||
private ListResult<ReplyVo> replies; | ||
|
||
/** | ||
* Convert {@link CommentVo} to {@link CommentWithReplyVo}. | ||
*/ | ||
public static CommentWithReplyVo from(CommentVo commentVo) { | ||
var commentWithReply = new CommentWithReplyVo(); | ||
BeanUtils.copyProperties(commentVo, commentWithReply); | ||
commentWithReply.setReplies(ListResult.emptyResult()); | ||
return commentWithReply; | ||
} | ||
} |