bfs.go 422 B

123456789101112131415161718192021
  1. package dao
  2. import (
  3. "context"
  4. "go-common/library/database/bfs"
  5. "go-common/library/log"
  6. )
  7. // Upload .
  8. func (d *Dao) Upload(c context.Context, bucket, fileName, contentType string, file []byte) (err error) {
  9. if _, err = d.bfsCli.Upload(c, &bfs.Request{
  10. Bucket: bucket,
  11. ContentType: contentType,
  12. Filename: fileName,
  13. File: file,
  14. }); err != nil {
  15. log.Error("Upload(err:%v)", err)
  16. }
  17. return
  18. }