Time type serialization:
Note the red code, the JSONField class of fastjson must be introduced, not others.
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; }
The above is the detailed content of Spring MVC+Fastjson time type serialization. For more information, please follow other related articles on the PHP Chinese website!