class ComplianceController implements Constants {

    @RequestMapping(path = "/v1/issues/count", method = RequestMethod.GET)
    public ResponseEntity<Object> getIssuesCount(@RequestParam("ag") String assetGroup,
            @RequestParam("domain") String domain, @RequestParam(name = "ruleId", required = false) String ruleId) {
        if (Strings.isNullOrEmpty(assetGroup) || Strings.isNullOrEmpty(domain)) {
            return ResponseUtils.buildFailureResponse(new Exception(ASSET_GROUP_DOMAIN));
        }
        Map<String, Long> response = new HashMap<>();
        try {
            response.put("total_issues", complianceService.getIssuesCount(assetGroup, ruleId, domain));
        } catch (ServiceException e) {
            return ResponseUtils.buildFailureResponse(e);
        }

        return ResponseUtils.buildSucessResponse(response);

    }

}