diff --git a/src/main/java/org/highmed/numportal/NumPortalApplication.java b/src/main/java/org/highmed/numportal/NumPortalApplication.java index 04be6b67..ba8d655f 100644 --- a/src/main/java/org/highmed/numportal/NumPortalApplication.java +++ b/src/main/java/org/highmed/numportal/NumPortalApplication.java @@ -1,8 +1,7 @@ package org.highmed.numportal; - +import org.highmed.numportal.properties.FeatureProperties; import org.highmed.numportal.service.atna.AtnaProperties; - import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -12,7 +11,7 @@ @EnableScheduling @EnableAsync @SpringBootApplication -@EnableConfigurationProperties({AtnaProperties.class}) +@EnableConfigurationProperties({AtnaProperties.class, FeatureProperties.class}) public class NumPortalApplication { public static void main(String[] args) { diff --git a/src/main/java/org/highmed/numportal/properties/FeatureProperties.java b/src/main/java/org/highmed/numportal/properties/FeatureProperties.java new file mode 100644 index 00000000..1cb9144b --- /dev/null +++ b/src/main/java/org/highmed/numportal/properties/FeatureProperties.java @@ -0,0 +1,9 @@ +package org.highmed.numportal.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +@Data +@ConfigurationProperties(prefix = "feature") +public class FeatureProperties { +} diff --git a/src/main/java/org/highmed/numportal/web/controller/FeatureController.java b/src/main/java/org/highmed/numportal/web/controller/FeatureController.java new file mode 100644 index 00000000..59443cd7 --- /dev/null +++ b/src/main/java/org/highmed/numportal/web/controller/FeatureController.java @@ -0,0 +1,25 @@ +package org.highmed.numportal.web.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import lombok.AllArgsConstructor; +import org.highmed.numportal.properties.FeatureProperties; +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.RestController; + +@RestController +@AllArgsConstructor +@RequestMapping(value = "/feature", produces = "application/json") +@SecurityRequirement(name = "security_auth") +public class FeatureController { + + FeatureProperties featureProperties; + + @GetMapping + @Operation(description = "Get feature flags") + public ResponseEntity getFeatureFlags() { + return ResponseEntity.ok(featureProperties); + } +} diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index ace7f238..a3075bdf 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -105,3 +105,5 @@ num: user-service: delete-users-cron: 0 0 5 * * * + +feature: