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

Method Find

models/document.go:80–93  ·  view source on GitHub ↗

根据文档ID查询指定文档.

(id int)

Source from the content-addressed store, hash-verified

78
79//根据文档ID查询指定文档.
80func (m *Document) Find(id int) (doc *Document, err error) {
81 if id <= 0 {
82 return m, ErrInvalidParameter
83 }
84
85 o := orm.NewOrm()
86
87 err = o.QueryTable(m.TableNameWithPrefix()).Filter("document_id", id).One(m)
88 if err == orm.ErrNoRows {
89 return m, ErrDataNotExist
90 }
91
92 return m, nil
93}
94
95// ReplaceIdentify 重命名文件文档标识之后,要重新替换内容中的旧文档链接为新的文档链接。
96func (m *Document) ReplaceIdentify(bookId int, oldIdentify, newIdentify string) {

Callers 9

ReadMethod · 0.95
sortBySummaryMethod · 0.95
ReadMethod · 0.95
CrawlHtml2MarkdownFunction · 0.95
RecursiveDocumentMethod · 0.95
BookStackCrawlMethod · 0.95
SplitMarkdownAndStoreMethod · 0.95
ReleaseContentMethod · 0.45
GenerateBookMethod · 0.45

Calls 1

TableNameWithPrefixMethod · 0.95

Tested by

no test coverage detected