go-common/app/interface/main/dm2/dao/bfs.go
2019-04-22 18:49:16 +08:00

23 lines
473 B
Go

package dao
import (
"context"
"go-common/library/database/bfs"
"go-common/library/log"
)
// UploadBfs .
func (d *Dao) UploadBfs(c context.Context, fileName string, bs []byte) (location string, err error) {
if location, err = d.bfsCli.Upload(c, &bfs.Request{
Bucket: d.conf.Bfs.BucketSubtitle,
Filename: fileName,
ContentType: "application/json",
File: bs,
}); err != nil {
log.Error("bfs.BfsDmUpload error(%v)", err)
return
}
return
}