This commit is contained in:
Florinda
2024-12-19 12:26:13 +01:00
3 changed files with 37 additions and 17 deletions

View File

@@ -1,22 +1,32 @@
package com.olympus.apollo.feign.services;
import com.olympus.dto.CommonParseRequest;
import com.olympus.model.apollo.KSGitInfo;
import com.olympus.apollo.repository.KSGitInfoRepository;
import com.olympus.dto.ApolloParseRequestDTO;
import com.olympus.feign.JavaParserModule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import com.olympus.apollo.repository.KSGitInfoRepository;
import com.olympus.dto.ApolloParseRequestDTO;
import com.olympus.dto.CommonParseRequest;
import com.olympus.feign.GenericParserModule;
import com.olympus.feign.JavaParserModule;
import com.olympus.feign.JspParserModule;
import com.olympus.model.apollo.KSGitInfo;
@Service
public class ParserModuleService {
@Autowired
private JavaParserModule javaParserModule;
@Autowired
private JspParserModule jspParserModule;
@Autowired
private GenericParserModule genericParserModule;
@Autowired
KSGitInfoRepository ksGitInfoRepository;
@@ -45,7 +55,10 @@ public class ParserModuleService {
CompletableFuture.completedFuture(javaParserModule.getJavaParsedDetails(commonParseRequest));
}
if(codeType.getType().equalsIgnoreCase("jsp")) {
System.out.println("JSP Parser Module");
CompletableFuture.completedFuture(jspParserModule.getJspParsedDetails(commonParseRequest));
}
if(codeType.getType().equalsIgnoreCase("generic")) {
CompletableFuture.completedFuture(genericParserModule.getGenericParsedDetails(commonParseRequest));
}
});
};

View File

@@ -1,15 +1,16 @@
package com.olympus.apollo.feign.services;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import com.olympus.apollo.repository.KSGitInfoRepository;
import com.olympus.dto.ApolloParseRequestDTO;
import com.olympus.dto.CommonReverseEngRequest;
import com.olympus.feign.JavaREModule;
import com.olympus.model.apollo.KSGitInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import java.util.Optional;
@Service
public class REModuleService {
@@ -33,13 +34,15 @@ public class REModuleService {
commonReverseEngRequest.setCommitSha(gitInfo.getCommitId());
gitInfo.getCodeTypes().forEach(codeType -> {
if(codeType.getType().equalsIgnoreCase("java")){
/*if(codeType.getType().equalsIgnoreCase("java")){
commonReverseEngRequest.setApplicationType(codeType.getType());
System.out.println("value is :"+javaREModule.revApplication(commonReverseEngRequest));
}
if(codeType.getType().equalsIgnoreCase("jsp")) {
System.out.println("JSP Parser Module");
}
}*/
commonReverseEngRequest.setApplicationType(codeType.getType());
javaREModule.revApplication(commonReverseEngRequest);
});
}

View File

@@ -6,6 +6,10 @@ apollo:
url: "http://localhost:5173"
java-parser-module:
url: "http://localhost:8084"
jsp-parser-module:
url: "http://localhost:8089"
generic-file-parser-module:
url: "http://localhost:8085"
spring:
application:
name: apollo