feature/member #2

Merged
daniel.w merged 2 commits from feature/member into main 2024-08-24 15:17:02 +00:00
5 changed files with 3738 additions and 0 deletions

12
go.mod
View File

@ -1,3 +1,15 @@
module code.30cm.net/digimon/proto-all
go 1.22.3
require (
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
)
require (
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
)

2416
pkg/member/service.pb.go Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,592 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc v3.19.4
// source: generate/protobuf/service.proto
package member
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.62.0 or later.
const _ = grpc.SupportPackageIsVersion8
const (
Account_CreateUserAccount_FullMethodName = "/member.Account/CreateUserAccount"
Account_GetUserAccountInfo_FullMethodName = "/member.Account/GetUserAccountInfo"
Account_UpdateUserToken_FullMethodName = "/member.Account/UpdateUserToken"
Account_GetUidByAccount_FullMethodName = "/member.Account/GetUidByAccount"
Account_BindAccount_FullMethodName = "/member.Account/BindAccount"
Account_BindUserInfo_FullMethodName = "/member.Account/BindUserInfo"
Account_UpdateUserInfo_FullMethodName = "/member.Account/UpdateUserInfo"
Account_UpdateStatus_FullMethodName = "/member.Account/UpdateStatus"
Account_GetUserInfo_FullMethodName = "/member.Account/GetUserInfo"
Account_ListMember_FullMethodName = "/member.Account/ListMember"
Account_GenerateRefreshCode_FullMethodName = "/member.Account/GenerateRefreshCode"
Account_VerifyRefreshCode_FullMethodName = "/member.Account/VerifyRefreshCode"
Account_VerifyGoogleAuthResult_FullMethodName = "/member.Account/VerifyGoogleAuthResult"
)
// AccountClient is the client API for Account service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type AccountClient interface {
// CreateUserAccount 建立帳號與密碼 -> 可登入,但可不可以做其他事情看業務流程,也可以只註冊就好
CreateUserAccount(ctx context.Context, in *CreateLoginUserReq, opts ...grpc.CallOption) (*OKResp, error)
// GetUserAccountInfo 取得帳號密碼資料
GetUserAccountInfo(ctx context.Context, in *GetUIDByAccountReq, opts ...grpc.CallOption) (*GetAccountInfoResp, error)
// UpdateUserToken 更新密碼
UpdateUserToken(ctx context.Context, in *UpdateTokenReq, opts ...grpc.CallOption) (*OKResp, error)
// GetUidByAccount 用帳號換取 UID
GetUidByAccount(ctx context.Context, in *GetUIDByAccountReq, opts ...grpc.CallOption) (*GetUidByAccountResp, error)
// BindAccount 綁定帳號 -> account bind to UID
BindAccount(ctx context.Context, in *BindingUserReq, opts ...grpc.CallOption) (*BindingUserResp, error)
// BindUserInfo 初次,綁定 User Info
BindUserInfo(ctx context.Context, in *CreateUserInfoReq, opts ...grpc.CallOption) (*OKResp, error)
// UpdateUserInfo 更新 User Info
UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*OKResp, error)
// UpdateStatus 修改狀態
UpdateStatus(ctx context.Context, in *UpdateStatusReq, opts ...grpc.CallOption) (*OKResp, error)
// GetUserInfo 取得會員資訊
GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error)
// ListMember 取得會員列表
ListMember(ctx context.Context, in *ListUserInfoReq, opts ...grpc.CallOption) (*ListUserInfoResp, error)
// GenerateRefreshCode 這個帳號驗證碼(十分鐘),通用的
GenerateRefreshCode(ctx context.Context, in *GenerateRefreshCodeReq, opts ...grpc.CallOption) (*GenerateRefreshCodeResp, error)
// VerifyRefreshCode 驗證忘記密碼 token
VerifyRefreshCode(ctx context.Context, in *VerifyRefreshCodeReq, opts ...grpc.CallOption) (*OKResp, error)
// VerifyGoogleAuthResult 驗證 google 登入是否有效
VerifyGoogleAuthResult(ctx context.Context, in *VerifyAuthResultReq, opts ...grpc.CallOption) (*VerifyAuthResultResp, error)
}
type accountClient struct {
cc grpc.ClientConnInterface
}
func NewAccountClient(cc grpc.ClientConnInterface) AccountClient {
return &accountClient{cc}
}
func (c *accountClient) CreateUserAccount(ctx context.Context, in *CreateLoginUserReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, Account_CreateUserAccount_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) GetUserAccountInfo(ctx context.Context, in *GetUIDByAccountReq, opts ...grpc.CallOption) (*GetAccountInfoResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetAccountInfoResp)
err := c.cc.Invoke(ctx, Account_GetUserAccountInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) UpdateUserToken(ctx context.Context, in *UpdateTokenReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, Account_UpdateUserToken_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) GetUidByAccount(ctx context.Context, in *GetUIDByAccountReq, opts ...grpc.CallOption) (*GetUidByAccountResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetUidByAccountResp)
err := c.cc.Invoke(ctx, Account_GetUidByAccount_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) BindAccount(ctx context.Context, in *BindingUserReq, opts ...grpc.CallOption) (*BindingUserResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(BindingUserResp)
err := c.cc.Invoke(ctx, Account_BindAccount_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) BindUserInfo(ctx context.Context, in *CreateUserInfoReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, Account_BindUserInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, Account_UpdateUserInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) UpdateStatus(ctx context.Context, in *UpdateStatusReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, Account_UpdateStatus_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetUserInfoResp)
err := c.cc.Invoke(ctx, Account_GetUserInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) ListMember(ctx context.Context, in *ListUserInfoReq, opts ...grpc.CallOption) (*ListUserInfoResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListUserInfoResp)
err := c.cc.Invoke(ctx, Account_ListMember_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) GenerateRefreshCode(ctx context.Context, in *GenerateRefreshCodeReq, opts ...grpc.CallOption) (*GenerateRefreshCodeResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GenerateRefreshCodeResp)
err := c.cc.Invoke(ctx, Account_GenerateRefreshCode_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) VerifyRefreshCode(ctx context.Context, in *VerifyRefreshCodeReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, Account_VerifyRefreshCode_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) VerifyGoogleAuthResult(ctx context.Context, in *VerifyAuthResultReq, opts ...grpc.CallOption) (*VerifyAuthResultResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(VerifyAuthResultResp)
err := c.cc.Invoke(ctx, Account_VerifyGoogleAuthResult_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AccountServer is the server API for Account service.
// All implementations must embed UnimplementedAccountServer
// for forward compatibility
type AccountServer interface {
// CreateUserAccount 建立帳號與密碼 -> 可登入,但可不可以做其他事情看業務流程,也可以只註冊就好
CreateUserAccount(context.Context, *CreateLoginUserReq) (*OKResp, error)
// GetUserAccountInfo 取得帳號密碼資料
GetUserAccountInfo(context.Context, *GetUIDByAccountReq) (*GetAccountInfoResp, error)
// UpdateUserToken 更新密碼
UpdateUserToken(context.Context, *UpdateTokenReq) (*OKResp, error)
// GetUidByAccount 用帳號換取 UID
GetUidByAccount(context.Context, *GetUIDByAccountReq) (*GetUidByAccountResp, error)
// BindAccount 綁定帳號 -> account bind to UID
BindAccount(context.Context, *BindingUserReq) (*BindingUserResp, error)
// BindUserInfo 初次,綁定 User Info
BindUserInfo(context.Context, *CreateUserInfoReq) (*OKResp, error)
// UpdateUserInfo 更新 User Info
UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*OKResp, error)
// UpdateStatus 修改狀態
UpdateStatus(context.Context, *UpdateStatusReq) (*OKResp, error)
// GetUserInfo 取得會員資訊
GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error)
// ListMember 取得會員列表
ListMember(context.Context, *ListUserInfoReq) (*ListUserInfoResp, error)
// GenerateRefreshCode 這個帳號驗證碼(十分鐘),通用的
GenerateRefreshCode(context.Context, *GenerateRefreshCodeReq) (*GenerateRefreshCodeResp, error)
// VerifyRefreshCode 驗證忘記密碼 token
VerifyRefreshCode(context.Context, *VerifyRefreshCodeReq) (*OKResp, error)
// VerifyGoogleAuthResult 驗證 google 登入是否有效
VerifyGoogleAuthResult(context.Context, *VerifyAuthResultReq) (*VerifyAuthResultResp, error)
mustEmbedUnimplementedAccountServer()
}
// UnimplementedAccountServer must be embedded to have forward compatible implementations.
type UnimplementedAccountServer struct {
}
func (UnimplementedAccountServer) CreateUserAccount(context.Context, *CreateLoginUserReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateUserAccount not implemented")
}
func (UnimplementedAccountServer) GetUserAccountInfo(context.Context, *GetUIDByAccountReq) (*GetAccountInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserAccountInfo not implemented")
}
func (UnimplementedAccountServer) UpdateUserToken(context.Context, *UpdateTokenReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateUserToken not implemented")
}
func (UnimplementedAccountServer) GetUidByAccount(context.Context, *GetUIDByAccountReq) (*GetUidByAccountResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUidByAccount not implemented")
}
func (UnimplementedAccountServer) BindAccount(context.Context, *BindingUserReq) (*BindingUserResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BindAccount not implemented")
}
func (UnimplementedAccountServer) BindUserInfo(context.Context, *CreateUserInfoReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BindUserInfo not implemented")
}
func (UnimplementedAccountServer) UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInfo not implemented")
}
func (UnimplementedAccountServer) UpdateStatus(context.Context, *UpdateStatusReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateStatus not implemented")
}
func (UnimplementedAccountServer) GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserInfo not implemented")
}
func (UnimplementedAccountServer) ListMember(context.Context, *ListUserInfoReq) (*ListUserInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListMember not implemented")
}
func (UnimplementedAccountServer) GenerateRefreshCode(context.Context, *GenerateRefreshCodeReq) (*GenerateRefreshCodeResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GenerateRefreshCode not implemented")
}
func (UnimplementedAccountServer) VerifyRefreshCode(context.Context, *VerifyRefreshCodeReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifyRefreshCode not implemented")
}
func (UnimplementedAccountServer) VerifyGoogleAuthResult(context.Context, *VerifyAuthResultReq) (*VerifyAuthResultResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifyGoogleAuthResult not implemented")
}
func (UnimplementedAccountServer) mustEmbedUnimplementedAccountServer() {}
// UnsafeAccountServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AccountServer will
// result in compilation errors.
type UnsafeAccountServer interface {
mustEmbedUnimplementedAccountServer()
}
func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer) {
s.RegisterService(&Account_ServiceDesc, srv)
}
func _Account_CreateUserAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateLoginUserReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).CreateUserAccount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_CreateUserAccount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).CreateUserAccount(ctx, req.(*CreateLoginUserReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_GetUserAccountInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUIDByAccountReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).GetUserAccountInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_GetUserAccountInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).GetUserAccountInfo(ctx, req.(*GetUIDByAccountReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_UpdateUserToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateTokenReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).UpdateUserToken(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_UpdateUserToken_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).UpdateUserToken(ctx, req.(*UpdateTokenReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_GetUidByAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUIDByAccountReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).GetUidByAccount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_GetUidByAccount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).GetUidByAccount(ctx, req.(*GetUIDByAccountReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_BindAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BindingUserReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).BindAccount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_BindAccount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).BindAccount(ctx, req.(*BindingUserReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_BindUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateUserInfoReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).BindUserInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_BindUserInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).BindUserInfo(ctx, req.(*CreateUserInfoReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateUserInfoReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).UpdateUserInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_UpdateUserInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).UpdateUserInfo(ctx, req.(*UpdateUserInfoReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_UpdateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateStatusReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).UpdateStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_UpdateStatus_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).UpdateStatus(ctx, req.(*UpdateStatusReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserInfoReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).GetUserInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_GetUserInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).GetUserInfo(ctx, req.(*GetUserInfoReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_ListMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListUserInfoReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).ListMember(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_ListMember_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).ListMember(ctx, req.(*ListUserInfoReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_GenerateRefreshCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GenerateRefreshCodeReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).GenerateRefreshCode(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_GenerateRefreshCode_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).GenerateRefreshCode(ctx, req.(*GenerateRefreshCodeReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_VerifyRefreshCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(VerifyRefreshCodeReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).VerifyRefreshCode(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_VerifyRefreshCode_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).VerifyRefreshCode(ctx, req.(*VerifyRefreshCodeReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_VerifyGoogleAuthResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(VerifyAuthResultReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).VerifyGoogleAuthResult(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_VerifyGoogleAuthResult_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).VerifyGoogleAuthResult(ctx, req.(*VerifyAuthResultReq))
}
return interceptor(ctx, in, info, handler)
}
// Account_ServiceDesc is the grpc.ServiceDesc for Account service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Account_ServiceDesc = grpc.ServiceDesc{
ServiceName: "member.Account",
HandlerType: (*AccountServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateUserAccount",
Handler: _Account_CreateUserAccount_Handler,
},
{
MethodName: "GetUserAccountInfo",
Handler: _Account_GetUserAccountInfo_Handler,
},
{
MethodName: "UpdateUserToken",
Handler: _Account_UpdateUserToken_Handler,
},
{
MethodName: "GetUidByAccount",
Handler: _Account_GetUidByAccount_Handler,
},
{
MethodName: "BindAccount",
Handler: _Account_BindAccount_Handler,
},
{
MethodName: "BindUserInfo",
Handler: _Account_BindUserInfo_Handler,
},
{
MethodName: "UpdateUserInfo",
Handler: _Account_UpdateUserInfo_Handler,
},
{
MethodName: "UpdateStatus",
Handler: _Account_UpdateStatus_Handler,
},
{
MethodName: "GetUserInfo",
Handler: _Account_GetUserInfo_Handler,
},
{
MethodName: "ListMember",
Handler: _Account_ListMember_Handler,
},
{
MethodName: "GenerateRefreshCode",
Handler: _Account_GenerateRefreshCode_Handler,
},
{
MethodName: "VerifyRefreshCode",
Handler: _Account_VerifyRefreshCode_Handler,
},
{
MethodName: "VerifyGoogleAuthResult",
Handler: _Account_VerifyGoogleAuthResult_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "generate/protobuf/service.proto",
}

View File

@ -0,0 +1,486 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.34.2
// protoc v3.19.4
// source: generate/protobuf/service.proto
package notification
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// OKResp
type OKResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *OKResp) Reset() {
*x = OKResp{}
if protoimpl.UnsafeEnabled {
mi := &file_generate_protobuf_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OKResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OKResp) ProtoMessage() {}
func (x *OKResp) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OKResp.ProtoReflect.Descriptor instead.
func (*OKResp) Descriptor() ([]byte, []int) {
return file_generate_protobuf_service_proto_rawDescGZIP(), []int{0}
}
// NoneReq
type NoneReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *NoneReq) Reset() {
*x = NoneReq{}
if protoimpl.UnsafeEnabled {
mi := &file_generate_protobuf_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NoneReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NoneReq) ProtoMessage() {}
func (x *NoneReq) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NoneReq.ProtoReflect.Descriptor instead.
func (*NoneReq) Descriptor() ([]byte, []int) {
return file_generate_protobuf_service_proto_rawDescGZIP(), []int{1}
}
type SendMailReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"`
Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
From string `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
}
func (x *SendMailReq) Reset() {
*x = SendMailReq{}
if protoimpl.UnsafeEnabled {
mi := &file_generate_protobuf_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SendMailReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SendMailReq) ProtoMessage() {}
func (x *SendMailReq) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SendMailReq.ProtoReflect.Descriptor instead.
func (*SendMailReq) Descriptor() ([]byte, []int) {
return file_generate_protobuf_service_proto_rawDescGZIP(), []int{2}
}
func (x *SendMailReq) GetTo() string {
if x != nil {
return x.To
}
return ""
}
func (x *SendMailReq) GetSubject() string {
if x != nil {
return x.Subject
}
return ""
}
func (x *SendMailReq) GetBody() string {
if x != nil {
return x.Body
}
return ""
}
func (x *SendMailReq) GetFrom() string {
if x != nil {
return x.From
}
return ""
}
type SendSMSReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"`
Body string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
RecipientName string `protobuf:"bytes,3,opt,name=recipient_name,json=recipientName,proto3" json:"recipient_name,omitempty"`
}
func (x *SendSMSReq) Reset() {
*x = SendSMSReq{}
if protoimpl.UnsafeEnabled {
mi := &file_generate_protobuf_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SendSMSReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SendSMSReq) ProtoMessage() {}
func (x *SendSMSReq) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SendSMSReq.ProtoReflect.Descriptor instead.
func (*SendSMSReq) Descriptor() ([]byte, []int) {
return file_generate_protobuf_service_proto_rawDescGZIP(), []int{3}
}
func (x *SendSMSReq) GetTo() string {
if x != nil {
return x.To
}
return ""
}
func (x *SendSMSReq) GetBody() string {
if x != nil {
return x.Body
}
return ""
}
func (x *SendSMSReq) GetRecipientName() string {
if x != nil {
return x.RecipientName
}
return ""
}
type SendByTemplateIDReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"`
TemplateId string `protobuf:"bytes,2,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"`
Lang string `protobuf:"bytes,3,opt,name=lang,proto3" json:"lang,omitempty"`
ContentData map[string]string `protobuf:"bytes,4,rep,name=content_data,json=contentData,proto3" json:"content_data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *SendByTemplateIDReq) Reset() {
*x = SendByTemplateIDReq{}
if protoimpl.UnsafeEnabled {
mi := &file_generate_protobuf_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SendByTemplateIDReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SendByTemplateIDReq) ProtoMessage() {}
func (x *SendByTemplateIDReq) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SendByTemplateIDReq.ProtoReflect.Descriptor instead.
func (*SendByTemplateIDReq) Descriptor() ([]byte, []int) {
return file_generate_protobuf_service_proto_rawDescGZIP(), []int{4}
}
func (x *SendByTemplateIDReq) GetTo() string {
if x != nil {
return x.To
}
return ""
}
func (x *SendByTemplateIDReq) GetTemplateId() string {
if x != nil {
return x.TemplateId
}
return ""
}
func (x *SendByTemplateIDReq) GetLang() string {
if x != nil {
return x.Lang
}
return ""
}
func (x *SendByTemplateIDReq) GetContentData() map[string]string {
if x != nil {
return x.ContentData
}
return nil
}
var File_generate_protobuf_service_proto protoreflect.FileDescriptor
var file_generate_protobuf_service_proto_rawDesc = []byte{
0x0a, 0x1f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22,
0x08, 0x0a, 0x06, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x09, 0x0a, 0x07, 0x4e, 0x6f, 0x6e,
0x65, 0x52, 0x65, 0x71, 0x22, 0x5f, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x61, 0x69, 0x6c,
0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x02, 0x74, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a,
0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64,
0x79, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x66, 0x72, 0x6f, 0x6d, 0x22, 0x57, 0x0a, 0x0a, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x4d, 0x53,
0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x02, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x69, 0x70,
0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0d, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xf1,
0x01, 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x55, 0x0a, 0x0c, 0x63,
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x32, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x2e, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49,
0x44, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x44, 0x61,
0x74, 0x61, 0x1a, 0x3e, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74,
0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x38, 0x01, 0x32, 0xa8, 0x02, 0x0a, 0x0d, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x61, 0x69, 0x6c,
0x12, 0x19, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
0x53, 0x65, 0x6e, 0x64, 0x4d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6e, 0x6f,
0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73,
0x70, 0x12, 0x39, 0x0a, 0x07, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x6d, 0x73, 0x12, 0x18, 0x2e, 0x6e,
0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64,
0x53, 0x4d, 0x53, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4f, 0x0a, 0x14,
0x53, 0x65, 0x6e, 0x64, 0x4d, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x49, 0x64, 0x12, 0x21, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a,
0x13, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x6d, 0x73, 0x42, 0x79, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x49, 0x64, 0x12, 0x21, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x42, 0x10, 0x5a,
0x0e, 0x2e, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_generate_protobuf_service_proto_rawDescOnce sync.Once
file_generate_protobuf_service_proto_rawDescData = file_generate_protobuf_service_proto_rawDesc
)
func file_generate_protobuf_service_proto_rawDescGZIP() []byte {
file_generate_protobuf_service_proto_rawDescOnce.Do(func() {
file_generate_protobuf_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_generate_protobuf_service_proto_rawDescData)
})
return file_generate_protobuf_service_proto_rawDescData
}
var file_generate_protobuf_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_generate_protobuf_service_proto_goTypes = []any{
(*OKResp)(nil), // 0: notification.OKResp
(*NoneReq)(nil), // 1: notification.NoneReq
(*SendMailReq)(nil), // 2: notification.SendMailReq
(*SendSMSReq)(nil), // 3: notification.SendSMSReq
(*SendByTemplateIDReq)(nil), // 4: notification.SendByTemplateIDReq
nil, // 5: notification.SendByTemplateIDReq.ContentDataEntry
}
var file_generate_protobuf_service_proto_depIdxs = []int32{
5, // 0: notification.SendByTemplateIDReq.content_data:type_name -> notification.SendByTemplateIDReq.ContentDataEntry
2, // 1: notification.SenderService.SendMail:input_type -> notification.SendMailReq
3, // 2: notification.SenderService.SendSms:input_type -> notification.SendSMSReq
4, // 3: notification.SenderService.SendMailByTemplateId:input_type -> notification.SendByTemplateIDReq
4, // 4: notification.SenderService.SendSmsByTemplateId:input_type -> notification.SendByTemplateIDReq
0, // 5: notification.SenderService.SendMail:output_type -> notification.OKResp
0, // 6: notification.SenderService.SendSms:output_type -> notification.OKResp
0, // 7: notification.SenderService.SendMailByTemplateId:output_type -> notification.OKResp
0, // 8: notification.SenderService.SendSmsByTemplateId:output_type -> notification.OKResp
5, // [5:9] is the sub-list for method output_type
1, // [1:5] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_generate_protobuf_service_proto_init() }
func file_generate_protobuf_service_proto_init() {
if File_generate_protobuf_service_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_generate_protobuf_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*OKResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_generate_protobuf_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*NoneReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_generate_protobuf_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*SendMailReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_generate_protobuf_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*SendSMSReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_generate_protobuf_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*SendByTemplateIDReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_generate_protobuf_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_generate_protobuf_service_proto_goTypes,
DependencyIndexes: file_generate_protobuf_service_proto_depIdxs,
MessageInfos: file_generate_protobuf_service_proto_msgTypes,
}.Build()
File_generate_protobuf_service_proto = out.File
file_generate_protobuf_service_proto_rawDesc = nil
file_generate_protobuf_service_proto_goTypes = nil
file_generate_protobuf_service_proto_depIdxs = nil
}

View File

@ -0,0 +1,232 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc v3.19.4
// source: generate/protobuf/service.proto
package notification
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.62.0 or later.
const _ = grpc.SupportPackageIsVersion8
const (
SenderService_SendMail_FullMethodName = "/notification.SenderService/SendMail"
SenderService_SendSms_FullMethodName = "/notification.SenderService/SendSms"
SenderService_SendMailByTemplateId_FullMethodName = "/notification.SenderService/SendMailByTemplateId"
SenderService_SendSmsByTemplateId_FullMethodName = "/notification.SenderService/SendSmsByTemplateId"
)
// SenderServiceClient is the client API for SenderService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SenderServiceClient 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)
}
type senderServiceClient struct {
cc grpc.ClientConnInterface
}
func NewSenderServiceClient(cc grpc.ClientConnInterface) SenderServiceClient {
return &senderServiceClient{cc}
}
func (c *senderServiceClient) SendMail(ctx context.Context, in *SendMailReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, SenderService_SendMail_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *senderServiceClient) SendSms(ctx context.Context, in *SendSMSReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, SenderService_SendSms_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *senderServiceClient) SendMailByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, SenderService_SendMailByTemplateId_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *senderServiceClient) SendSmsByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, SenderService_SendSmsByTemplateId_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// SenderServiceServer is the server API for SenderService service.
// All implementations must embed UnimplementedSenderServiceServer
// for forward compatibility
type SenderServiceServer interface {
// SendMail 寄信
SendMail(context.Context, *SendMailReq) (*OKResp, error)
// SendSms 寄簡訊
SendSms(context.Context, *SendSMSReq) (*OKResp, error)
// SendMailByTemplateId 寄送模板信件
SendMailByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error)
// SendSmsByTemplateId 寄送模板簡訊
SendSmsByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error)
mustEmbedUnimplementedSenderServiceServer()
}
// UnimplementedSenderServiceServer must be embedded to have forward compatible implementations.
type UnimplementedSenderServiceServer struct {
}
func (UnimplementedSenderServiceServer) SendMail(context.Context, *SendMailReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendMail not implemented")
}
func (UnimplementedSenderServiceServer) SendSms(context.Context, *SendSMSReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendSms not implemented")
}
func (UnimplementedSenderServiceServer) SendMailByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendMailByTemplateId not implemented")
}
func (UnimplementedSenderServiceServer) SendSmsByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendSmsByTemplateId not implemented")
}
func (UnimplementedSenderServiceServer) mustEmbedUnimplementedSenderServiceServer() {}
// UnsafeSenderServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SenderServiceServer will
// result in compilation errors.
type UnsafeSenderServiceServer interface {
mustEmbedUnimplementedSenderServiceServer()
}
func RegisterSenderServiceServer(s grpc.ServiceRegistrar, srv SenderServiceServer) {
s.RegisterService(&SenderService_ServiceDesc, srv)
}
func _SenderService_SendMail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendMailReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SenderServiceServer).SendMail(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SenderService_SendMail_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SenderServiceServer).SendMail(ctx, req.(*SendMailReq))
}
return interceptor(ctx, in, info, handler)
}
func _SenderService_SendSms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendSMSReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SenderServiceServer).SendSms(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SenderService_SendSms_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SenderServiceServer).SendSms(ctx, req.(*SendSMSReq))
}
return interceptor(ctx, in, info, handler)
}
func _SenderService_SendMailByTemplateId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendByTemplateIDReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SenderServiceServer).SendMailByTemplateId(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SenderService_SendMailByTemplateId_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SenderServiceServer).SendMailByTemplateId(ctx, req.(*SendByTemplateIDReq))
}
return interceptor(ctx, in, info, handler)
}
func _SenderService_SendSmsByTemplateId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendByTemplateIDReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SenderServiceServer).SendSmsByTemplateId(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SenderService_SendSmsByTemplateId_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SenderServiceServer).SendSmsByTemplateId(ctx, req.(*SendByTemplateIDReq))
}
return interceptor(ctx, in, info, handler)
}
// SenderService_ServiceDesc is the grpc.ServiceDesc for SenderService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SenderService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "notification.SenderService",
HandlerType: (*SenderServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SendMail",
Handler: _SenderService_SendMail_Handler,
},
{
MethodName: "SendSms",
Handler: _SenderService_SendSms_Handler,
},
{
MethodName: "SendMailByTemplateId",
Handler: _SenderService_SendMailByTemplateId_Handler,
},
{
MethodName: "SendSmsByTemplateId",
Handler: _SenderService_SendSmsByTemplateId_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "generate/protobuf/service.proto",
}