diff --git a/luoo_music/src/main/java/com/luoo/music/pojo/Comment.java b/luoo_music/src/main/java/com/luoo/music/pojo/Comment.java index 0784883..012c40b 100644 --- a/luoo_music/src/main/java/com/luoo/music/pojo/Comment.java +++ b/luoo_music/src/main/java/com/luoo/music/pojo/Comment.java @@ -1,7 +1,9 @@ package com.luoo.music.pojo; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.springframework.data.annotation.Id; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.util.Date; @@ -15,6 +17,8 @@ public class Comment implements Serializable { // 评论内容 private String content; // 发布时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date publishTime; private String userId;