Update dependencies and enable Feign client

This commit is contained in:
andrea.terzani
2024-10-10 15:41:11 +02:00
parent f050d682db
commit 810572162a
4 changed files with 61 additions and 14 deletions

30
pom.xml
View File

@@ -29,12 +29,10 @@
<properties>
<java.version>21</java.version>
<spring-ai.version>1.0.0-SNAPSHOT</spring-ai.version>
<spring-cloud.version>2023.0.3</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
@@ -89,16 +87,14 @@
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<version>4.1.3</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
<version>1.4.7.RELEASE</version>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
@@ -115,11 +111,12 @@
<dependency>
<groupId>com.olympus</groupId>
<artifactId>olympus-common</artifactId>
<artifactId>common</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
@@ -129,7 +126,14 @@
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>

View File

@@ -2,9 +2,11 @@ package com.olympus.hermione;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication
@SpringBootApplication(scanBasePackages = {"com.olympus.hermione", "com.olympus"})
@EnableFeignClients(basePackages = "com.olympus.feign")
@EnableAsync
public class HermioneApplication {

View File

@@ -0,0 +1,23 @@
package com.olympus.hermione.controllers;
import com.olympus.dto.TreeNode;
import com.olympus.feign.SourceCodeModule;
import com.olympus.hermione.services.SourceCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ApplicationBrowserController {
@Autowired
SourceCodeService sourceCodeService;
@GetMapping
public TreeNode getApplicationNode(String applicationName){
return sourceCodeService.getApplicationNode(applicationName);
}
}

View File

@@ -0,0 +1,18 @@
package com.olympus.hermione.services;
import com.olympus.dto.TreeNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.olympus.feign.SourceCodeModule;
@Service
public class SourceCodeService {
@Autowired
private SourceCodeModule sourceCodeModule;
public TreeNode getApplicationNode(String applicationName) {
return sourceCodeModule.getTreeFromNode(applicationName,"application");
}
}