附件详情.
()
| 767 | |
| 768 | // 附件详情. |
| 769 | func (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 | // 删除附件. |
| 792 | func (this *ManagerController) AttachDelete() { |
nothing calls this directly
no test coverage detected