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