//引入依赖 <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct</artifactId> <version>1.2.0.Final</version> </dependency> <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct-processor</artifactId> <version>1.2.0.Final</version> </dependency>//编写接口类@Mapperpublic interface Publish2PublishVO { Publish2PublishVO INSTANCE = Mappers.getMapper(Publish2PublishVO.class); CenterProductDataPublishVO toCenterProductDataPublishVO(CenterProductDataPublish centerProductDataPublish);}//调用应用CenterProductDataPublishVO centerProductDataPublishVO = Publish2PublishVO.INSTANCE.toCenterProductDataPublishVO(centerProductDataPublish);