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

Method FindListByBookId

models/document.go:558–568  ·  view source on GitHub ↗

根据书籍ID查询文档列表(含文档内容).

(bookId int, withoutContent ...bool)

Source from the content-addressed store, hash-verified

556
557//根据书籍ID查询文档列表(含文档内容).
558func (m *Document) FindListByBookId(bookId int, withoutContent ...bool) (docs []*Document, err error) {
559 q := orm.NewOrm().QueryTable(m.TableNameWithPrefix()).Filter("book_id", bookId).OrderBy("order_sort")
560 if len(withoutContent) > 0 && withoutContent[0] {
561 cols := []string{"document_id", "identify", "document_name", "book_id", "vcnt", "version",
562 "modify_time", "member_id", "create_time", "order_sort", "parent_id"}
563 _, err = q.All(&docs, cols...)
564 } else {
565 _, err = q.All(&docs)
566 }
567 return
568}
569
570//根据书籍ID查询文档一级目录.
571func (m *Document) GetMenuTop(bookId int) (docs []*Document, err error) {

Callers 3

BookMenuMethod · 0.80
GenerateBookMethod · 0.80
generateMethod · 0.80

Calls 2

TableNameWithPrefixMethod · 0.95
AllMethod · 0.45

Tested by

no test coverage detected