package cn.reghao.tnb.search.app.comment.model.vo;

import cn.reghao.tnb.search.app.comment.model.po.UserComment;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author reghao
 * @date 2022-06-15 09:58:19
 */
@Setter
@Getter
public class UserReply implements Serializable {
    private static final long serialVersionUID = 1L;

    private Long id;
    private String content;
    private Integer likes;
    private Long createAt;
    private List<UserReply> children;
    private Long total;
    private ReplyUser user;
    private Long targetId;
    private String targetUsername;

    private String reply;
    private String imgSrc;
    private Boolean liked;

    public UserReply(UserComment userComment) {
        this.id = userComment.getCommentId();
        this.content = userComment.getContent();
        this.likes = userComment.getLikes();
        this.createAt = userComment.getPublishAt();
        this.children = new ArrayList<>();
        this.total = 0L;
        this.targetId = userComment.getTargetId();
        this.targetUsername = userComment.getTargetUsername();
    }
}
