Пример #1
0
  @RequestMapping(value = "/library/list", method = RequestMethod.GET)
  public String listLibrary(Model model, String page) {

    int pageNum = page == null ? 1 : Integer.valueOf(page);

    Page<LessonDocument> pageDoc = docDao.queryDocPage(pageNum, 15);
    model.addAttribute("page", pageDoc);
    model.addAttribute("currentPage", pageNum);

    return "admin/library/librarylist";
  }
Пример #2
0
  @RequestMapping(value = "/library/add", method = RequestMethod.POST)
  public String addLibrary(Model model, String doctype, int cate1, int cate2, MultipartFile doc) {

    System.out.println("file size : " + doc.getSize());

    if (!doc.isEmpty()) {
      docDao.saveFile(doctype, doc, cate1, cate2);
    }

    return "redirect:/admin/library/list";
  }