package com.friday.custody.convertor;



import com.friday.custody.api.dto.gjdf.HtscProductInfo;
import com.friday.custody.entity.FundInfoEntity;

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

/**
 * @author 021790
 */
public class HtscProdcutInfoToFundInfoEntityConvertor {
    public static FundInfoEntity convert(HtscProductInfo htscProductInfo) {
        FundInfoEntity fundInfo = new FundInfoEntity();
        fundInfo.setFundCode(htscProductInfo.getFundRecordCode());
        fundInfo.setInnerFundCode(htscProductInfo.getFundCode());
        return fundInfo;
    }
    public static List<FundInfoEntity> convertList(List<HtscProductInfo> htscProductInfoList) {
        return htscProductInfoList.stream()
                .map(HtscProdcutInfoToFundInfoEntityConvertor::convert)
                .collect(Collectors.toList());
    }
}
