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

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");
}
}