Files
oss/dao/file_dao.go

21 lines
338 B
Go
Raw Normal View History

package dao
import (
"context"
"oss/consts"
"oss/model/entity"
2025-12-30 11:07:41 +08:00
2026-02-24 17:17:10 +08:00
"gitea.com/red-future/common/db/mongo"
)
2025-12-30 11:07:41 +08:00
var File = &file{}
type file struct {
}
// Insert 插入
func (d *file) Insert(ctx context.Context, entity *entity.File) (err error) {
_, err = mongo.DB().Insert(ctx, []interface{}{&entity}, consts.FileCollection)
return
}