app-cloudep-notification-se.../client/senderservice/sender_service.go

67 lines
2.3 KiB
Go
Raw Normal View History

2024-08-20 06:35:14 +00:00
// Code generated by goctl. DO NOT EDIT.
// Source: service.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
SendByTemplateIDReq = notification.SendByTemplateIDReq
SendMailReq = notification.SendMailReq
SendSMSReq = notification.SendSMSReq
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)
// SendMailByTemplateID 寄送模板信件
SendMailByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error)
// SendSMSByTemplateID 寄送模板簡訊
SendSmsByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, 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...)
}
// SendMailByTemplateID 寄送模板信件
func (m *defaultSenderService) SendMailByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error) {
client := notification.NewSenderServiceClient(m.cli.Conn())
return client.SendMailByTemplateId(ctx, in, opts...)
}
// SendSMSByTemplateID 寄送模板簡訊
func (m *defaultSenderService) SendSmsByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error) {
client := notification.NewSenderServiceClient(m.cli.Conn())
return client.SendSmsByTemplateId(ctx, in, opts...)
}