📄 comment.java
字号:
package org.whatisjava.dang.domain;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
public class Comment implements java.io.Serializable {
private static final long serialVersionUID = 7776855353115606428L;
private Integer id;
private Integer productId;
// private Integer userId;
private User user;
private String commentTitle;
private String commentContent;
private Long commentTime;
private List<CommentReply> replies;
// Constructors
/** default constructor */
public Comment() {
}
// Property accessors
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getProductId() {
return this.productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public String getCommentTitle() {
return this.commentTitle;
}
public void setCommentTitle(String commentTitle) {
this.commentTitle = commentTitle;
}
public String getCommentContent() {
return this.commentContent;
}
public void setCommentContent(String commentContent) {
this.commentContent = commentContent;
}
public Long getCommentTime() {
return this.commentTime;
}
private static final DateFormat format;
static{
format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
format.setTimeZone(TimeZone.getTimeZone("UTC"));
}
public String getCommentDate(){
return format.format(new Date(commentTime));
}
public void setCommentTime(Long commentTime) {
this.commentTime = commentTime;
}
public List<CommentReply> getReplies() {
return replies;
}
public void setReplies(List<CommentReply> replies) {
this.replies = replies;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -