任务一完成
This commit is contained in:
+4
-4
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user