b_file.go 550 B

123456789101112131415161718
  1. package bll
  2. import (
  3. "context"
  4. "net/http"
  5. "yx-dataset-server/app/schema"
  6. )
  7. // IFile 文件管理业务逻辑接口
  8. type IFile interface {
  9. // 文件上传
  10. Upload(ctx context.Context, r *http.Request, formKey, bucket string) (*schema.FileInfo, error)
  11. // 从本地文件路径上传
  12. UploadFromLocal(ctx context.Context, filePath string, bucket string) (*schema.FileInfo, error)
  13. Download(ctx context.Context, filePath string) ([]byte, string, error)
  14. UploadAllTrainFiles(ctx context.Context, path, bucket string) ([]*schema.FileInfo, error)
  15. }