All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.otto.edison.status.controller.DependenciesController Maven / Gradle / Ivy

There is a newer version: 3.3.3
Show newest version
package de.otto.edison.status.controller;

import de.otto.edison.annotations.Beta;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

import static java.util.Collections.singletonMap;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import static org.springframework.http.ResponseEntity.ok;

/**
 * @since 1.1.0
 */
@Beta
@RestController
public class DependenciesController {

    private final ExternalDependencies externalDependencies;

    @Autowired
    public DependenciesController(ExternalDependencies externalDependencies) {
        this.externalDependencies = externalDependencies;
    }

    @GetMapping(
            value = "${edison.application.management.base-path:/internal}/dependencies",
            produces = APPLICATION_JSON_VALUE)
    public ResponseEntity>> listDependencies () {
        Map> dependencies = singletonMap("dependencies", externalDependencies.getDependencies());
        return ok(dependencies);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy