package com.yuchen.saas.parking.api.wraper;

import com.yuchen.saas.parking.api.vo.ParkParkingTreeVO;
import com.yuchen.saas.parking.api.vo.PmgBatParkParkingVO;
import org.nest.springwrap.core.mp.support.BaseEntityWrapper;
import org.nest.springwrap.core.tool.node.ForestNodeMerger;
import org.nest.springwrap.core.tool.utils.BeanUtil;

import java.util.List;
import java.util.stream.Collectors;


public class ParkingWrapper extends BaseEntityWrapper<ParkParkingTreeVO, PmgBatParkParkingVO> {

    public static ParkingWrapper build() {
        return new ParkingWrapper();
    }


    @Override
    public PmgBatParkParkingVO entityVO(ParkParkingTreeVO entity) {
        return null;
    }
    public List<ParkParkingTreeVO> listNodeVO(List<PmgBatParkParkingVO> list) {
        List<ParkParkingTreeVO> collect = list.stream().map(parking -> BeanUtil.copy(parking, ParkParkingTreeVO.class))
                .collect(Collectors.toList());
        return ForestNodeMerger.merge(collect);
    }

}
