mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-27 10:01:56 +08:00
Modify: split hooks into small modules
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
type Handler struct{}
|
||||
|
||||
// Put 将文件流保存到指定目录
|
||||
func (handler Handler) Put(ctx context.Context, file io.ReadCloser, dst string) error {
|
||||
func (handler Handler) Put(ctx context.Context, file io.ReadCloser, dst string, size uint64) error {
|
||||
defer file.Close()
|
||||
|
||||
// 如果目标目录不存在,创建
|
||||
|
||||
@@ -34,7 +34,7 @@ func TestHandler_Put(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
err := handler.Put(ctx, testCase.file, testCase.dst)
|
||||
err := handler.Put(ctx, testCase.file, testCase.dst, 15)
|
||||
if testCase.err {
|
||||
asserts.Error(err)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user