文档下载
()
| 88 | |
| 89 | //文档下载 |
| 90 | func (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 | //是否可以免费下载 |
| 108 | func (this *ViewController) DownFree() { |
nothing calls this directly
no test coverage detected