repository.go 509 字节
package factory

import (
	"github.com/linmadan/egglib-go/transaction/pg"
	"gitlab.fjmaimaimai.com/mmm-go-pp/terms/pkg/domain"
	"gitlab.fjmaimaimai.com/mmm-go-pp/terms/pkg/infrastructure/repository"
)

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