package com.smppw.utils;

import cn.hutool.core.map.MapUtil;
import com.smppw.common.pojo.enums.RBSAIndexType;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

public class RBSAIndexTypeMap {
    private static RBSAIndexTypeMap instance;
    private final Map<RBSAIndexType, List<String>> map = MapUtil.newHashMap();

    private RBSAIndexTypeMap() {
        map.put(RBSAIndexType.CNI7Style, Arrays.asList("IN0000000S", "IN0000000T", "IN0000000W", "IN0000000X",
                "IN0000000U", "IN0000000V"));
        map.put(RBSAIndexType.CNI3Style, Arrays.asList("IN0000001T", "IN0000001U"));
        map.put(RBSAIndexType.CNI7Strategy, Arrays.asList("IN00000020", "IN00000021", "IN00000022", "IN00000023",
                "IN00000024", "IN00000025"));
        map.put(RBSAIndexType.CSI11, Arrays.asList("IN0000000Y", "IN0000000Z", "IN00000010", "IN00000011", "IN00000012",
                "IN00000013", "IN00000014", "IN00000015", "IN00000016", "IN00000017"));
        map.put(RBSAIndexType.CITIC6,
                Arrays.asList("IN0000001V", "IN0000001W", "IN0000001X", "IN0000001Y", "IN0000001Z"));
        map.put(RBSAIndexType.RZ5Strategy,
                Arrays.asList("IN0000001B", "IN0000001H", "IN0000001E", "IN0000001G"));
        map.put(RBSAIndexType.Large4Assets, Arrays.asList("IN00000008", "IN000002C0", "IN0000008S"));

        //细分指数: 沪深300，中证500，中证1000，恒生指数，中证海外（不含香港），中债总指数，南华商品指数，现金
        map.put(RBSAIndexType.SegmentationAsset,
                Arrays.asList("IN00000008", "IN0000007M", "IN0000008O", "IN00000009", "IN00000284", "IN000002C0", "IN0000008S"));

        map.put(RBSAIndexType.ShenWan,
                Arrays.asList("IN000002D1",
                        "IN000002D0",
                        "IN000002CZ",
                        "IN000002CY",
                        "IN000000OX",
                        "IN000000OW",
                        "IN000000OV",
                        "IN000000OU",
                        "IN000000OT",
                        "IN000000OS",
                        "IN000000OR",
                        "IN000000OQ",
                        "IN000000OP",
                        "IN000000OO",
                        "IN000000ON",
                        "IN000000OM",
                        "IN000000OL",
                        "IN000000OK",
                        "IN000000OJ",
                        "IN000000OI",
                        "IN000000OH",
                        "IN000000OG",
                        "IN000000OF",
                        "IN000000OE",
                        "IN000000OD",
                        "IN000000OC",
                        "IN000000OB",
                        "IN000000OA",
                        "IN000000O9",
                        "IN000000O8",
                        "IN000000O6"));
    }

    public synchronized static RBSAIndexTypeMap getInstance() {
        if (null == instance) {
            instance = new RBSAIndexTypeMap();
        }
        return instance;
    }

    public List<String> getIndexIds(RBSAIndexType tIndexType) {
        return map.get(tIndexType);
    }
}
