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

import com.google.gson.Gson;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;

@Component
public class RoiModelConfig {
    
    Map<String,Object> paramsNewStrategyMap=new HashMap<>();

    public Object get(String key){
        return paramsNewStrategyMap.get(key);
    }

    @PostConstruct
    private void init(){
        String initStr="  {\n" +
                "        \"VLOG\": {\n" +
                "            \"video\": {\"data\": \"videos0\"},\n" +
                "            \"user\": {\"data\": \"user0\", \"rule\": \"rule1\"},\n" +
                "            \"group_class_key\": \"class1\"\n" +
                "        },  " +
                "        \"LOVE_LIVE\": {\n" +
                "            \"video\": {\"data\": \"videos4\"},\n" +
                "            \"user\": {\"data\": \"user4\", \"rule\": \"rule1\"},\n" +
                "            \"group_class_key\": \"class1\"\n" +
                "        },  " +
                "        \"LONG_VIDEO\": {\n" +
                "            \"video\": {\"data\": \"videos5\"},\n" +
                "            \"user\": {\"data\": \"user5\", \"rule\": \"rule1\"},\n" +
                "            \"group_class_key\": \"class1\"\n" +
                "        }}";
        paramsNewStrategyMap=new Gson().fromJson(initStr,HashMap.class);
    }

    public static void main(String[] args){
            String initStr="  {\n" +
                    "        \"VLOG\": {\n" +
                    "            \"video\": {\"data\": \"videos0\"},\n" +
                    "            \"user\": {\"data\": \"user0\", \"rule\": \"rule1\"},\n" +
                    "            \"group_class_key\": \"class1\"\n" +
                    "        },  " +
                    "        \"LOVE_LIVE\": {\n" +
                    "            \"video\": {\"data\": \"videos4\"},\n" +
                    "            \"user\": {\"data\": \"user4\", \"rule\": \"rule1\"},\n" +
                    "            \"group_class_key\": \"class1\"\n" +
                    "        },  " +
                    "        \"LONG_VIDEO\": {\n" +
                    "            \"video\": {\"data\": \"videos5\"},\n" +
                    "            \"user\": {\"data\": \"user5\", \"rule\": \"rule1\"},\n" +
                    "            \"group_class_key\": \"class1\"\n" +
                    "        }" +
                    "}";
            Map map=new Gson().fromJson(initStr,HashMap.class);
    }
}
