domain_service.go
1.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
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)
}