package senderservicelogic import ( "app-cloudep-notification-service/pkg/domain/template" "context" "app-cloudep-notification-service/gen_result/pb/notification" "app-cloudep-notification-service/internal/svc" "github.com/zeromicro/go-zero/core/logx" ) type GetStaticTemplateLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewGetStaticTemplateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetStaticTemplateLogic { return &GetStaticTemplateLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // GetStaticTemplate 取得 Template func (l *GetStaticTemplateLogic) GetStaticTemplate(in *notification.TemplateReq) (*notification.TemplateResp, error) { tmp, err := l.svcCtx.TemplateUseCase.GetEmailTemplateByStatic( l.ctx, template.Language(in.GetLanguage()), template.Type(in.GetTemplateId()), ) if err != nil { return nil, err } return ¬ification.TemplateResp{ Title: tmp.Title, Body: tmp.Body, }, nil }