19 lines
336 B
Go
19 lines
336 B
Go
package dao
|
|
|
|
import (
|
|
"context"
|
|
"gitee.com/red-future---jilin-g/common/mongo"
|
|
"oss/consts"
|
|
"oss/model/entity"
|
|
)
|
|
|
|
var File = &file{}
|
|
|
|
type file struct{}
|
|
|
|
// Insert 插入
|
|
func (d *file) Insert(ctx context.Context, entity *entity.File) (err error) {
|
|
_, err = mongo.Insert(ctx, []interface{}{entity}, consts.FileCollection)
|
|
return
|
|
}
|