enableAlphaFunctionality
This commit is contained in:
@@ -56,9 +56,8 @@ public class ApiDocService {
|
||||
JsonNode pathNode = entry.getValue();
|
||||
if (pathNode.has("post")) {
|
||||
JsonNode postNode = pathNode.get("post");
|
||||
String operation = path.substring(1); // Assuming operation name is the path without leading '/'
|
||||
ApiEndpoint endpoint = new ApiEndpoint(operation, postNode);
|
||||
apiDocumentation.put(operation, endpoint);
|
||||
ApiEndpoint endpoint = new ApiEndpoint(path, postNode);
|
||||
apiDocumentation.put(path, endpoint);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
@@ -68,7 +67,6 @@ public class ApiDocService {
|
||||
}
|
||||
|
||||
public boolean isValidOperation(String operationName, Map<String, Object> parameters) {
|
||||
System.out.println(apiDocumentation);
|
||||
if (!apiDocumentation.containsKey(operationName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -72,8 +72,14 @@ public class PipelineController {
|
||||
@Autowired
|
||||
private ApiDocService apiDocService;
|
||||
|
||||
|
||||
|
||||
|
||||
@Scheduled(fixedRate = 60000)
|
||||
public void scanFolders() {
|
||||
if(!Boolean.TRUE.equals(applicationProperties.getSystem().getEnableAlphaFunctionality())) {
|
||||
return;
|
||||
}
|
||||
Path watchedFolderPath = Paths.get(watchedFoldersDir);
|
||||
if (!Files.exists(watchedFolderPath)) {
|
||||
try {
|
||||
@@ -453,6 +459,10 @@ public class PipelineController {
|
||||
|
||||
@PostMapping("/handleData")
|
||||
public ResponseEntity<byte[]> handleData(@ModelAttribute HandleDataRequest request) {
|
||||
if(!Boolean.TRUE.equals(applicationProperties.getSystem().getEnableAlphaFunctionality())) {
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
MultipartFile[] files = request.getFileInput();
|
||||
String jsonString = request.getJson();
|
||||
if(files == null) {
|
||||
|
||||
Reference in New Issue
Block a user