@RequestMapping(method = RequestMethod.GET) public String index(@RequestParam(value = "page", defaultValue = "1") int page, Model model) { PageModel<PostVO> pageModel = postManager.listPost(page, 15); model.addAttribute("page", pageModel); model.addAttribute("categorys", categoryService.list()); return "backend/post/list"; }
@RequestMapping(value = "/edit", method = RequestMethod.GET) public String edit(String pid, Model model) { if (!StringUtils.isBlank(pid)) { model.addAttribute("post", postManager.loadReadById(pid)); } model.addAttribute("categorys", categoryService.list()); return "backend/post/edit"; }