|
@@ -65,12 +65,6 @@ import static com.taais.biz.service.impl.VideoStableServiceImpl.*;
|
|
@Service
|
|
@Service
|
|
@Log4j2
|
|
@Log4j2
|
|
public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToInfrared> implements IToInfraredService {
|
|
public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToInfrared> implements IToInfraredService {
|
|
- @Value("${server.port}")
|
|
|
|
- String port;
|
|
|
|
-
|
|
|
|
- @Value("${taais.profile}")
|
|
|
|
- String profile;
|
|
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysOssService ossService;
|
|
private ISysOssService ossService;
|
|
|
|
|
|
@@ -542,11 +536,7 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
return content;
|
|
return content;
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public CommonResult getModelList(Long id) {
|
|
|
|
- ToInfrared entity = getById(id);
|
|
|
|
- String outPutPath = entity.getOutputPath();
|
|
|
|
- String modelPath = outPutPath + File.separator + "model";
|
|
|
|
|
|
+ public static CommonResult getModelList_(String modelPath, String profile) {
|
|
File modelDir = new File(modelPath);
|
|
File modelDir = new File(modelPath);
|
|
if (!modelDir.exists()) {
|
|
if (!modelDir.exists()) {
|
|
return CommonResult.fail("模型输出目录不存在!");
|
|
return CommonResult.fail("模型输出目录不存在!");
|
|
@@ -555,6 +545,9 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
Integer idx = 0;
|
|
Integer idx = 0;
|
|
ArrayList<Map<String, String>> res = new ArrayList<>();
|
|
ArrayList<Map<String, String>> res = new ArrayList<>();
|
|
for (File file : files) {
|
|
for (File file : files) {
|
|
|
|
+ if (file.getName().endsWith(".log")) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
idx += 1;
|
|
idx += 1;
|
|
Map<String, String> tmp = new HashMap<>();
|
|
Map<String, String> tmp = new HashMap<>();
|
|
tmp.put("id", idx.toString());
|
|
tmp.put("id", idx.toString());
|
|
@@ -563,7 +556,8 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
tmp.put("path", filePath);
|
|
tmp.put("path", filePath);
|
|
// todo 获取真正的url
|
|
// todo 获取真正的url
|
|
// http://localhost:9090/profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip
|
|
// http://localhost:9090/profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip
|
|
- String url = "http://localhost:" + port + Constants.RESOURCE_PREFIX + filePath.substring(profile.length());
|
|
|
|
|
|
+ // /profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip
|
|
|
|
+ String url = "/api" + Constants.RESOURCE_PREFIX + filePath.substring(profile.length());
|
|
url = url.replaceAll("\\\\", "/"); // windows
|
|
url = url.replaceAll("\\\\", "/"); // windows
|
|
tmp.put("url", url);
|
|
tmp.put("url", url);
|
|
|
|
|
|
@@ -576,6 +570,14 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
return CommonResult.success(res, "success");
|
|
return CommonResult.success(res, "success");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public CommonResult getModelList(Long id) {
|
|
|
|
+ ToInfrared entity = getById(id);
|
|
|
|
+ String outPutPath = entity.getOutputPath();
|
|
|
|
+ String modelPath = outPutPath + File.separator + "model";
|
|
|
|
+ return getModelList_(modelPath, TaaisConfig.getProfile());
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public CommonResult previewPredictResult(Long id) {
|
|
public CommonResult previewPredictResult(Long id) {
|
|
ToInfrared entity = getById(id);
|
|
ToInfrared entity = getById(id);
|