()
| 34 | } |
| 35 | |
| 36 | func (this *LoginedController) GetBookmarks() { |
| 37 | bookId := this.getBookIdByIdentify(this.GetString("identify")) |
| 38 | if bookId <= 0 { |
| 39 | this.Response(http.StatusBadRequest, messageBadRequest) |
| 40 | } |
| 41 | |
| 42 | lists, _, _ := models.NewBookmark().List(this.isLogin(), bookId) |
| 43 | |
| 44 | for idx, item := range lists { |
| 45 | item.Id = 0 |
| 46 | item.CreateAtTime = time.Unix(int64(item.CreateAt), 0) |
| 47 | lists[idx] = item |
| 48 | } |
| 49 | |
| 50 | this.Response(http.StatusOK, messageSuccess, map[string]interface{}{"bookmarks": lists}) |
| 51 | } |
| 52 | |
| 53 | // 收藏书籍(将书籍加入书架)/移除书籍 |
| 54 | func (this *LoginedController) Star() { |
nothing calls this directly
no test coverage detected