go-common/app/admin/main/dm/dao/bfs.go

22 lines
422 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package dao
import (
"context"
"go-common/library/database/bfs"
"go-common/library/log"
)
// Upload .
func (d *Dao) Upload(c context.Context, bucket, fileName, contentType string, file []byte) (err error) {
if _, err = d.bfsCli.Upload(c, &bfs.Request{
Bucket: bucket,
ContentType: contentType,
Filename: fileName,
File: file,
}); err != nil {
log.Error("Upload(err:%v)", err)
}
return
}