61 lines
1.8 KiB
Go
61 lines
1.8 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// goctl 1.7.3
|
|
// Source: notification.proto
|
|
|
|
package senderservice
|
|
|
|
import (
|
|
"context"
|
|
|
|
"app-cloudep-notification-service/gen_result/pb/notification"
|
|
|
|
"github.com/zeromicro/go-zero/zrpc"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
type (
|
|
NoneReq = notification.NoneReq
|
|
OKResp = notification.OKResp
|
|
SendMailReq = notification.SendMailReq
|
|
SendSMSReq = notification.SendSMSReq
|
|
TemplateReq = notification.TemplateReq
|
|
TemplateResp = notification.TemplateResp
|
|
|
|
SenderService interface {
|
|
// SendMail 寄信
|
|
SendMail(ctx context.Context, in *SendMailReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
// SendSms 寄簡訊
|
|
SendSms(ctx context.Context, in *SendSMSReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
// 取得 Template
|
|
GetStaticTemplate(ctx context.Context, in *TemplateReq, opts ...grpc.CallOption) (*TemplateResp, error)
|
|
}
|
|
|
|
defaultSenderService struct {
|
|
cli zrpc.Client
|
|
}
|
|
)
|
|
|
|
func NewSenderService(cli zrpc.Client) SenderService {
|
|
return &defaultSenderService{
|
|
cli: cli,
|
|
}
|
|
}
|
|
|
|
// SendMail 寄信
|
|
func (m *defaultSenderService) SendMail(ctx context.Context, in *SendMailReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
client := notification.NewSenderServiceClient(m.cli.Conn())
|
|
return client.SendMail(ctx, in, opts...)
|
|
}
|
|
|
|
// SendSms 寄簡訊
|
|
func (m *defaultSenderService) SendSms(ctx context.Context, in *SendSMSReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
client := notification.NewSenderServiceClient(m.cli.Conn())
|
|
return client.SendSms(ctx, in, opts...)
|
|
}
|
|
|
|
// 取得 Template
|
|
func (m *defaultSenderService) GetStaticTemplate(ctx context.Context, in *TemplateReq, opts ...grpc.CallOption) (*TemplateResp, error) {
|
|
client := notification.NewSenderServiceClient(m.cli.Conn())
|
|
return client.GetStaticTemplate(ctx, in, opts...)
|
|
}
|