class VulnerabilityController implements Constants {

	@RequestMapping(path = "/v1/vulnerabilities/distribution-vulntype", method = RequestMethod.GET)
	public ResponseEntity<Object> getDistributionSummaryByVulnType(@RequestParam("ag") String assetGroup,
			@RequestParam(name = "severity", required = false) String severity) {

		Map<String, Object> response = new HashMap<>();

		List<Map<String, Object>> distributionList = new ArrayList<>();
		try {
			distributionList = vulnerabilityService.getDistributionSummaryByVulnType(assetGroup, severity);
		} catch (DataException e) {
			LOGGER.error("Error in getDistributionSummaryByVulnType", e);
			return ResponseUtils.buildFailureResponse(e);
		}

		response.put(DISTRIBUTION, distributionList);
		return ResponseUtils.buildSucessResponse(response);

	}

}