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

Method getBookIdByIdentify

controllers/api/BaseController.go:251–259  ·  view source on GitHub ↗

根据标识查询书籍id,标识可以是数字也可以是字符串

(identify string)

Source from the content-addressed store, hash-verified

249
250// 根据标识查询书籍id,标识可以是数字也可以是字符串
251func (this *BaseController) getBookIdByIdentify(identify string) (bookId int) {
252 bookId, _ = strconv.Atoi(identify)
253 if bookId > 0 {
254 return
255 }
256 book := models.NewBook()
257 orm.NewOrm().QueryTable(book).Filter("identify", identify).One(book, "book_id")
258 return book.BookId
259}

Callers 6

GetBookmarksMethod · 0.80
StarMethod · 0.80
PostCommentMethod · 0.80
SearchDocMethod · 0.80
GetCommentsMethod · 0.80
RelatedBookMethod · 0.80

Calls 1

NewBookFunction · 0.92

Tested by

no test coverage detected