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

Method AttachDetailed

controllers/ManagerController.go:769–789  ·  view source on GitHub ↗

附件详情.

()

Source from the content-addressed store, hash-verified

767
768// 附件详情.
769func (this *ManagerController) AttachDetailed() {
770
771 attachId, _ := strconv.Atoi(this.Ctx.Input.Param(":id"))
772 if attachId <= 0 {
773 this.Abort("404")
774 }
775
776 attach, err := models.NewAttachmentResult().Find(attachId)
777 if err != nil {
778 beego.Error("AttachDetailed => ", err)
779 if err == orm.ErrNoRows {
780 this.Abort("404")
781 }
782 this.Abort("404")
783 }
784
785 attach.HttpPath = this.BaseUrl() + attach.HttpPath
786 attach.IsExist = utils.FileExists(attach.FilePath)
787 this.Data["Model"] = attach
788 this.TplName = "manager/attach_detailed.html"
789}
790
791// 删除附件.
792func (this *ManagerController) AttachDelete() {

Callers

nothing calls this directly

Calls 4

NewAttachmentResultFunction · 0.92
FileExistsFunction · 0.92
BaseUrlMethod · 0.80
FindMethod · 0.45

Tested by

no test coverage detected