-
Notifications
You must be signed in to change notification settings - Fork 0
/
ValuePropertiesController.java
28 lines (24 loc) · 1.08 KB
/
ValuePropertiesController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.github.springfox.loader.valueproperties;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/springfox-loader", method = RequestMethod.GET)
public class ValuePropertiesController {
private ValuePropertiesLocator valuePropertiesLocator;
public void setValuePropertiesLocator(ValuePropertiesLocator valuePropertiesLocator) {
this.valuePropertiesLocator = valuePropertiesLocator;
}
@ApiOperation("List the Value-annotations (springfox-loader)")
@GetMapping("/valueprops")
public ResponseEntity<?> getValueProperties() {
if (valuePropertiesLocator == null) {
return ResponseEntity.notFound().build();
} else {
return ResponseEntity.ok(valuePropertiesLocator.getProperties());
}
}
}