|
@@ -1,14 +1,18 @@
|
|
package com.taais.biz.controller;
|
|
package com.taais.biz.controller;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
import com.taais.biz.constant.BizConstant;
|
|
import com.taais.biz.constant.BizConstant;
|
|
import com.taais.biz.domain.TargetIdentificationSubtaskDetails;
|
|
import com.taais.biz.domain.TargetIdentificationSubtaskDetails;
|
|
import com.taais.biz.service.impl.TargetIdentificationSubtaskServiceImpl;
|
|
import com.taais.biz.service.impl.TargetIdentificationSubtaskServiceImpl;
|
|
|
|
+import com.taais.common.core.utils.StringUtils;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import com.taais.common.core.core.domain.CommonResult;
|
|
import com.taais.common.core.core.domain.CommonResult;
|
|
@@ -128,4 +132,23 @@ public class TargetIdentificationSubtaskDetailsController extends BaseController
|
|
return CommonResult.fail(e.getMessage());
|
|
return CommonResult.fail(e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Value("${taais.profile}")
|
|
|
|
+ private String profile;
|
|
|
|
+
|
|
|
|
+ @GetMapping("/getImgList")
|
|
|
|
+ public CommonResult<List<String>> getImgList(String taskId, String subPath) {
|
|
|
|
+ String path = profile + "/task/" + taskId;
|
|
|
|
+ if (StringUtils.isNotEmpty(subPath)) {
|
|
|
|
+ path += "/" + subPath;
|
|
|
|
+ }
|
|
|
|
+ System.out.println("path is : " + path);
|
|
|
|
+ File file = new File( path );
|
|
|
|
+ File[] files = file.listFiles();
|
|
|
|
+ List<String> res = new ArrayList<>();
|
|
|
|
+ for (File _file: files) {
|
|
|
|
+ res.add(_file.getName());
|
|
|
|
+ }
|
|
|
|
+ return CommonResult.success(res);
|
|
|
|
+ }
|
|
}
|
|
}
|