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

Method Star

controllers/api/LoginedController.go:54–67  ·  view source on GitHub ↗

收藏书籍(将书籍加入书架)/移除书籍

()

Source from the content-addressed store, hash-verified

52
53// 收藏书籍(将书籍加入书架)/移除书籍
54func (this *LoginedController) Star() {
55 bookId := this.getBookIdByIdentify(this.GetString("identify"))
56 if bookId <= 0 {
57 this.Response(http.StatusBadRequest, messageBadRequest)
58 }
59
60 cancel, err := new(models.Star).Star(this.isLogin(), bookId)
61 data := map[string]bool{"is_cancel": cancel}
62 if err != nil {
63 beego.Error(err.Error())
64 }
65
66 this.Response(http.StatusOK, messageSuccess, map[string]interface{}{"data": data})
67}
68
69func (this *LoginedController) SetBookmarks() {
70 docId, _ := this.GetInt("doc_id")

Callers

nothing calls this directly

Calls 3

getBookIdByIdentifyMethod · 0.80
ResponseMethod · 0.80
isLoginMethod · 0.80

Tested by

no test coverage detected