backend/pkg/notification/domain/usecase/template.go

25 lines
1.1 KiB
Go

package usecase
import (
"backend/pkg/notification/domain/entity"
"backend/pkg/notification/domain/template"
"context"
)
type TemplateUseCase interface {
// GetEmailTemplateByStatic 從靜態模板獲取郵件模板
GetEmailTemplateByStatic(ctx context.Context, language template.Language, templateID template.Type) (template.EmailTemplate, error)
// GetEmailTemplate 獲取郵件模板(優先從資料庫,回退到靜態模板)
GetEmailTemplate(ctx context.Context, language template.Language, templateID template.Type) (template.EmailTemplate, error)
// GetSMSTemplate 獲取 SMS 模板(優先從資料庫,回退到靜態模板)
GetSMSTemplate(ctx context.Context, language template.Language, templateID template.Type) (SMSTemplateResp, error)
// RenderEmailTemplate 渲染郵件模板(替換變數)
RenderEmailTemplate(ctx context.Context, tmpl template.EmailTemplate, params entity.TemplateParams) (EmailTemplateResp, error)
// RenderSMSTemplate 渲染 SMS 模板(替換變數)
RenderSMSTemplate(ctx context.Context, tmpl SMSTemplateResp, params entity.TemplateParams) (SMSTemplateResp, error)
}