mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: list objects in specific path
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"github.com/HFO4/cloudreve/models"
|
||||
"github.com/HFO4/cloudreve/pkg/filesystem/local"
|
||||
"github.com/gin-gonic/gin"
|
||||
testMock "github.com/stretchr/testify/mock"
|
||||
"io"
|
||||
)
|
||||
@@ -73,3 +74,11 @@ func NewFileSystem(user *model.User) (*FileSystem, error) {
|
||||
Handler: handler,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// NewFileSystemFromContext 从gin.Context创建文件系统
|
||||
// TODO:test
|
||||
func NewFileSystemFromContext(c *gin.Context) (*FileSystem, error) {
|
||||
user, _ := c.Get("user")
|
||||
fs, err := NewFileSystem(user.(*model.User))
|
||||
return fs, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user