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

Method Collection

controllers/UserController.go:69–94  ·  view source on GitHub ↗

收藏

()

Source from the content-addressed store, hash-verified

67
68//收藏
69func (this *UserController) Collection() {
70 page, _ := this.GetInt("page")
71 cid, _ := this.GetInt("cid")
72 pageSize := 10
73 if page < 1 {
74 page = 1
75 }
76
77 totalCount, books, _ := new(models.Star).List(this.UcenterMember.MemberId, page, pageSize, cid)
78 this.Data["Books"] = books
79
80 if totalCount > 0 {
81 html := utils.NewPaginations(conf.RollPage, int(totalCount), pageSize, page, beego.URLFor("UserController.Collection", ":username", this.UcenterMember.Account), "")
82 this.Data["PageHtml"] = html
83 } else {
84 this.Data["PageHtml"] = ""
85 }
86 this.GetSeoByPage("ucenter-collection", map[string]string{
87 "title": "收藏 - " + this.UcenterMember.Nickname,
88 "keywords": "用户收藏," + this.UcenterMember.Nickname,
89 "description": this.Sitename + "专注于文档在线写作、协作、分享、阅读与托管,让每个人更方便地发布、分享和获得知识。",
90 })
91 this.Data["Total"] = totalCount
92 this.Data["Tab"] = "collection"
93 this.TplName = "user/collection.html"
94}
95
96//关注
97func (this *UserController) Follow() {

Callers 1

SortVersionItemsMethod · 0.80

Calls 3

NewPaginationsFunction · 0.92
GetSeoByPageMethod · 0.80
ListMethod · 0.45

Tested by

no test coverage detected