MCPcopy Index your code
hub / github.com/TruthHun/DocHub / Download

Method Download

controllers/HomeControllers/ViewController.go:90–105  ·  view source on GitHub ↗

文档下载

()

Source from the content-addressed store, hash-verified

88
89//文档下载
90func (this *ViewController) Download() {
91 id, _ := this.GetInt(":id")
92 if id <= 0 {
93 this.ResponseJson(false, "文档id不正确")
94 }
95
96 if this.IsLogin == 0 {
97 this.ResponseJson(false, "请先登录")
98 }
99
100 link, err := models.NewUser().CanDownloadFile(this.IsLogin, id)
101 if err != nil {
102 this.ResponseJson(false, err.Error())
103 }
104 this.ResponseJson(true, "下载链接获取成功", map[string]interface{}{"url": link})
105}
106
107//是否可以免费下载
108func (this *ViewController) DownFree() {

Callers

nothing calls this directly

Calls 2

CanDownloadFileMethod · 0.80
ResponseJsonMethod · 0.45

Tested by

no test coverage detected