mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2026-11-04 00:33:07 +00:00
Feat: file download in service level
This commit is contained in:
1 parent
a734493b65
commit
4156a71adf
10 files changed
+99
-30
No files matched your search
@@ -18,9 +18,10 @@ func (service *FileDownloadService) Download(ctx context.Context, c *gin.Context
|
||||
fs, err := filesystem.NewFileSystemFromContext(c)
|
||||
if err != nil {
|
||||
return serializer.Err(serializer.CodePolicyNotAllowed, err.Error(), err)
|
||||
|
||||
}
|
||||
|
||||
// 开始处理下载
|
||||
ctx = context.WithValue(ctx, filesystem.GinCtx, c)
|
||||
_, err = fs.Download(ctx, service.Path)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user