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

61 lines
1.8 KiB
Go
Raw Permalink Normal View History

2024-08-20 06:35:14 +00:00
// Code generated by goctl. DO NOT EDIT.
2025-03-01 14:10:00 +00:00
// goctl 1.7.3
2024-08-26 08:34:16 +00:00
// Source: notification.proto
2024-08-20 06:35:14 +00:00
package senderservice
import (
"context"
2025-03-08 03:01:44 +00:00
"code.30cm.net/digimon/app-cloudep-notification-service/gen_result/pb/notification"
2024-08-20 06:35:14 +00:00
"github.com/zeromicro/go-zero/zrpc"
"google.golang.org/grpc"
)
type (
2025-03-01 15:15:32 +00:00
NoneReq = notification.NoneReq
OKResp = notification.OKResp
SendMailReq = notification.SendMailReq
SendSMSReq = notification.SendSMSReq
TemplateReq = notification.TemplateReq
TemplateResp = notification.TemplateResp
2024-08-20 06:35:14 +00:00
SenderService interface {
// SendMail 寄信
SendMail(ctx context.Context, in *SendMailReq, opts ...grpc.CallOption) (*OKResp, error)
// SendSms 寄簡訊
2024-08-20 06:35:14 +00:00
SendSms(ctx context.Context, in *SendSMSReq, opts ...grpc.CallOption) (*OKResp, error)
2025-03-01 15:15:32 +00:00
// 取得 Template
GetStaticTemplate(ctx context.Context, in *TemplateReq, opts ...grpc.CallOption) (*TemplateResp, error)
2024-08-20 06:35:14 +00:00
}
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 寄簡訊
2024-08-20 06:35:14 +00:00
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...)
}
2025-03-01 15:15:32 +00:00
// 取得 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...)
}