b_file.go 650 B

1234567891011121314151617181920
  1. package bll
  2. import (
  3. "context"
  4. "gxt-file-server/app/schema"
  5. "net/http"
  6. )
  7. type IFile interface {
  8. // Upload 文件上传
  9. Upload(ctx context.Context, r *http.Request, formKey, fileName string) (*schema.FileInfo, error)
  10. // Download 文件下载
  11. Download(ctx context.Context, filePath string) ([]byte, string, error)
  12. // Persistent 持久化文件
  13. Persistent(ctx context.Context, fileName string) error
  14. // ChunkUpload 文件分块上传
  15. ChunkUpload(ctx context.Context, req schema.FileChunkParams) (*schema.FileChunkInfo, error)
  16. //FileMerge 文件合并
  17. FileMerge(ctx context.Context, req schema.FileMergeParams) (*schema.FileInfo, error)
  18. }