repository.go 2.5 KB
package factory

import (
	"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
	"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/transaction"
	"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/repository"
)

//CreatePartnerInfoRepository 合伙人信息
func CreatePartnerInfoRepository(options map[string]interface{}) (domain.PartnerInfoRepository, error) {
	var transactionContext *transaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*transaction.TransactionContext)
	}
	return repository.NewPartnerInfoRepository(transactionContext)
}

//CreateAdminUserRepository 管理员信息
func CreateAdminUserRepository(options map[string]interface{}) (domain.AdminUserRepository, error) {
	var transactionContext *transaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*transaction.TransactionContext)
	}
	return repository.NewAdminUserRepository(transactionContext)
}

func CreatePartnerInfoRepositoryIn(transactionContext *transaction.TransactionContext) (domain.PartnerInfoRepository, error) {
	return repository.NewPartnerInfoRepository(transactionContext)
}

func CreatePartnerSubAccountRepository(transactionContext *transaction.TransactionContext) (domain.PartnerSubAccountRepository, error) {
	return repository.NewPartnerSubAccountRepository(transactionContext)
}

//公司信息
func CreateCompanyRepository(transactionContext *transaction.TransactionContext) (domain.CompanyRepository, error) {
	return repository.NewCompanyRepository(transactionContext)
}

//CreateOrderBaseRepository 订单基础
func CreateOrderBaseRepository(transactionContext *transaction.TransactionContext) (domain.OrderBaseRepository, error) {
	return repository.NewOrderBaseRepository(transactionContext)
}

//CreateOrderGoodRepository 订单基础
func CreateOrderGoodRepository(transactionContext *transaction.TransactionContext) (domain.OrderGoodRepository, error) {
	return repository.NewOrderGoodRepository(transactionContext)
}

//CreateImInfoRepository Im信息
func CreateImInfoRepository(transactionContext *transaction.TransactionContext) (domain.ImInfoRepository, error) {
	return repository.NewImInfoRepository(transactionContext)
}

//CreateImInfoRepository Im信息
func CreateImCustomerServiceRepository(transactionContext *transaction.TransactionContext) (domain.ImCustomerServiceRepository, error) {
	return repository.NewImCustomerServiceRepository(transactionContext)
}