增加分页
This commit is contained in:
2
main.go
2
main.go
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user