testing request with parameters

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2024-10-20 20:28:38 +02:00
parent ea47e63660
commit f1554f1131
2 changed files with 8 additions and 1 deletions

View File

@@ -1,9 +1,16 @@
package dev.mars3142.fhq.client; package dev.mars3142.fhq.client;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.service.annotation.GetExchange; import org.springframework.web.service.annotation.GetExchange;
public interface TimeZoneClient { public interface TimeZoneClient {
@GetExchange("/v1/timezone") @GetExchange("/v1/timezone")
String getTimeZone(); String getTimeZone();
@GetExchange("/v1/timezone/{area}")
String getTimeZone(@PathVariable String area);
@GetExchange("/v1/timezone/{area}/{location}")
String getTimeZone(@PathVariable String area, @PathVariable String location);
} }

View File

@@ -15,7 +15,7 @@ import lombok.val;
public class LandingPageView extends Composite<VerticalLayout> { public class LandingPageView extends Composite<VerticalLayout> {
public LandingPageView(TimeZoneClient client) { public LandingPageView(TimeZoneClient client) {
val timeZone = client.getTimeZone(); val timeZone = client.getTimeZone("Europe", "Berlin");
val verticalLayout = new VerticalLayout(); val verticalLayout = new VerticalLayout();
verticalLayout.setSizeFull(); verticalLayout.setSizeFull();
verticalLayout.add(new Text(timeZone)); verticalLayout.add(new Text(timeZone));