出参,入参格式化

**@DateTimeFormat(pattern="yyyy-MM-dd")//页面写入数据库时格式化 **
**@JSONField(format="yyyy-MM-dd")//数据库导出页面时json格式化 **

  public class User implements Serializable{
      private Integer id;
      private String loginname;
      private String password;
      private Integer status;
      @DateTimeFormat(pattern="yyyy-MM-dd")//页面写入数据库时格式化
      @JSONField(format="yyyy-MM-dd")//数据库导出页面时json格式化
      private Date createdate;
      private String username;
     //getter And setter..... }

原文地址:https://www.cnblogs.com/xiaolaodi1999/p/13523354.html