MCPcopy Index your code
hub / github.com/TruthHun/BookStack / Index

Method Index

controllers/UserController.go:42–66  ·  view source on GitHub ↗

首页

()

Source from the content-addressed store, hash-verified

40
41//首页
42func (this *UserController) Index() {
43
44 page, _ := this.GetInt("page")
45 pageSize := 10
46 if page < 1 {
47 page = 1
48 }
49 books, totalCount, _ := models.NewBook().FindToPager(page, pageSize, this.UcenterMember.MemberId, "", 0)
50 this.Data["Books"] = books
51
52 if totalCount > 0 {
53 html := utils.NewPaginations(conf.RollPage, totalCount, pageSize, page, beego.URLFor("UserController.Index", ":username", this.UcenterMember.Account), "")
54 this.Data["PageHtml"] = html
55 } else {
56 this.Data["PageHtml"] = ""
57 }
58 this.Data["Total"] = totalCount
59 this.GetSeoByPage("ucenter-share", map[string]string{
60 "title": "分享 - " + this.UcenterMember.Nickname,
61 "keywords": "用户主页," + this.UcenterMember.Nickname,
62 "description": this.Sitename + "专注于文档在线写作、协作、分享、阅读与托管,让每个人更方便地发布、分享和获得知识。",
63 })
64
65 this.TplName = "user/index.html"
66}
67
68//收藏
69func (this *UserController) Collection() {

Callers

nothing calls this directly

Calls 4

NewBookFunction · 0.92
NewPaginationsFunction · 0.92
GetSeoByPageMethod · 0.80
FindToPagerMethod · 0.45

Tested by

no test coverage detected