1.在pom.xml中导入依赖 2.在实体类中写注解 @Data注解,其中包含了setter,getter,tostring,hashcode,equals等方法,不包括构造方法 @Constructor构造方法注解