mongo.go重构

This commit is contained in:
2025-12-30 10:13:11 +08:00
parent 98e5e9e4cc
commit 83d136f73e
6 changed files with 494 additions and 17 deletions

View File

@@ -21,6 +21,6 @@ func (d *file) SetNoCache() {
// Insert 插入
func (d *file) Insert(ctx context.Context, entity *entity.File) (err error) {
_, err = mongo.Insert(ctx, []interface{}{entity}, consts.FileCollection)
_, err = mongo.DB().Insert(ctx, []interface{}{entity}, consts.FileCollection)
return
}