Пример #1
0
  @RequestMapping(value = "/createPng", method = RequestMethod.POST)
  @ResponseStatus(HttpStatus.OK)
  public Response createPng(@RequestBody Map params) {

    Response response = new Response();
    try {
      String clusterName = params.get("clusterName").toString();
      EngineService engineService = this.getEngineService(clusterName);

      VisualService service = engineService.getVisualService();
      Map resultMap = service.createPng(params);

      if ((boolean) resultMap.get("success")) {
        response.setSuccess(true);
        response.getMap().putAll(resultMap);
      } else {
        response.setSuccess(false);
      }

    } catch (Exception ex) {
      response.setSuccess(false);
      response.getError().setMessage(ex.getMessage());
      if (ex.getCause() != null) response.getError().setCause(ex.getCause().getMessage());
      response.getError().setException(ExceptionUtils.getFullStackTrace(ex));
      logger.info(ex.toString());
    }
    return response;
  }