422f5a62615d733adcd3a523457e657ddfed45b1
[demos/testing] / src / main / java / de / juplo / demo / RemoteContentController.java
1 package de.juplo.demo;
2
3
4 import org.springframework.web.bind.annotation.GetMapping;
5 import org.springframework.web.bind.annotation.RequestParam;
6 import org.springframework.web.bind.annotation.RestController;
7 import reactor.core.publisher.Mono;
8
9
10 /**
11  * Fetches and returns data from remote-webserver.
12  * @author Kai Moritz
13  */
14 @RestController
15 public class RemoteContentController
16 {
17   RemoteContentService service;
18
19
20   public RemoteContentController(RemoteContentService service)
21   {
22     this.service = service;
23   }
24
25
26   @GetMapping("/")
27   public Mono<String> fetch(@RequestParam String path)
28   {
29     return service.getRemoteText(path);
30   }
31 }