bfs.go 473 B

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