增加分页

This commit is contained in:
zhangchao
2024-11-26 18:41:24 +08:00
parent 9e86444456
commit 0802267989
2 changed files with 38 additions and 3 deletions

View File

@@ -91,6 +91,8 @@ func registerRoutes(r *gin.Engine) {
models.DB.Select("*").Offset(offset).Limit(pager.PageSize).Find(&items, "type = ?", "post")
c.HTML(http.StatusOK, "index.tmpl", gin.H{
"Items": items,
"Pager": pager,
"Title": "文章列表",
})
})
r.GET("/createcontent", func(c *gin.Context) {