class AssetController {

    @GetMapping(value = "/v1/list/application")
    public ResponseEntity<Object> getListOfApplications(@RequestParam(name = "ag", required = true) String assetGroup,
            @RequestParam(name = "domain", required = false) String domain) {
        Map<String, Object> response = new HashMap<>();
        try {
            List<Map<String, Object>> appNames = assetService.getApplicationsByAssetGroup(assetGroup, domain);
            response.put("ag", assetGroup);
            response.put("applications", appNames);
            return ResponseUtils.buildSucessResponse(response);
        } catch (Exception e) {
            LOGGER.error("Error fetching application for asset group " + assetGroup, e);
            return ResponseUtils.buildFailureResponse(new Exception(
                    "No applications found for the asset group . Please check the asset group configuration"));
        }
    }

}