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

Method GetBookmarks

controllers/api/LoginedController.go:36–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36func (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// 收藏书籍(将书籍加入书架)/移除书籍
54func (this *LoginedController) Star() {

Callers

nothing calls this directly

Calls 5

NewBookmarkFunction · 0.92
getBookIdByIdentifyMethod · 0.80
ResponseMethod · 0.80
isLoginMethod · 0.80
ListMethod · 0.45

Tested by

no test coverage detected