repository.go
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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)
}
func CreateSystemSettingRepository(options map[string]interface{}) (domain.SystemSettingRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewSystemSettingRepository(transactionContext)
}