repository.go 1.2 KB
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)
}

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

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