domain_service.go 3.4 KB
package factory

import (
	pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/domain"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/domain/service"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/domainService"
)

func CreateSignUpCompanyService(options map[string]interface{}) (service.PgSignUpCompanyService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewPgSignUpCompanyServiceService(transactionContext)
}

func CreatePgAuthResetPhoneService(options map[string]interface{}) (service.PgAuthResetPhoneService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewPgAuthResetPhoneService(transactionContext)
}

func CreatePgAuthAccountDestroyService(options map[string]interface{}) (service.PgAuthAccountDestroyService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewPgAuthAccountDestroyService(transactionContext)
}

func CreatePgCreateUserService(options map[string]interface{}) (service.PgCreateUserService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewPgCreateUserService(transactionContext)
}

func CreatePgDataAuthService(options map[string]interface{}) (domain.DataAuthor, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewPgDataAuthService(transactionContext)
}

func CreatePgUpdateUserService(options map[string]interface{}) (service.PgUpdateUserService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewPgUpdateUserService(transactionContext)
}

func CreatePgCreateRoleService(options map[string]interface{}) (service.PgCreateRoleService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewPgCreateRoleService(transactionContext)
}

func CreatePgCreateOrgService(options map[string]interface{}) (service.PgCreateOrgService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewPgCreateOrgService(transactionContext)
}

func CreatePgRoleAccessMenusService(options map[string]interface{}) (service.PgRoleAccessMenusService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewPgRoleAccessMenusService(transactionContext)
}