Initial commit: Open sourcing all of the Maple Open Technologies code.
This commit is contained in:
commit
755d54a99d
2010 changed files with 448675 additions and 0 deletions
41
cloud/maplepress-backend/internal/service/tenant/get.go
Normal file
41
cloud/maplepress-backend/internal/service/tenant/get.go
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package tenant
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
tenantusecase "codeberg.org/mapleopentech/monorepo/cloud/maplepress-backend/internal/usecase/tenant"
|
||||
)
|
||||
|
||||
// GetTenantService handles getting tenant information
|
||||
type GetTenantService interface {
|
||||
GetTenant(ctx context.Context, input *tenantusecase.GetTenantInput) (*tenantusecase.GetTenantOutput, error)
|
||||
GetTenantBySlug(ctx context.Context, input *tenantusecase.GetTenantBySlugInput) (*tenantusecase.GetTenantOutput, error)
|
||||
}
|
||||
|
||||
type getTenantService struct {
|
||||
getUC *tenantusecase.GetTenantUseCase
|
||||
logger *zap.Logger
|
||||
}
|
||||
|
||||
// NewGetTenantService creates a new GetTenantService
|
||||
func NewGetTenantService(
|
||||
getUC *tenantusecase.GetTenantUseCase,
|
||||
logger *zap.Logger,
|
||||
) GetTenantService {
|
||||
return &getTenantService{
|
||||
getUC: getUC,
|
||||
logger: logger.Named("get-tenant-service"),
|
||||
}
|
||||
}
|
||||
|
||||
// GetTenant retrieves a tenant by ID
|
||||
func (s *getTenantService) GetTenant(ctx context.Context, input *tenantusecase.GetTenantInput) (*tenantusecase.GetTenantOutput, error) {
|
||||
return s.getUC.Execute(ctx, input)
|
||||
}
|
||||
|
||||
// GetTenantBySlug retrieves a tenant by slug
|
||||
func (s *getTenantService) GetTenantBySlug(ctx context.Context, input *tenantusecase.GetTenantBySlugInput) (*tenantusecase.GetTenantOutput, error) {
|
||||
return s.getUC.ExecuteBySlug(ctx, input)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue