use of com.cdeledu.model.system.SysIcon in project wechat by dllwh.
the class IconController method initIcon.
@RequestMapping(value = "initIcon")
@ResponseBody
public AjaxJson initIcon() {
AjaxJson result = new AjaxJson();
try {
result.setMsg("数据初始化成功");
Map<String, String> filePathMap = Maps.newConcurrentMap();
ClassLoader baseUrl = Thread.currentThread().getContextClassLoader();
filePathMap.put("bootstrap", baseUrl.getResource("bootstrapIconInfo/bootstrap.css").getPath());
filePathMap.put("fontAwesome", baseUrl.getResource("bootstrapIconInfo/font-awesome.css").getPath());
filePathMap.put("simpleLine", baseUrl.getResource("bootstrapIconInfo/simple-line-icons.css").getPath());
List<Map<String, String>> resultList = BootstrapHelper.getBootstrapIconInfo(filePathMap);
SysIcon sysIcon = null;
for (Map<String, String> map : resultList) {
try {
sysIcon = new SysIcon();
sysIcon.setDisplayName(map.get("displayName"));
sysIcon.setSourceType(map.get("sourceType"));
if (sysIconService.findOneForJdbc(sysIcon) != null) {
sysIcon.setClassName(map.get("className"));
sysIconService.insert(sysIcon);
}
} catch (Exception e) {
continue;
}
}
} catch (Exception e) {
result.setMsg("数据初始化失败,原因" + e.getMessage());
result.setSuccess(false);
}
return result;
}
Aggregations