Refactor TestController to use ResponseEntity<Object> in RevEngApplication method

This commit is contained in:
sumedh
2024-10-28 14:44:30 +05:30
parent 30c4fee8f2
commit d67ed9f364
3 changed files with 4 additions and 4 deletions

View File

@@ -122,7 +122,7 @@ public class TestController {
} }
@PostMapping("/revenginnerapplication") @PostMapping("/revenginnerapplication")
public ResponseEntity<String> RevEngApplication(@RequestBody ApolloParseRequestDTO apolloParseRequestDTO){ public ResponseEntity<Object> RevEngApplication(@RequestBody ApolloParseRequestDTO apolloParseRequestDTO){
reModuleService.callReverseEngModules(apolloParseRequestDTO); reModuleService.callReverseEngModules(apolloParseRequestDTO);
return ResponseEntity.accepted().body("Request to reverse engineering application is being processed"); return ResponseEntity.accepted().body("Request to reverse engineering application is being processed");
} }

View File

@@ -6,6 +6,7 @@ import com.olympus.dto.CommonReverseEngRequest;
import com.olympus.feign.JavaREModule; import com.olympus.feign.JavaREModule;
import com.olympus.model.apollo.KSGitInfo; import com.olympus.model.apollo.KSGitInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Optional; import java.util.Optional;
@@ -35,12 +36,13 @@ public class REModuleService {
gitInfo.getCodeTypes().forEach(codeType -> { gitInfo.getCodeTypes().forEach(codeType -> {
if(codeType.getType().equalsIgnoreCase("java")){ if(codeType.getType().equalsIgnoreCase("java")){
commonReverseEngRequest.setApplicationType(codeType.getType()); commonReverseEngRequest.setApplicationType(codeType.getType());
CompletableFuture.completedFuture(javaREModule.revApplication(commonReverseEngRequest)); System.out.println("value is :"+javaREModule.revApplication(commonReverseEngRequest));
} }
if(codeType.getType().equalsIgnoreCase("jsp")) { if(codeType.getType().equalsIgnoreCase("jsp")) {
System.out.println("JSP Parser Module"); System.out.println("JSP Parser Module");
} }
}); });
} }
} }
} }

View File

@@ -4,8 +4,6 @@ server:
apollo: apollo:
fe: fe:
url: "http://localhost:5173" url: "http://localhost:5173"
java-parser-module:
url: "http://java-parser-module-service.olympus.svc.cluster.local:8080"
spring: spring:
application: application:
name: apollo name: apollo