Ejemplo n.º 1
0
  /* 首页 */
  @RequestMapping("/")
  public String index(ModelMap model) {
    Integer[][] groups =
        new Integer[][] {{17, 3}, {5, 8}, {7, 7}, {6, 6}, {4, 6}, {1, 8}, {2, 8}, {3, 8}};
    addAttributes("article", "more", groups, model);

    model.addAttribute(
        "articles",
        articleService.getService(
            0,
            4,
            "id",
            "desc",
            new Object[] {"articleCategoryId", "=", 4},
            new Object[] {"title", "like", "%大学%"}));
    return "/client/index";
  }
Ejemplo n.º 2
0
 /* 多篇类文章 - 单篇展示 */
 @RequestMapping("/articles/{id}")
 public String articles(@PathVariable Integer id, ModelMap model) {
   model.addAttribute("article", articleService.getService(id));
   return "/client/article/articles";
 }