domain_service.go
2.6 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package factory
import (
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"gitlab.fjmaimaimai.com/mmm-go-pp/partner01/pkg/domain/service"
"gitlab.fjmaimaimai.com/mmm-go-pp/partner01/pkg/infrastructure/domainService"
)
func CreateShippingService(options map[string]interface{}) (service.ShippingGoodsService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domainService.NewShippingGoodsService(transactionContext)
}
func CreateReceivingService(options map[string]interface{}) (service.ReceivingGoodsService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domainService.NewReceivingGoodsService(transactionContext)
}
func CreateCancelOrderService(options map[string]interface{}) (service.CancelOrderService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domainService.NewCancelOrderService(transactionContext)
}
func CreateReturnGoodsService(options map[string]interface{}) (service.ReturnGoodsService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domainService.NewReturnGoodsService(transactionContext)
}
func CreateUserCreateService(options map[string]interface{}) (service.UserCreateService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domainService.NewUserCreateService(transactionContext)
}
func CreatePhoneAuthService(options map[string]interface{}) (service.PhoneAuthService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domainService.NewPhoneAuthenticationService(transactionContext)
}
func CreateAddUserService(options map[string]interface{}) (service.AddUserService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domainService.NewAddUserService(transactionContext)
}