class VulnerabilityController implements Constants {

	@RequestMapping(path = "/v1/vulnerabilities/trend/notes", method = RequestMethod.GET)
	public ResponseEntity<Object> getTrendAnnotations(@RequestParam("ag") String assetGroup,
			@RequestParam(name = "from", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date from) {

		if (from == null) {
			Calendar cal = Calendar.getInstance();
			cal.setTimeZone(TimeZone.getTimeZone("UTC"));
			cal.add(Calendar.DATE, NEG_THIRTY);
			from = cal.getTime();
		}
		Map<String, Object> notes = new HashMap<>();
		try {
			notes.put("notes", vulnerabilityService.getTrendAnnotations(assetGroup, from));
		} catch (DataException e) {
			LOGGER.error("Error in getTrendAnnotations ", e);
			return ResponseUtils.buildFailureResponse(e);
		}
		return ResponseUtils.buildSucessResponse(notes);

	}

}