C:/Softwares_info/soft_installation/git/Git/parsejava api added to call a request method from java-parser-module
This commit is contained in:
12
pom.xml
12
pom.xml
@@ -72,6 +72,10 @@
|
|||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.ai</groupId>
|
<groupId>org.springframework.ai</groupId>
|
||||||
@@ -112,8 +116,14 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-security</artifactId>
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.olympus</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -4,16 +4,18 @@ import org.springframework.boot.SpringApplication;
|
|||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
|
||||||
import com.olympus.apollo.properties.StorageProperties;
|
import com.olympus.apollo.properties.StorageProperties;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication(scanBasePackages = {"com.olympus.apollo", "com.olympus.feign"})
|
||||||
@EnableConfigurationProperties(StorageProperties.class)
|
@EnableConfigurationProperties(StorageProperties.class)
|
||||||
@EnableAsync
|
@EnableAsync
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableDiscoveryClient
|
@EnableDiscoveryClient
|
||||||
|
@EnableFeignClients(basePackages = "com.olympus.feign")
|
||||||
public class ApolloApplication {
|
public class ApolloApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -1,20 +1,17 @@
|
|||||||
package com.olympus.apollo.controllers;
|
package com.olympus.apollo.controllers;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
|
|
||||||
import com.olympus.apollo.dto.ResultDTO;
|
import com.olympus.apollo.dto.ResultDTO;
|
||||||
|
import com.olympus.apollo.feign.services.JavaParserModuleService;
|
||||||
import com.olympus.apollo.services.GitService;
|
import com.olympus.apollo.services.GitService;
|
||||||
|
import com.olympus.dto.JavaParseRequest;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.olympus.apollo.dto.IngestionOutput;
|
import com.olympus.apollo.dto.IngestionOutput;
|
||||||
import com.olympus.apollo.services.GitRepositoryIngestor;
|
import com.olympus.apollo.services.GitRepositoryIngestor;
|
||||||
@@ -33,6 +30,9 @@ public class TestController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
GitService gitService;
|
GitService gitService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
JavaParserModuleService javaParserModuleService;
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(TestController.class);
|
private static final Logger logger = LoggerFactory.getLogger(TestController.class);
|
||||||
|
|
||||||
@GetMapping("test/ingestion_loop")
|
@GetMapping("test/ingestion_loop")
|
||||||
@@ -99,4 +99,10 @@ public class TestController {
|
|||||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorOutput);
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorOutput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/parsejava")
|
||||||
|
public ResponseEntity<String> fetchParsedJava(@RequestBody JavaParseRequest javaParseRequest){
|
||||||
|
javaParserModuleService.getJavaParsedDetails(javaParseRequest);
|
||||||
|
return ResponseEntity.accepted().body("Request to parse the java application is being processed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.olympus.apollo.feign.services;
|
||||||
|
|
||||||
|
import com.olympus.feign.JavaParserModule;
|
||||||
|
import com.olympus.dto.JavaParseRequest;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class JavaParserModuleService {
|
||||||
|
@Autowired
|
||||||
|
private JavaParserModule javaParserModule;
|
||||||
|
|
||||||
|
@Async
|
||||||
|
public void getJavaParsedDetails(JavaParseRequest javaParseRequest){
|
||||||
|
CompletableFuture.completedFuture(javaParserModule.getJavaParsedDetails(javaParseRequest));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -52,4 +52,6 @@ eureka:
|
|||||||
|
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
root: INFO
|
root: INFO
|
||||||
|
#feign: DEBUG
|
||||||
|
#org.springframework.web.client: DEBUG
|
||||||
Reference in New Issue
Block a user