Authored by Gino Zhang

增加日志

@@ -55,7 +55,7 @@ public class BaikeSpiderService { @@ -55,7 +55,7 @@ public class BaikeSpiderService {
55 String baikeDir = BaikeSpiderService.class.getResource("/baike").getPath(); 55 String baikeDir = BaikeSpiderService.class.getResource("/baike").getPath();
56 File baikeDirFile = new File(baikeDir); 56 File baikeDirFile = new File(baikeDir);
57 if (!baikeDirFile.exists() || !baikeDirFile.isDirectory()) { 57 if (!baikeDirFile.exists() || !baikeDirFile.isDirectory()) {
58 - throw new RuntimeException("Cannot find baike directory."); 58 + throw new RuntimeException("Cannot find baike directory. baikeDir=" + baikeDir);
59 } 59 }
60 60
61 File[] baikeUrlFiles = baikeDirFile.listFiles((file, fileName) -> fileName.endsWith(".txt")); 61 File[] baikeUrlFiles = baikeDirFile.listFiles((file, fileName) -> fileName.endsWith(".txt"));
@@ -90,7 +90,7 @@ public class BaikeSpiderService { @@ -90,7 +90,7 @@ public class BaikeSpiderService {
90 return result; 90 return result;
91 } 91 }
92 92
93 - private Set<String> getAllYohoKeywords(){ 93 + private Set<String> getAllYohoKeywords() {
94 Set<String> resultSet = new HashSet<>(2000); 94 Set<String> resultSet = new HashSet<>(2000);
95 List<Brand> brandList = brandService.getBrandPageLists(1, Integer.MAX_VALUE); 95 List<Brand> brandList = brandService.getBrandPageLists(1, Integer.MAX_VALUE);
96 resultSet.addAll(brandList.stream().map(Brand::getBrandName).filter(name -> StringUtils.isNotBlank(name)).collect(Collectors.toSet())); 96 resultSet.addAll(brandList.stream().map(Brand::getBrandName).filter(name -> StringUtils.isNotBlank(name)).collect(Collectors.toSet()));
@@ -108,5 +108,4 @@ public class BaikeSpiderService { @@ -108,5 +108,4 @@ public class BaikeSpiderService {
108 108
109 return resultSet; 109 return resultSet;
110 } 110 }
111 -  
112 } 111 }