|
@@ -27,10 +27,10 @@ public class ArticleTemplateController {
|
|
|
@Autowired
|
|
|
ArticleService articleService;
|
|
|
|
|
|
- @GetMapping("/pageList") // 这里的 PageBean 是事先定义好的实体类
|
|
|
- public Object PageList(Model model, Integer pageIndex, Integer pageSize,
|
|
|
- @RequestParam(required = false) String info)
|
|
|
+ @GetMapping("/pageList/{pageIndex}") // 这里的 PageBean 是事先定义好的实体类
|
|
|
+ public Object PageList(Model model, Integer pageIndex, @RequestParam(required = false) String info)
|
|
|
{
|
|
|
+ Integer pageSize=10;
|
|
|
// 定义格式化器
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
List<Article> articleList= articleService.PageList(pageIndex,pageSize,info);
|
|
@@ -64,8 +64,8 @@ public class ArticleTemplateController {
|
|
|
model.addAttribute("articles", articles);
|
|
|
return "articleList";
|
|
|
}
|
|
|
- @GetMapping("/articleDetail") // 这里的 PageBean 是事先定义好的实体类
|
|
|
- public Object articleDetail(Model model,@RequestParam("id") Integer id)
|
|
|
+ @GetMapping("/articleDetail/{id}") // 这里的 PageBean 是事先定义好的实体类
|
|
|
+ public Object articleDetail(Model model,Integer id)
|
|
|
{
|
|
|
// 定义格式化器
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|