repository.go 571 字节
package factory

import (
	"github.com/linmadan/egglib-go/transaction/pg"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/domain"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/infrastructure/repository"
)

func CreateDictionaryRepository(options map[string]interface{}) (domain.DictionaryRepository, error) {
	var transactionContext *pg.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pg.TransactionContext)
	}
	return repository.NewDictionaryRepository(transactionContext)
}