在pom文件中引入依赖
<dependency>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-core</artifactId>
<version>6.2.0</version>
</dependency>
测试类中用到的实体类:
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Employee {
private Integer id;
private String name;
private Integer age;
private double salary;
}
EmployeeInfo :
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author: kevin_zhang
* @date: 2020/2/25 0025 11:02
* @Description:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EmployeeInfo {
private Integer id;
private String phone;
private String email;
}
EmployeeVo :
import lombok.Data;
/**
* @author: kevin_zhang
* @date: 2020/2/25 0025 10:59
* @Description:
*/