package db

import "gorm.io/gorm"

type BaseModel struct {
	db *gorm.DB
}

func (p *BaseModel) SetDB(db *gorm.DB) {
	p.db = db
}

func (p *BaseModel) GetDB() *gorm.DB {
	if p.db != nil {
		return p.db
	}

	return GetDB()
}
