48 lines
1.5 KiB
Go
48 lines
1.5 KiB
Go
|
// Code generated by goctl. DO NOT EDIT.
|
||
|
// Source: service.proto
|
||
|
|
||
|
package server
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"app-cloudep-notification-service/gen_result/pb/notification"
|
||
|
"app-cloudep-notification-service/internal/logic/senderservice"
|
||
|
"app-cloudep-notification-service/internal/svc"
|
||
|
)
|
||
|
|
||
|
type SenderServiceServer struct {
|
||
|
svcCtx *svc.ServiceContext
|
||
|
notification.UnimplementedSenderServiceServer
|
||
|
}
|
||
|
|
||
|
func NewSenderServiceServer(svcCtx *svc.ServiceContext) *SenderServiceServer {
|
||
|
return &SenderServiceServer{
|
||
|
svcCtx: svcCtx,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// SendMail 寄信
|
||
|
func (s *SenderServiceServer) SendMail(ctx context.Context, in *notification.SendMailReq) (*notification.OKResp, error) {
|
||
|
l := senderservicelogic.NewSendMailLogic(ctx, s.svcCtx)
|
||
|
return l.SendMail(in)
|
||
|
}
|
||
|
|
||
|
// SendSMS 寄簡訊
|
||
|
func (s *SenderServiceServer) SendSms(ctx context.Context, in *notification.SendSMSReq) (*notification.OKResp, error) {
|
||
|
l := senderservicelogic.NewSendSmsLogic(ctx, s.svcCtx)
|
||
|
return l.SendSms(in)
|
||
|
}
|
||
|
|
||
|
// SendMailByTemplateID 寄送模板信件
|
||
|
func (s *SenderServiceServer) SendMailByTemplateId(ctx context.Context, in *notification.SendByTemplateIDReq) (*notification.OKResp, error) {
|
||
|
l := senderservicelogic.NewSendMailByTemplateIdLogic(ctx, s.svcCtx)
|
||
|
return l.SendMailByTemplateId(in)
|
||
|
}
|
||
|
|
||
|
// SendSMSByTemplateID 寄送模板簡訊
|
||
|
func (s *SenderServiceServer) SendSmsByTemplateId(ctx context.Context, in *notification.SendByTemplateIDReq) (*notification.OKResp, error) {
|
||
|
l := senderservicelogic.NewSendSmsByTemplateIdLogic(ctx, s.svcCtx)
|
||
|
return l.SendSmsByTemplateId(in)
|
||
|
}
|