de.adorsys.ledgers.rest.posting.controller.HealthController Maven / Gradle / Ivy
package de.adorsys.ledgers.rest.posting.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.security.Principal;
@RestController
public class HealthController {
private final Principal principal;
public HealthController(Principal principal) {
this.principal = principal;
}
@GetMapping("/greeting")
public String greeting(@RequestParam(name = "name", required = false, defaultValue = "World") String name) {
return "greeting " + name + " Principal=" + principal.getName();
}
}