MCPcopy Create free account
hub / github.com/TruthHun/BookStack / RenderCover

Method RenderCover

controllers/LocalhostController.go:69–92  ·  view source on GitHub ↗

渲染生成封面截图

()

Source from the content-addressed store, hash-verified

67
68// 渲染生成封面截图
69func (this *LocalhostController) RenderCover() {
70 identify := this.GetString("id")
71 id, err := strconv.Atoi(identify)
72 if identify == "" && err != nil {
73 this.Abort("404")
74 return
75 }
76 book := models.NewBook()
77 q := orm.NewOrm().QueryTable(book)
78 if id > 0 {
79 err = q.Filter("book_id", id).One(book)
80 } else {
81 err = q.Filter("identify", identify).One(book)
82 }
83 if err != nil {
84 beego.Error(err)
85 }
86 if book.BookId == 0 {
87 this.Abort("404")
88 return
89 }
90 this.Data["Book"] = book
91 this.TplName = "ebook/cover.html"
92}

Callers

nothing calls this directly

Calls 1

NewBookFunction · 0.92

Tested by

no test coverage detected