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

Method Exist

models/bookmarks.go:80–87  ·  view source on GitHub ↗

查询书签是否存在

(uid, docId int)

Source from the content-addressed store, hash-verified

78
79//查询书签是否存在
80func (m *Bookmark) Exist(uid, docId int) (exist bool) {
81 if uid*docId > 0 {
82 bk := new(Bookmark)
83 orm.NewOrm().QueryTable(bk).Filter("uid", uid).Filter("doc_id", docId).One(bk, "id")
84 return bk.Id > 0
85 }
86 return
87}
88
89//删除书签
90//1、只有 bookId > 0,则删除bookId所有书签【用于书籍被删除的情况】

Callers 4

SetBookmarksMethod · 0.95
DeleteBookmarksMethod · 0.95
InsertOrUpdateMethod · 0.45
InitMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected