コード例 #1
0
  /** 查看的Json格式数据,为APP端提供数据 */
  @RequestMapping(value = "/look/json")
  public @ResponseBody ReturnDatas lookjson(
      Model model, HttpServletRequest request, HttpServletResponse response) throws Exception {
    ReturnDatas returnObject = ReturnDatas.getSuccessReturnDatas();
    String id = request.getParameter("id");
    if (StringUtils.isNotBlank(id)) {
      AuditLog auditlog = auditlogService.findAuditlogById(id);
      returnObject.setData(auditlog);
    } else {
      returnObject.setStatus(ReturnDatas.ERROR);
    }

    return returnObject;
  }
コード例 #2
0
  /**
   * json数据,为APP提供数据
   *
   * @param request
   * @param model
   * @param auditlog
   * @return
   * @throws Exception
   */
  @RequestMapping("/list/json")
  public @ResponseBody ReturnDatas listjson(
      HttpServletRequest request, Model model, AuditLog auditlog) throws Exception {
    ReturnDatas returnObject = ReturnDatas.getSuccessReturnDatas();

    Page page = newPage(request);
    page.setOrder("operationTime");
    page.setSort("desc");

    List<AuditLog> datas =
        auditlogService.findListDataByFinder(null, page, AuditLog.class, auditlog);
    returnObject.setQueryBean(auditlog);
    returnObject.setPage(page);
    returnObject.setData(datas);
    return returnObject;
  }