任务一完成

This commit is contained in:
Yvan
2026-01-07 10:17:10 +08:00
parent 35ab7c0b70
commit 77887aa76b
9 changed files with 34 additions and 34 deletions
+4 -4
View File
@@ -21,8 +21,8 @@ func NewLocal(storePath, basePath string) *Local {
}
}
// Upload 上传文件
func (l *Local) Upload(file *multipart.FileHeader) (string, string, error) {
// UploadFile 上传文件
func (l *Local) UploadFile(file *multipart.FileHeader) (string, string, error) {
// 生成文件名和路径
fileName := GenerateFileName(file.Filename)
filePath := GeneratePath(l.BasePath)
@@ -59,8 +59,8 @@ func (l *Local) Upload(file *multipart.FileHeader) (string, string, error) {
return accessPath, key, nil
}
// Delete 删除文件
func (l *Local) Delete(key string) error {
// DeleteFile 删除文件
func (l *Local) DeleteFile(key string) error {
fullPath := path.Join(l.StorePath, key)
return os.Remove(fullPath)
}