mirror of
https://github.com/ente-io/ente.git
synced 2025-08-13 01:27:17 +00:00
[server] Add basic scaffold for copying files
This commit is contained in:
25
server/pkg/controller/file_copy/file_copy.go
Normal file
25
server/pkg/controller/file_copy/file_copy.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package file_copy
|
||||
|
||||
import (
|
||||
"github.com/ente-io/museum/ente"
|
||||
"github.com/ente-io/museum/pkg/controller"
|
||||
"github.com/ente-io/museum/pkg/utils/auth"
|
||||
"github.com/ente-io/museum/pkg/utils/s3config"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type FileCopyController struct {
|
||||
S3Config *s3config.S3Config
|
||||
FileController *controller.FileController
|
||||
CollectionCtrl *controller.CollectionController
|
||||
}
|
||||
|
||||
func (fc *FileCopyController) CopyFiles(c *gin.Context, req ente.CopyFileSyncRequest) (interface{}, error) {
|
||||
userID := auth.GetUserID(c.Request.Header)
|
||||
err := fc.CollectionCtrl.IsCopyAllowed(c, userID, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, ente.NewInternalError("yet to implement actual copy")
|
||||
|
||||
}
|
Reference in New Issue
Block a user