优化结构
This commit is contained in:
@@ -21,6 +21,25 @@ type MediaRepo interface {
|
||||
UploadRepo
|
||||
}
|
||||
|
||||
type StoredFile struct {
|
||||
Name string
|
||||
Path string
|
||||
URL string
|
||||
Size int64
|
||||
LastModified time.Time
|
||||
ContentType string
|
||||
}
|
||||
|
||||
// FileStorage owns the persistence boundary for uploaded files.
|
||||
type FileStorage interface {
|
||||
Put(context.Context, string, io.Reader) (*StoredFile, error)
|
||||
Open(context.Context, string) (io.ReadCloser, error)
|
||||
Delete(context.Context, string) error
|
||||
Compose(context.Context, []string, string) (*StoredFile, string, error)
|
||||
DeletePrefix(context.Context, string) error
|
||||
List(context.Context, string, string, int) ([]*StoredFile, string, bool, error)
|
||||
}
|
||||
|
||||
type MediaUsecase struct {
|
||||
MediaRepo
|
||||
files FileStorage
|
||||
|
||||
Reference in New Issue
Block a user