File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
backend/device-service/src/main/java/org/projectx/device Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 44import org .springframework .web .bind .annotation .GetMapping ;
55import org .springframework .web .bind .annotation .PathVariable ;
66import org .springframework .web .bind .annotation .PostMapping ;
7+ import reactor .core .publisher .Mono ;
78
89@ FeignClient ("token" )
910public interface TokenClient {
1011
1112 @ GetMapping ("/tokens/{deviceId}" )
12- TokenResponse getToken (@ PathVariable String deviceId );
13+ Mono < TokenResponse > getToken (@ PathVariable String deviceId );
1314
1415 @ PostMapping ("/tokens/{deviceId}" )
15- TokenResponse createToken (@ PathVariable String deviceId );
16+ Mono < TokenResponse > createToken (@ PathVariable String deviceId );
1617}
Original file line number Diff line number Diff line change 1+ package org .projectx .device .domain ;
2+
3+ import feign .Feign ;
4+ import org .projectx .device .client .TokenClient ;
5+ import org .projectx .device .client .TokenResponse ;
6+ import org .springframework .web .bind .annotation .*;
7+ import reactor .core .publisher .Mono ;
8+
9+ @ RestController
10+ @ RequestMapping ("/devices" )
11+ public class DeviceTokenController {
12+ private final TokenClient tokenClient ;
13+
14+ public DeviceTokenController (TokenClient tokenClient ) {
15+ this .tokenClient = tokenClient ;
16+ }
17+
18+ @ GetMapping ("/{deviceId}/token" )
19+ public Mono <TokenResponse > getDeviceToken (@ PathVariable String deviceId ) {
20+ return this .tokenClient .getToken (deviceId );
21+ }
22+
23+ @ PostMapping ("/{deviceId}/token" )
24+ public Mono <TokenResponse > createDeviceToken (@ PathVariable String deviceId ) {
25+ return this .tokenClient .createToken (deviceId );
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments