LabelUtil.java 833 Bytes
Newer Older
zp's avatar
zp committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
package com.tanpu.fund.utils;

import com.tanpu.common.model.product.resp.ProductLabel;
import com.tanpu.common.resp.CommonResp;
import com.tanpu.fund.feign.user.FeignClientForFatools;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class LabelUtil {

    public Map<String, List<ProductLabel>> getMap(List<String> ls, FeignClientForFatools fatools) {

        CommonResp<Map<String, List<ProductLabel>>> resp = fatools.batchGetLabelByIdInfo(ls);
        if (resp.isSuccess()) {
            return resp.getAttributes();
        }
        return new HashMap<>(0);
    }

    public List<ProductLabel> getList(Map<String, List<ProductLabel>> map, String id) {
        if (!map.isEmpty()) {
            return map.get(id);
        }
        return new ArrayList<>(0);
    }
}