repository.go
1.8 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
40
41
42
43
package factory
import (
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/transaction"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/repository"
)
//CreatePartnerInfoRepository 合伙人信息
func CreatePartnerInfoRepository(options map[string]interface{}) (domain.PartnerInfoRepository, error) {
var transactionContext *transaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*transaction.TransactionContext)
}
return repository.NewPartnerInfoRepository(transactionContext)
}
//CreateAdminUserRepository 管理员信息
func CreateAdminUserRepository(options map[string]interface{}) (domain.AdminUserRepository, error) {
var transactionContext *transaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*transaction.TransactionContext)
}
return repository.NewAdminUserRepository(transactionContext)
}
//CreateOrderRepository 订单
func CreateOrderRepository(transactionContext *transaction.TransactionContext) (domain.OrderRepository, error) {
return repository.NewOrderRepository(transactionContext)
}
//CreateOrderRepository 订单
func CreateOrderPaymentRepository(transactionContext *transaction.TransactionContext) (domain.OrderPaymentRepository, error) {
return repository.NewOrderPaymentRepository(transactionContext)
}
func CreatePartnerInfoRepositoryIn(transactionContext *transaction.TransactionContext) (domain.PartnerInfoRepository, error) {
return repository.NewPartnerInfoRepository(transactionContext)
}
func CreatePartnerSubAccountRepository(transactionContext *transaction.TransactionContext) (domain.PartnerSubAccountRepository, error) {
return repository.NewPartnerSubAccountRepository(transactionContext)
}