dao.go
712 字节
package factory
import (
"github.com/linmadan/egglib-go/transaction/pg"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/dao"
)
func CreateTaskDao(options map[string]interface{}) (*dao.TaskDao, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return dao.NewTaskDao(transactionContext)
}
func CreateEmployeeDao(options map[string]interface{}) (*dao.EmployeeDao, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return dao.NewEmployeeDao(transactionContext)
}