pom文件
<!-- 对象拷贝 -->
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-jdk8</artifactId>
<version>1.3.1.Final</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.3.1.Final</version>
</dependency>
接口
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
/**
* @Description: 转换器
* @Author: tanjunjun@ahyzyx.cn
* @CreateDate: 2021/3/22 18:48
* @Version: 1.0
*/
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface MapStructConverter {
com.mapstruct.MapStructConverter INSTANCE = Mappers.getMapper(com.mapstruct.MapStructConverter.class);
/**
* StudyExamine 基本信息转换
* @param studyExamineBasicReq
* @return
*/
StudyExamine studyExamineConverter(StudyExamineBasicReq studyExamineBasicReq);
}