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

22 lines
422 B
Go

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
}