2025-12-26 13:59:02 +08:00
|
|
|
package dao
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"oss/consts"
|
|
|
|
|
"oss/model/entity"
|
2025-12-30 11:07:41 +08:00
|
|
|
|
|
|
|
|
"gitee.com/red-future---jilin-g/common/mongo"
|
2025-12-26 13:59:02 +08:00
|
|
|
)
|
|
|
|
|
|
2025-12-30 11:07:41 +08:00
|
|
|
var File = &file{}
|
2025-12-29 14:42:56 +08:00
|
|
|
|
|
|
|
|
type file struct {
|
|
|
|
|
}
|
2025-12-26 13:59:02 +08:00
|
|
|
|
|
|
|
|
// Insert 插入
|
|
|
|
|
func (d *file) Insert(ctx context.Context, entity *entity.File) (err error) {
|
2026-01-12 09:11:32 +08:00
|
|
|
_, err = mongo.DB().Insert(ctx, []interface{}{&entity}, consts.FileCollection)
|
2025-12-26 13:59:02 +08:00
|
|
|
return
|
|
|
|
|
}
|