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

Method FindByBookIdAndDocIdentify

models/document.go:164–171  ·  view source on GitHub ↗

根据指定字段查询一条文档.

(BookId, Identify interface{})

Source from the content-addressed store, hash-verified

162
163//根据指定字段查询一条文档.
164func (m *Document) FindByBookIdAndDocIdentify(BookId, Identify interface{}) (*Document, error) {
165 q := orm.NewOrm().QueryTable(m.TableNameWithPrefix()).Filter("BookId", BookId)
166 err := q.Filter("Identify", Identify).One(m)
167 if m.DocumentId == 0 && !strings.HasSuffix(fmt.Sprint(Identify), ".md") {
168 err = q.Filter("identify", fmt.Sprint(Identify)+".md").One(m)
169 }
170 return m, err
171}
172
173//递归删除一个文档.
174func (m *Document) RecursiveDocument(docId int) error {

Callers 4

ReadMethod · 0.95
ReadMethod · 0.95
CreateMethod · 0.80
UploadMethod · 0.80

Calls 1

TableNameWithPrefixMethod · 0.95

Tested by

no test coverage detected