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

Method Get2Download

models/ebook.go:68–76  ·  view source on GitHub ↗
(bookId int, ext string)

Source from the content-addressed store, hash-verified

66}
67
68func (m *Ebook) Get2Download(bookId int, ext string) (ebook Ebook) {
69 o := orm.NewOrm()
70 o.QueryTable(m).Filter("book_id", bookId).Filter("ext", ext).OrderBy("-id").One(&ebook)
71 if ebook.Id > 0 {
72 ebook.DownloadCount = ebook.DownloadCount + 1
73 o.Update(&ebook)
74 }
75 return
76}
77
78func (m *Ebook) GetEBook(id int) (book Ebook) {
79 if id <= 0 {

Callers 1

ExportMethod · 0.80

Calls 1

UpdateMethod · 0.45

Tested by

no test coverage detected