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

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.*;

@Component
public class AbConfig {
    HashMap<String,Map<String,Object>> abConfigMap;
    Gson gson=new Gson();
    @PostConstruct
    public void init() {
        abConfigMap=getAbConfigMap();
    }

    public String[] getAbParams(String abTestCode, JSONObject abExpInfo){
        String abtestId = null;
        String abtestConfigTag = null;
        // Extract A/B test IDs from AD_ABTEST_CONFIG
        List<String> ad_abtest_id_list = new ArrayList<>();

        for (String key : abConfigMap.keySet()) {
            String[] parts = key.split("-");
            if (parts.length > 0) {
                ad_abtest_id_list.add(parts[0]);
            }
        }
        // Initialize a dictionary to store A/B test configurations
        Map<String, Object> configValueDict = new HashMap<>();
        // Check if ab_exp_info is not null
        if (abExpInfo != null) {
            // Retrieve the list of A/B tests under the key \"ab_test002\"
            JSONArray abExpList = abExpInfo.getJSONArray("ab_test002");
            if (abExpList != null) {
                // Process each A/B test item
                for (Map<String, Object> abItem : abExpList.toJavaList(Map.class)) {
                    // Get the \"abExpCode\" from the A/B test item
                    String ab_exp_code = (String) abItem.get("abExpCode");
                    // Check if \"abExpCode\" is not null
                    if (ab_exp_code != null) {
                        // Check if \"abExpCode\" exists in ad_abtest_id_list
                        if (ad_abtest_id_list.contains(ab_exp_code)) {
                            // Get the \"configValue\" from the A/B test item
                            Object configValue = abItem.get("configValue");
                            // Check if \"configValue\" is not null
                            if (configValue != null) {
                                // Store the configuration value in config_value_dict
                                configValueDict.put(ab_exp_code, configValue);
                            }
                        }
                    }
                }
            }
        }

        if (configValueDict.size() > 0) {
            for (Map.Entry<String, Object> entry : configValueDict.entrySet()) {
                String ab_exp_code = entry.getKey();
                Map<String, List<String>> config_value = gson.fromJson((String)entry.getValue(),Map.class);

                for (Map.Entry<String, List<String>> configEntry : config_value.entrySet()) {
                    String tag = configEntry.getKey();
                    configEntry.getValue();

                    if (configEntry.getValue().contains(abTestCode)) {
                        abtestId = ab_exp_code;
                        abtestConfigTag = tag;
                        break;
                    }
                }
            }
        }
        if(abtestId!=null){
            return new String[]{abtestId,abtestConfigTag};
        }else {
            return null;
        }

    }


    public HashMap<String,Map<String,Object>> getAbConfigMap(){
        String configStr="{\n" +
                "        \"173-j\": {\n" +
                "            \"video\": {\"data\": \"videos0\"},\n" +
                "            \"user\": {\"data\": \"user0\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"173-l\": {\n" +
                "            \"video\": {\"data\": \"videos0\"},\n" +
                "            \"user\": {\"data\": \"user0\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\", \"return0share1mids\"],\n" +
                "        },  " +
                "        \"173-n\": {\n" +
                "            \"video\": {\"data\": \"videos0out\"},\n" +
                "            \"user\": {\"data\": \"user0out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"173-s\": {\n" +
                "            \"video\": {\"data\": \"videos0out\"},\n" +
                "            \"user\": {\"data\": \"user0out\", \"rule\": \"rule3\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class3\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        },  " +
                "        \"173-t\": {\n" +
                "            \"video\": {\"data\": \"videos0out\"},\n" +
                "            \"user\": {\"data\": \"user0out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"no_ad_group_with_video_mapping\": {\n" +
                "                \"mean_group\": [\"top3\"],\n" +
                "                \"return0share1mids\": [\"top3\"],\n" +
                "                \"return0share2_nmids\": [\"top3\"],\n" +
                "                \"return1mids\": [\"top3\"],\n" +
                "                \"return2_3mids\": [\"top3\"],\n" +
                "                \"return4_8mids\": [\"top3\"],\n" +
                "                \"return9_24mids\": [\"top3\"],\n" +
                "                \"return25_nmids\": [\"top3\"],\n" +
                "            }\n" +
                "        }, " +
                "        \"173-u\": {\n" +
                "            \"threshold_mix_func\": \"model\",\n" +
                "            \"model_key\": \"ad_out_v1\",\n" +
                "            \"video\": {\"data\": \"videos0out\"},\n" +
                "            \"user\": {\"data\": \"user0out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"173-v\": {\n" +
                "            \"threshold_mix_func\": \"model\",\n" +
                "            \"model_key\": \"ad_out_v1\",\n" +
                "            \"video\": {\"data\": \"videos0out\"},\n" +
                "            \"user\": {\"data\": \"user0out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        },  " +
                "        \"190-f\": {\n" +
                "            \"video\": {\"data\": \"videos21\"},\n" +
                "            \"user\": {\"data\": \"user21\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"190-g\": {\n" +
                "            \"video\": {\"data\": \"videos21out\"},\n" +
                "            \"user\": {\"data\": \"user21out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\", \"return0share1mids\"],\n" +
                "        },  " +
                "        \"190-h\": {\n" +
                "            \"video\": {\"data\": \"videos21out\"},\n" +
                "            \"user\": {\"data\": \"user21out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"190-i\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos21\"}, \"user\": {\"data\": \"user21\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos21out\"}, \"user\": {\"data\": \"user21out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"add\",\n" +
                "            \"mix_param\": {\"share_weight\": 0.2, \"out_weight\": 0.8}\n" +
                "        },  " +
                "        \"190-j\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos21\"}, \"user\": {\"data\": \"user21\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos21out\"}, \"user\": {\"data\": \"user21out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        },  " +
                "        \"194-g\": {\n" +
                "            \"video\": {\"data\": \"videos4\"},\n" +
                "            \"user\": {\"data\": \"user4\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"194-i\": {\n" +
                "            \"video\": {\"data\": \"videos4out\"},\n" +
                "            \"user\": {\"data\": \"user4out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\", \"return0share1mids\"],\n" +
                "        },  " +
                "        \"194-j\": {\n" +
                "            \"video\": {\"data\": \"videos4out\"},\n" +
                "            \"user\": {\"data\": \"user4out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"194-k\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos4\"}, \"user\": {\"data\": \"user4\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos4out\"}, \"user\": {\"data\": \"user4out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"add\",\n" +
                "            \"mix_param\": {\"share_weight\": 0.2, \"out_weight\": 0.8}\n" +
                "        },  " +
                "        \"194-l\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos4\"}, \"user\": {\"data\": \"user4\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos4out\"}, \"user\": {\"data\": \"user4out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        }, " +
                "        \"194-m\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos4new\"}, \"user\": {\"data\": \"user4new\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos4out\"}, \"user\": {\"data\": \"user4out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        }," +
                "        \"194-n\": {\n" +
                "            \"video\": {\"data\": \"videos4out\"},\n" +
                "            \"user\": {\"data\": \"user4out\", \"rule\": \"rule3\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class3\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        },  " +
                "        \"194-o\": {\n" +
                "            \"video\": {\"data\": \"videos4out\"},\n" +
                "            \"user\": {\"data\": \"user4out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"no_ad_group_with_video_mapping\": {\n" +
                "                \"mean_group\": [\"top3\"],\n" +
                "                \"return0share1mids\": [\"top3\"],\n" +
                "                \"return0share2_nmids\": [\"top3\"],\n" +
                "                \"return1mids\": [\"top3\"],\n" +
                "                \"return2_3mids\": [\"top3\"],\n" +
                "                \"return4_8mids\": [\"top3\"],\n" +
                "                \"return9_24mids\": [\"top3\"],\n" +
                "                \"return25_nmids\": [\"top3\"],\n" +
                "            }\n" +
                "        },  " +
                "        \"195-f\": {\n" +
                "            \"video\": {\"data\": \"videos5\"},\n" +
                "            \"user\": {\"data\": \"user5\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        },  " +
                "        \"195-h\": {\n" +
                "            \"video\": {\"data\": \"videos5out\"},\n" +
                "            \"user\": {\"data\": \"user5out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        },  " +
                "        \"195-i\": {\n" +
                "            \"video\": {\"data\": \"videos5out\"},\n" +
                "            \"user\": {\"data\": \"user5out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\", \"return0share1mids\"],\n" +
                "        },  " +
                "        \"195-j\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos5\"}, \"user\": {\"data\": \"user5\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos5out\"}, \"user\": {\"data\": \"user5out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"add\",\n" +
                "            \"mix_param\": {\"share_weight\": 0.2, \"out_weight\": 0.8}\n" +
                "        },  " +
                "        \"195-k\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos5\"}, \"user\": {\"data\": \"user5\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos5out\"}, \"user\": {\"data\": \"user5out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        },  " +
                "        \"195-l\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos5new\"}, \"user\": {\"data\": \"user5new\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos5out\"}, \"user\": {\"data\": \"user5out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        },  " +
                "        \"195-m\": {\n" +
                "            \"video\": {\"data\": \"videos5out\"},\n" +
                "            \"user\": {\"data\": \"user5out\", \"rule\": \"rule3\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class3\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"195-n\": {\n" +
                "            \"video\": {\"data\": \"videos5out\"},\n" +
                "            \"user\": {\"data\": \"user5out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"no_ad_group_with_video_mapping\": {\n" +
                "                \"mean_group\": [\"top3\"],\n" +
                "                \"return0share1mids\": [\"top3\"],\n" +
                "                \"return0share2_nmids\": [\"top3\"],\n" +
                "                \"return1mids\": [\"top3\"],\n" +
                "                \"return2_3mids\": [\"top3\"],\n" +
                "                \"return4_8mids\": [\"top3\"],\n" +
                "                \"return9_24mids\": [\"top3\"],\n" +
                "                \"return25_nmids\": [\"top3\"],\n" +
                "            }\n" +
                "        },  " +
                "        \"196-f\": {\n" +
                "            \"video\": {\"data\": \"videos6\"},\n" +
                "            \"user\": {\"data\": \"user6\", \"rule\": \"rule1\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        },  " +
                "        \"196-g\": {\n" +
                "            \"video\": {\"data\": \"videos6out\"},\n" +
                "            \"user\": {\"data\": \"user6out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\", \"return0share1mids\"],\n" +
                "        },  " +
                "        \"196-h\": {\n" +
                "            \"video\": {\"data\": \"videos6out\"},\n" +
                "            \"user\": {\"data\": \"user6out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        },  " +
                "        \"196-i\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos6\"}, \"user\": {\"data\": \"user6\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos6out\"}, \"user\": {\"data\": \"user6out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"add\",\n" +
                "            \"mix_param\": {\"share_weight\": 0.2, \"out_weight\": 0.8}\n" +
                "        },  " +
                "        \"196-j\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos6\"}, \"user\": {\"data\": \"user6\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos6out\"}, \"user\": {\"data\": \"user6out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        },  " +
                "        \"197-f\": {\n" +
                "            \"video\": {\"data\": \"data5\"},\n" +
                "            \"user\": {\"data\": \"user18\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        },  " +
                "        \"197-g\": {\n" +
                "            \"video\": {\"data\": \"videos18out\"},\n" +
                "            \"user\": {\"data\": \"user18out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\", \"return0share1mids\"],\n" +
                "        },  " +
                "        \"197-h\": {\n" +
                "            \"video\": {\"data\": \"videos18out\"},\n" +
                "            \"user\": {\"data\": \"user18out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"197-i\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos18\"}, \"user\": {\"data\": \"user18\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos18out\"}, \"user\": {\"data\": \"user18out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"add\",\n" +
                "            \"mix_param\": {\"share_weight\": 0.2, \"out_weight\": 0.8}\n" +
                "        }, " +
                "        \"197-j\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos18\"}, \"user\": {\"data\": \"user18\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos18out\"}, \"user\": {\"data\": \"user18out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        }, " +
                "        \"198-f\": {\n" +
                "            \"video\": {\"data\": \"videos19\"},\n" +
                "            \"user\": {\"data\": \"user19\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"198-g\": {\n" +
                "            \"video\": {\"data\": \"videos19out\"},\n" +
                "            \"user\": {\"data\": \"user19out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\", \"return0share1mids\"],\n" +
                "        }, " +
                "        \"198-h\": {\n" +
                "            \"video\": {\"data\": \"videos19out\"},\n" +
                "            \"user\": {\"data\": \"user19out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }," +
                "        \"198-i\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos19\"}, \"user\": {\"data\": \"user19\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos19out\"}, \"user\": {\"data\": \"user19out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"add\",\n" +
                "            \"mix_param\": {\"share_weight\": 0.2, \"out_weight\": 0.8}\n" +
                "        }, " +
                "        \"198-j\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos19\"}, \"user\": {\"data\": \"user19\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos19out\"}, \"user\": {\"data\": \"user19out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        }," +
                "        \"242-d\": {\n" +
                "            \"video\": {\"data\": \"videos22\"},\n" +
                "            \"user\": {\"data\": \"user22\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"242-e\": {\n" +
                "            \"video\": {\"data\": \"videos22out\"},\n" +
                "            \"user\": {\"data\": \"user22out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\", \"return0share1mids\"],\n" +
                "        }, " +
                "        \"242-f\": {\n" +
                "            \"video\": {\"data\": \"videos22out\"},\n" +
                "            \"user\": {\"data\": \"user22out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"242-g\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos22\"}, \"user\": {\"data\": \"user22\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos22out\"}, \"user\": {\"data\": \"user22out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"add\",\n" +
                "            \"mix_param\": {\"share_weight\": 0.2, \"out_weight\": 0.8}\n" +
                "        },  " +
                "        \"242-h\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos22\"}, \"user\": {\"data\": \"user22\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos22out\"}, \"user\": {\"data\": \"user22out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        }, " +
                "        \"243-d\": {\n" +
                "            \"video\": {\"data\": \"videos3\"},\n" +
                "            \"user\": {\"data\": \"user3\", \"rule\": \"rule1\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"243-e\": {\n" +
                "            \"video\": {\"data\": \"videos3out\"},\n" +
                "            \"user\": {\"data\": \"user3out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\", \"return0share1mids\"],\n" +
                "        }, " +
                "        \"243-f\": {\n" +
                "            \"video\": {\"data\": \"videos3out\"},\n" +
                "            \"user\": {\"data\": \"user3out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"243-g\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos3\"}, \"user\": {\"data\": \"user3\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos3out\"}, \"user\": {\"data\": \"user3out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"add\",\n" +
                "            \"mix_param\": {\"share_weight\": 0.2, \"out_weight\": 0.8}\n" +
                "        }, " +

                "       \"243-i\": {\n" +
                "            \"threshold_mix_func\": \"model\"," +
                "            \"model_key\": \"ad_out_v1\"," +
                "            \"video\": {\"data\": \"videos0out\"}," +
                "            \"user\": {\"data\": \"user0out\", \"rule\": \"rule2\"}," +
                "            \"group_class_key\": \"class1\"," +
                "            \"no_ad_mid_group_list\": [\"class1\"]," +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"]\n" +
                "        },"+

                "        \"243-h\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos3\"}, \"user\": {\"data\": \"user3\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos3out\"}, \"user\": {\"data\": \"user3out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        }, " +
                "        \"324-a\": {\n" +
                "            \"video\": {\"data\": \"videos0\"},\n" +
                "            \"user\": {\"data\": \"user0\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"324-b\": {\n" +
                "            \"video\": {\"data\": \"videos0out\"},\n" +
                "            \"user\": {\"data\": \"user0out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\", \"return0share1mids\"],\n" +
                "        },  " +
                "        \"324-c\": {\n" +
                "            \"video\": {\"data\": \"videos0out\"},\n" +
                "            \"user\": {\"data\": \"user0out\", \"rule\": \"rule2\"},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "        }, " +
                "        \"324-d\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos0\"}, \"user\": {\"data\": \"user0\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos0out\"}, \"user\": {\"data\": \"user0out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"add\",\n" +
                "            \"mix_param\": {\"share_weight\": 0.2, \"out_weight\": 0.8}\n" +
                "        }, " +
                "        \"324-e\": {\n" +
                "            \"share\": {\"video\": {\"data\": \"videos0\"}, \"user\": {\"data\": \"user0\", \"rule\": \"rule2\"}},\n" +
                "            \"out\": {\"video\": {\"data\": \"videos0out\"}, \"user\": {\"data\": \"user0out\", \"rule\": \"rule2\"}},\n" +
                "            \"group_class_key\": \"class1\",\n" +
                "            \"no_ad_mid_group_list\": [\"class1\"],\n" +
                "            \"care_model_status_param\": 1,\n" +
                "            \"care_model_ab_mid_group\": [\"mean_group\"],\n" +
                "            \"threshold_mix_func\": \"multiply\",\n" +
                "        }  " +
                "    }";
        HashMap<String,Map<String,Object>> abConfigMap=JSONObject.parseObject(configStr,HashMap.class);
        return abConfigMap;
    }
}
