예제 #1
0
  @RequestMapping("/self/message/list")
  public String listMessage(
      String type,
      Integer pageNum,
      Integer pageSize,
      Model model,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    User user = getCurrentUser();
    EntityView ev = new EntityView();
    Boolean sendbox = false;
    if (StringUtils.isNotBlank(type) && type.equals("send")) {
      sendbox = true;
      ev.add(Restrictions.eq("sender", user.getUserId()));
    } else {
      ev.add(Restrictions.eq("receiver", user.getUserId()));
    }

    PageContext<Message> pageCtx = messageMng.queryUsePage(ev, pageNum, 10);
    model.addAttribute("pageCtx", pageCtx);
    model.addAttribute("sendbox", sendbox);
    return "self/message/list";
  }
예제 #2
0
  @RequestMapping("/self/item/list")
  public String listItem(
      Integer pageNum, Model model, HttpServletRequest request, HttpServletResponse response)
      throws Exception {

    User user = getCurrentUser();
    EntityView ev = new EntityView();
    ev.add(Restrictions.eq("userId", user.getUserId()));
    PageContext<Item> pageCtx = itemMng.queryUsePage(ev, pageNum, 6);
    model.addAttribute("pageCtx", pageCtx);
    return "self/item_list";
  }