|
@@ -3,6 +3,7 @@ package org.dromara.web.task;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
+import cn.hutool.core.thread.ThreadUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.json.JSONArray;
|
|
@@ -46,17 +47,6 @@ public class KafkaMessageConsumer {
|
|
|
private String ffmpegFilePath = "/usr/local/bin/ffmpeg";
|
|
|
@Scheduled(cron = "*/1 * * * * *")
|
|
|
public void doChange() {
|
|
|
- String eventTime = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("event_time");
|
|
|
- if(StrUtil.isEmptyIfStr(eventTime)){
|
|
|
- eventTime = "200";
|
|
|
- }
|
|
|
- finalEventTime = eventTime;
|
|
|
- String eventChangeTime = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("event_change_time");
|
|
|
- if(StrUtil.isEmptyIfStr(eventChangeTime)){
|
|
|
- eventChangeTime = "400";
|
|
|
- }
|
|
|
- finalEventChangeTime = eventChangeTime;
|
|
|
-// System.out.println("事件判断");
|
|
|
|
|
|
AtomicBoolean succes = new AtomicBoolean(false);
|
|
|
eventMap.forEach((key, value) -> {
|
|
@@ -204,16 +194,17 @@ public class KafkaMessageConsumer {
|
|
|
}
|
|
|
File file = HttpUtil.downloadFileFromUrl(path, FileUtil.file("./temp/"));
|
|
|
if(path.endsWith(".mp4")){
|
|
|
- try{
|
|
|
- String pathfile = "./"+ UUID.fastUUID()+".mp4";
|
|
|
- Utils.exchangeToMp4(ffmpegFilePath,file.toPath().toString(),pathfile);
|
|
|
- FileUtil.del(file);
|
|
|
- file = new File(pathfile);;
|
|
|
- }catch (Exception e){
|
|
|
- }
|
|
|
+// try{
|
|
|
+// String pathfile = "./"+ UUID.fastUUID()+".mp4";
|
|
|
+// Utils.exchangeToMp4(ffmpegFilePath,file.toPath().toString(),pathfile);
|
|
|
+// FileUtil.del(file);
|
|
|
+// file = new File(pathfile);;
|
|
|
+// }catch (Exception e){
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
SysOssVo oss = SpringUtils.getBean(ISysOssService.class).upload(file);
|
|
|
+
|
|
|
FileUtil.del(file);
|
|
|
return oss.getFileName();
|
|
|
}
|