class FAQSController {

    @RequestMapping(path = "/v1/faqs", method = RequestMethod.GET)
    public ResponseEntity<Object> getFAQSByWidget(
            @RequestParam("widgetId") String widgetId,
            @RequestParam(name = "domainId", required = false) String domainId) {
        if (Strings.isNullOrEmpty(widgetId)) {
            return ResponseUtils.buildFailureResponse(new Exception(
                    "WidgetId is Mandatory"));
        }
        ResponseDTO response=null;
        try {
            response = new ResponseDTO(faqService.getFAQSByWidget(widgetId,
                    domainId));
        } catch (ServiceException e) {
            LOGGER.error(e.getMessage());
           return complianceService.formatException(e);
        }
        return ResponseUtils.buildSucessResponse(response);
    }

}