in src/frontend/src/main/java/com/alibabacloud/hipstershop/web/RouteDemoController.java [93:124]
public String percentRouterResult(Model model) {
synchronized (TAG_LOCK) {
PERCENT_RESULT_LIST.clear();
PERCENT_RESULT_MAP.clear();
for (String str : PERCENT_RESULT_QUEUE) {
if(str.contains(":")) {
String tag = StringUtils.substringBefore(str,":");
String userId = StringUtils.substringAfter(str,":");
if (null == PERCENT_RESULT_MAP.get(tag)) {
HashSet<String> set = new HashSet<>();
set.add(userId);
PERCENT_RESULT_MAP.put(tag, set);
} else {
HashSet<String> set = PERCENT_RESULT_MAP.get(tag);
set.add(userId);
}
}
}
model.addAttribute("percent_router_result", PERCENT_RESULT_MAP);
model.addAttribute("province", province);
}
return "percent-router.html";
}