コード例 #1
0
  public String findEventsJson() {
    try {
      List<FpageEvent> fpageEventlist =
          fpageEventService.getFpageEventListByIssueIdAndPageNo(issueId, pageNo);

      this.jsonResult = new JsonResult();
      this.jsonResult.setCode(JsonResult.CODE.SUCCESS);
      this.jsonResult.setMessage(JsonResult.MESSAGE.SUCCESS);
      this.jsonResult.put("fpageEventlist", fpageEventlist);

    } catch (Exception e) {
      e.printStackTrace();
      this.generateJsonResult(JsonResult.CODE.EXCEPTION, "服务器内部错误");
    }
    return JSON;
  }
コード例 #2
0
  public String addJson() {
    try {
      ActionContext ctx = ActionContext.getContext();
      HttpServletRequest request = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST);
      BufferedInputStream inputStream = new BufferedInputStream(request.getInputStream());

      FpageEvent fpageEvent = new FpageEvent();
      fpageEvent.setIssueId(issueId);
      // fpageEvent.setPublicationId(issueService.queryById(issueId).getPublicationId());
      fpageEvent.setPageNo(start);
      fpageEvent.setEndPageNo(end);
      fpageEvent.setDescription(description);
      fpageEvent.setTitle(title);
      if (description != null) {
        fpageEvent.setDescription(java.net.URLDecoder.decode(description));
      }
      if (title != null) {
        fpageEvent.setTitle(java.net.URLDecoder.decode(title));
      }
      fpageEvent.setWidth(width);
      fpageEvent.setHeight(height);
      fpageEvent.setAdId(adId);
      System.out.println("--->:" + tagStr);
      String[] arr = null;
      if (StringUtil.isNotBlank(tagStr)) { // 添加标签(事件)
        tagStr = java.net.URLDecoder.decode(tagStr);
        arr = tagStr.split(";");
      }

      this.jsonResult =
          fpageEventService.addJson(
              fpageEvent,
              inputStream,
              (Admin) ctx.getSession().get(WebConstant.SESSION.ADMIN),
              arr);

    } catch (Exception e) {
      e.printStackTrace();
      this.generateJsonResult(JsonResult.CODE.EXCEPTION, "服务器内部错误");
    }
    return JSON;
  }