收藏
()
| 67 | |
| 68 | //收藏 |
| 69 | func (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 | //关注 |
| 97 | func (this *UserController) Follow() { |
no test coverage detected