mapStruct使用

//引入依赖
        
            org.mapstruct
            mapstruct
            1.2.0.Final
        
        
            org.mapstruct
            mapstruct-processor
            1.2.0.Final
        


//编写接口类
@Mapper
public interface Publish2PublishVO {
    Publish2PublishVO INSTANCE = Mappers.getMapper(Publish2PublishVO.class);

    CenterProductDataPublishVO toCenterProductDataPublishVO(CenterProductDataPublish centerProductDataPublish);

}


//调用使用
CenterProductDataPublishVO centerProductDataPublishVO = Publish2PublishVO.INSTANCE.toCenterProductDataPublishVO(centerProductDataPublish);

你可能感兴趣的:(javaspringboot)