diff options
Diffstat (limited to 'ecomp-sdk/epsdk-app-common/src')
-rw-r--r-- | ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java index ff80d413..24e44d4b 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java @@ -139,6 +139,24 @@ public class ProfileSearchController extends RestrictedBaseController { logger.error(EELFLoggerDelegate.applicationLogger, "getUserPagination failed", e); } } + + @RequestMapping(value = { "/get_all_users" }, method = RequestMethod.GET) + public void getAllUsers(HttpServletRequest request, HttpServletResponse response) { + Map<String, Object> model = new HashMap<>(); + ObjectMapper mapper = new ObjectMapper(); + logger.info(EELFLoggerDelegate.applicationLogger, "Initiating get_all_users in ProfileSearchController"); + List<User> profileList = null; + try { + profileList = service.listAllUsers(); + model.put("profileList", mapper.writeValueAsString(profileList)); + JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); + JSONObject j = new JSONObject(msg); + response.setContentType(APPLICATION_JSON); + response.getWriter().write(j.toString()); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.applicationLogger, "getAllUsers failed", e); + } + } @SuppressWarnings("unchecked") private Map<String, Object> setDashboardData(HttpServletRequest request) |