时间类型序列化:
注意红色代码,必须引入fastjson的JSONField类,而非其它。
import com.alibaba.fastjson.annotation.JSONField;@Entity@Table(name="User")public class User{ @Id @Column(name = "id") @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @JSONField (format="yyyy-MM-dd HH:mm:ss") public Date createTime; }