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 CreateNoticeEmptyRepository(options map[string]interface{}) (domain.NoticeEmptyRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewNoticeEmptyRepository(transactionContext)
}