|
23 | 23 | * @author wind57 |
24 | 24 | */ |
25 | 25 | @RestController |
26 | | -public class Controller { |
27 | | - |
28 | | - private final LeftProperties leftProperties; |
29 | | - |
30 | | - private final RightProperties rightProperties; |
31 | | - |
32 | | - private final RightWithLabelsProperties rightWithLabelsProperties; |
| 26 | +class Controller { |
33 | 27 |
|
34 | 28 | private final ConfigMapProperties configMapProperties; |
35 | 29 |
|
36 | | - private final SecretProperties secretProperties; |
37 | | - |
38 | | - public Controller(LeftProperties leftProperties, RightProperties rightProperties, |
39 | | - RightWithLabelsProperties rightWithLabelsProperties, ConfigMapProperties configMapProperties, |
40 | | - SecretProperties secretProperties) { |
41 | | - this.leftProperties = leftProperties; |
42 | | - this.rightProperties = rightProperties; |
43 | | - this.rightWithLabelsProperties = rightWithLabelsProperties; |
| 30 | + Controller(ConfigMapProperties configMapProperties) { |
44 | 31 | this.configMapProperties = configMapProperties; |
45 | | - this.secretProperties = secretProperties; |
46 | | - } |
47 | | - |
48 | | - @GetMapping("/left") |
49 | | - public String left() { |
50 | | - return leftProperties.getValue(); |
51 | | - } |
52 | | - |
53 | | - @GetMapping("/right") |
54 | | - public String right() { |
55 | | - return rightProperties.getValue(); |
56 | | - } |
57 | | - |
58 | | - @GetMapping("/with-label") |
59 | | - public String witLabel() { |
60 | | - return rightWithLabelsProperties.getValue(); |
61 | 32 | } |
62 | 33 |
|
63 | 34 | @GetMapping("/key") |
64 | | - public String key() { |
| 35 | + String key() { |
65 | 36 | return configMapProperties.getKey(); |
66 | 37 | } |
67 | 38 |
|
68 | | - @GetMapping("/key-from-secret") |
69 | | - public String keyFromSecret() { |
70 | | - return secretProperties.getKey(); |
71 | | - } |
72 | | - |
73 | 39 | } |
0 commit comments