package com.zhujizheng.IHome.generator.dao; import com.github.binarywang.java.emoji.EmojiConverter; import com.vdurmont.emoji.EmojiParser; import com.zhujizheng.IHome.everymoment.dto.PYEveryMomentCommentDTO; import lombok.Data; import java.util.Date; @Data public class PYEveryMomentComment { /** 评论的id **/ private Integer id; /** 评论相关动态的id **/ private Integer emId; /** 评论者的用户id **/ private Integer fromUserId; /** 被评论者的用户id **/ private Integer toUserId; /** 评论的内容 **/ private String comment; /** 评论的时间戳,单位为毫秒 **/ private Long commentTime; /** 是否需要解密 **/ private Boolean needDecode; private Date createTime; private Date updateTime; private String createUser; private String updateUser; private Boolean isDelete; public static PYEveryMomentComment createComment(PYEveryMomentCommentDTO commentDTO) { System.out.println("commentDTO = " + commentDTO); if (commentDTO == null) { return null; } PYEveryMomentComment comment = new PYEveryMomentComment(); comment.setEmId(commentDTO.getEmId()); comment.setFromUserId(commentDTO.getFromUserId()); comment.setToUserId(commentDTO.getToUserId()); String commentAlias = EmojiConverter.getInstance().toAlias(commentDTO.getComment()); System.out.println("commentAlias = " + commentAlias); comment.setComment(commentAlias); comment.setCommentTime(commentDTO.getCommentTime()); comment.setNeedDecode(commentDTO.getNeedDecode()); System.out.println("comment = " + comment); return comment; } }