domain_service.go
3.3 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
65
66
67
68
69
70
71
72
73
package factory
import (
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/domain_service"
)
func CreateUserService(options map[string]interface{}) (service.UserService, error) {
return domain_service.NewUserService()
}
func CreateCompanyService(options map[string]interface{}) (service.CompanyService, error) {
return domain_service.NewCompanyService()
}
func CreateDepartmentService(options map[string]interface{}) (service.DepartmentService, error) {
return domain_service.NewDepartmentService()
}
func CreateOrganizationService(options map[string]interface{}) (service.OrgService, error) {
return domain_service.NewOrganizationService()
}
func CreateCooperationStatisticsService(options map[string]interface{}) (*domain_service.CooperationStatisticsService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domain_service.NewCooperationStatisticsService(transactionContext)
}
func CreateConfirmDividendsIncentivesEstimateService(options map[string]interface{}) (*domain_service.ConfirmDividendsIncentivesEstimateService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domain_service.NewConfirmDividendsIncentivesEstimateService(transactionContext)
}
func CreateConfirmMoneyIncentivesEstimateService(options map[string]interface{}) (*domain_service.ConfirmMoneyIncentivesEstimateService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domain_service.NewConfirmMoneyIncentivesEstimateService(transactionContext)
}
func CreateCancelDividendsEstimateService(options map[string]interface{}) (*domain_service.CancelDividendsEstimateService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domain_service.NewCancelDividendsEstimateService(transactionContext)
}
func CreateAgreeContractApplicationService(options map[string]interface{}) (*domain_service.AgreeContractApplicationService, error) {
//var transactionContext *pgTransaction.TransactionContext
//if value, ok := options["transactionContext"]; ok {
// transactionContext = value.(*pgTransaction.TransactionContext)
//}
//return domain_service.NewAgreeContractApplicationService(transactionContext)
return domain_service.NewAgreeContractApplicationService(nil)
}
func CreateRejectContractApplicationService(options map[string]interface{}) (*domain_service.RejectContractApplicationService, error) {
//var transactionContext *pgTransaction.TransactionContext
//if value, ok := options["transactionContext"]; ok {
// transactionContext = value.(*pgTransaction.TransactionContext)
//}
//return domain_service.NewRejectContractApplicationService(transactionContext)
return domain_service.NewRejectContractApplicationService(nil)
}