|
@@ -274,13 +274,6 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
//利用token去检测
|
|
//利用token去检测
|
|
// DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
// DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
// LocalDateTime l = LocalDateTime.parse("2019-02-03",dateTimeFormatter);
|
|
// LocalDateTime l = LocalDateTime.parse("2019-02-03",dateTimeFormatter);
|
|
- Map<String, Object> picResultMap = CheckPicUtil.generalPicTextContentMap(path + filePath.substring("/upload/".length()), accessToken);
|
|
|
|
- List<String> textContents = new ArrayList<String>();
|
|
|
|
- if (picResultMap != null) {
|
|
|
|
- textContents = (List<String>) picResultMap.get("wordsList");
|
|
|
|
- screenshot.setPicContext((String) picResultMap.get("picContent"));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// Set<Object> members = new HashSet<>();
|
|
// Set<Object> members = new HashSet<>();
|
|
// if (redisUtil.existsKey(Constant.COMMON_SOFTWARE_KEYWORDS)) {
|
|
// if (redisUtil.existsKey(Constant.COMMON_SOFTWARE_KEYWORDS)) {
|
|
// members = redisUtil.members(Constant.COMMON_SOFTWARE_KEYWORDS);
|
|
// members = redisUtil.members(Constant.COMMON_SOFTWARE_KEYWORDS);
|
|
@@ -294,9 +287,19 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
// }
|
|
// }
|
|
File picFile = new File((String)fileMap.get("newFile"));
|
|
File picFile = new File((String)fileMap.get("newFile"));
|
|
System.out.println("File:"+picFile.getAbsolutePath());
|
|
System.out.println("File:"+picFile.getAbsolutePath());
|
|
|
|
+
|
|
|
|
+ List<String> textContents = new ArrayList<String>();
|
|
|
|
+
|
|
if (isIM(picFile) != null) {
|
|
if (isIM(picFile) != null) {
|
|
screenshot.setPicType(9);//聊天
|
|
screenshot.setPicType(9);//聊天
|
|
- } if (isNovel(textContents)) {
|
|
|
|
|
|
+ } else {
|
|
|
|
+ Map<String, Object> picResultMap = CheckPicUtil.generalPicTextContentMap(path + filePath.substring("/upload/".length()), accessToken);
|
|
|
|
+ if (picResultMap != null) {
|
|
|
|
+ textContents = (List<String>) picResultMap.get("wordsList");
|
|
|
|
+ screenshot.setPicContext((String) picResultMap.get("picContent"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (isNovel(textContents)) {
|
|
screenshot.setPicType(6);
|
|
screenshot.setPicType(6);
|
|
} else if (isDocument(textContents)) {
|
|
} else if (isDocument(textContents)) {
|
|
screenshot.setPicType(2);//看文档
|
|
screenshot.setPicType(2);//看文档
|
|
@@ -348,18 +351,23 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
String fileName = item.getPicUrl().replaceAll("/upload/", "");
|
|
String fileName = item.getPicUrl().replaceAll("/upload/", "");
|
|
String filePath = path + fileName;
|
|
String filePath = path + fileName;
|
|
File pic = new File(filePath);
|
|
File pic = new File(filePath);
|
|
- String devName = isDevelop(pic);
|
|
|
|
|
|
+ String imName = isIM(pic);
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
- if(devName != null) {
|
|
|
|
- msg.data = devName;
|
|
|
|
|
|
+ if (imName != null) {
|
|
|
|
+ msg.data = imName;
|
|
} else {
|
|
} else {
|
|
- try {
|
|
|
|
- String browserName = isBrowser(pic);
|
|
|
|
- if (browserName != null) {
|
|
|
|
- msg.data = browserName;
|
|
|
|
|
|
+ String devName = isDevelop(pic);
|
|
|
|
+ if(devName != null) {
|
|
|
|
+ msg.data = devName;
|
|
|
|
+ } else {
|
|
|
|
+ try {
|
|
|
|
+ String browserName = isBrowser(pic);
|
|
|
|
+ if (browserName != null) {
|
|
|
|
+ msg.data = browserName;
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
}
|
|
}
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return msg;
|
|
return msg;
|
|
@@ -447,7 +455,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
}
|
|
}
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
public static void main(String[] args) throws Exception {
|
|
-// String b = isDevelop(new File("C:\\Users\\seya\\Desktop\\wtt.jpg"));
|
|
|
|
|
|
+// String b = isIM(new File("C:\\Users\\seya\\Desktop\\chat.jpg"));
|
|
// System.out.println("结果:"+b);
|
|
// System.out.println("结果:"+b);
|
|
}
|
|
}
|
|
|
|
|