diff options
author | 2018-07-10 14:20:54 +0300 | |
---|---|---|
committer | 2018-07-10 14:20:54 +0300 | |
commit | c72d565bb58226b20625b2bce5f0019046bee649 (patch) | |
tree | 8658e49595705b02e47ddc14afa20d6bb7123547 /vid-app-common/src/main/java/org/onap/vid/controllers/FeatureTogglingController.java | |
parent | ef8a6b47847012fd59ea20da21d8d3d7c4a301ed (diff) |
Merge 1806 code of vid-common
Change-Id: I75d52abed4a24dfe3827d79edc4a2938726aa87a
Issue-ID: VID-208
Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/controllers/FeatureTogglingController.java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/controllers/FeatureTogglingController.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controllers/FeatureTogglingController.java b/vid-app-common/src/main/java/org/onap/vid/controllers/FeatureTogglingController.java new file mode 100644 index 00000000..36dfdaa0 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/controllers/FeatureTogglingController.java @@ -0,0 +1,29 @@ +package org.onap.vid.controllers; + +import org.onap.vid.properties.Features; +import org.onap.portalsdk.core.controller.RestrictedBaseController; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("flags") +public class FeatureTogglingController extends RestrictedBaseController { + + @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody Map<String,Boolean> getFeatureToggles() + { + HashMap<String,Boolean> flags = new HashMap <String, Boolean>(); + for(Features flag : Features.values()){ + flags.put(flag.name(), flag.isActive()); + } + return flags; + + + } +} |