package com.tzld.piaoquan.ad.engine.service.predict.config;

import com.google.common.reflect.TypeToken;
import com.tzld.piaoquan.ad.engine.commons.util.JSONUtils;
import com.tzld.piaoquan.ad.engine.service.predict.helper.NewExpInfoHelper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.*;

@Component
public class NewExpUserGroupConfig {

    public static Map<String,String[]> newExpUserGroupMap=new HashMap<>();

    @Value("${new.exp.user.group:{}}")
    private void setNewExpInfo(String str){
        Map<String,String[]> expConfigs= JSONUtils.fromJson(str, new TypeToken< Map<String,String[]>>() {
        }, Collections.emptyMap());
        for (Map.Entry<String, String[]> entry : expConfigs.entrySet()) {
            newExpUserGroupMap.put(entry.getKey(),entry.getValue());
        }
    }


}
