import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Date;
public class UserPojo {
private Integer id;
private String userName;
//忽略该属性,不展示
@JsonIgnore
private String passWord;
//日期格式化展示
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss a",locale = "zh",timezone = "GMT+8")
private Date birth;
//当该数据为null时,不展示该数据
@JsonInclude(JsonInclude.Include.NON_NULL)
private String phone;
private String email;
}
SpringBoot中实体类的实用注解
最新推荐文章于 2023-05-22 22:08:58 发布