java-parse-get-status config implementation done
This commit is contained in:
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.olympus.apollo.dto.ResultDTO;
|
||||
import com.olympus.apollo.feign.services.JavaParserModuleService;
|
||||
import com.olympus.apollo.models.ParseProcess;
|
||||
import com.olympus.apollo.services.GitService;
|
||||
import com.olympus.dto.JavaParseRequest;
|
||||
import org.slf4j.Logger;
|
||||
@@ -105,4 +106,9 @@ public class TestController {
|
||||
javaParserModuleService.getJavaParsedDetails(javaParseRequest);
|
||||
return ResponseEntity.accepted().body("Request to parse the java application is being processed");
|
||||
}
|
||||
|
||||
@GetMapping("get-parse-status")
|
||||
public ResponseEntity<Object> getParseStatus(@RequestParam String id){
|
||||
return javaParserModuleService.getParseStatusDetails(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.olympus.apollo.feign.services;
|
||||
|
||||
import com.olympus.apollo.models.ParseProcess;
|
||||
import com.olympus.feign.JavaParserModule;
|
||||
import com.olympus.dto.JavaParseRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -13,8 +15,12 @@ public class JavaParserModuleService {
|
||||
@Autowired
|
||||
private JavaParserModule javaParserModule;
|
||||
|
||||
@Async
|
||||
|
||||
public void getJavaParsedDetails(JavaParseRequest javaParseRequest){
|
||||
CompletableFuture.completedFuture(javaParserModule.getJavaParsedDetails(javaParseRequest));
|
||||
}
|
||||
|
||||
public ResponseEntity<Object> getParseStatusDetails(String parseId){
|
||||
return javaParserModule.getParseStatus(parseId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,5 @@ public class KSGitInfo {
|
||||
private String parseStatus;
|
||||
private String reverseEngineeringStatus;
|
||||
private String codeType;
|
||||
private String parseId;
|
||||
}
|
||||
|
||||
42
src/main/java/com/olympus/apollo/models/ParseProcess.java
Normal file
42
src/main/java/com/olympus/apollo/models/ParseProcess.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package com.olympus.apollo.models;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Document(collection = "parse_process")
|
||||
@Getter
|
||||
@Setter
|
||||
public class ParseProcess {
|
||||
|
||||
public ParseProcess(String applicationName) {
|
||||
this.applicationName = applicationName;
|
||||
this.status = "IN_PROGRESS";
|
||||
this.parsedFiles = 0;
|
||||
this.startDate = new Date();
|
||||
}
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
private String repositoryId;
|
||||
|
||||
private String applicationName;
|
||||
|
||||
private Integer totalFiles;
|
||||
|
||||
private Integer parsedFiles;
|
||||
|
||||
private String currentFile;
|
||||
|
||||
private Date startDate;
|
||||
|
||||
private Date endDate;
|
||||
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user