feat: new proto

This commit is contained in:
王性驊 2025-03-02 21:45:50 +08:00
parent 4a87e93fd2
commit eb4150ecba
6 changed files with 2001 additions and 2171 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.4.0 // - protoc-gen-go-grpc v1.5.1
// - protoc v3.19.4 // - protoc v3.19.4
// source: generate/protobuf/member.proto // source: generate/protobuf/member.proto
@ -8,6 +8,7 @@ package member
import ( import (
context "context" context "context"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
@ -15,25 +16,29 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.62.0 or later. // Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion8 const _ = grpc.SupportPackageIsVersion9
const ( const (
Account_CreateUserAccount_FullMethodName = "/member.Account/CreateUserAccount" Account_CreateUserAccount_FullMethodName = "/member.Account/CreateUserAccount"
Account_GetUserAccountInfo_FullMethodName = "/member.Account/GetUserAccountInfo" Account_GetUserAccountInfo_FullMethodName = "/member.Account/GetUserAccountInfo"
Account_UpdateUserToken_FullMethodName = "/member.Account/UpdateUserToken" Account_UpdateUserToken_FullMethodName = "/member.Account/UpdateUserToken"
Account_GetUidByAccount_FullMethodName = "/member.Account/GetUidByAccount" Account_GetUIDByAccount_FullMethodName = "/member.Account/GetUIDByAccount"
Account_BindAccount_FullMethodName = "/member.Account/BindAccount" Account_BindAccount_FullMethodName = "/member.Account/BindAccount"
Account_BindUserInfo_FullMethodName = "/member.Account/BindUserInfo" Account_BindUserInfo_FullMethodName = "/member.Account/BindUserInfo"
Account_UpdateUserInfo_FullMethodName = "/member.Account/UpdateUserInfo" Account_BindVerifyEmail_FullMethodName = "/member.Account/BindVerifyEmail"
Account_UpdateStatus_FullMethodName = "/member.Account/UpdateStatus" Account_BindVerifyPhone_FullMethodName = "/member.Account/BindVerifyPhone"
Account_GetUserInfo_FullMethodName = "/member.Account/GetUserInfo" Account_UpdateUserInfo_FullMethodName = "/member.Account/UpdateUserInfo"
Account_ListMember_FullMethodName = "/member.Account/ListMember" Account_UpdateStatus_FullMethodName = "/member.Account/UpdateStatus"
Account_GenerateRefreshCode_FullMethodName = "/member.Account/GenerateRefreshCode" Account_GetUserInfo_FullMethodName = "/member.Account/GetUserInfo"
Account_VerifyRefreshCode_FullMethodName = "/member.Account/VerifyRefreshCode" Account_ListMember_FullMethodName = "/member.Account/ListMember"
Account_CheckRefreshCode_FullMethodName = "/member.Account/CheckRefreshCode" Account_GenerateRefreshCode_FullMethodName = "/member.Account/GenerateRefreshCode"
Account_VerifyGoogleAuthResult_FullMethodName = "/member.Account/VerifyGoogleAuthResult" Account_VerifyRefreshCode_FullMethodName = "/member.Account/VerifyRefreshCode"
Account_VerifyPlatformAuthResult_FullMethodName = "/member.Account/VerifyPlatformAuthResult" Account_CheckRefreshCode_FullMethodName = "/member.Account/CheckRefreshCode"
Account_VerifyGoogleAuthResult_FullMethodName = "/member.Account/VerifyGoogleAuthResult"
Account_VerifyPlatformAuthResult_FullMethodName = "/member.Account/VerifyPlatformAuthResult"
Account_LineCodeToAccessToken_FullMethodName = "/member.Account/LineCodeToAccessToken"
Account_LineGetProfileByAccessToken_FullMethodName = "/member.Account/LineGetProfileByAccessToken"
) )
// AccountClient is the client API for Account service. // AccountClient is the client API for Account service.
@ -46,12 +51,16 @@ type AccountClient interface {
GetUserAccountInfo(ctx context.Context, in *GetUIDByAccountReq, opts ...grpc.CallOption) (*GetAccountInfoResp, error) GetUserAccountInfo(ctx context.Context, in *GetUIDByAccountReq, opts ...grpc.CallOption) (*GetAccountInfoResp, error)
// UpdateUserToken 更新密碼 // UpdateUserToken 更新密碼
UpdateUserToken(ctx context.Context, in *UpdateTokenReq, opts ...grpc.CallOption) (*OKResp, error) UpdateUserToken(ctx context.Context, in *UpdateTokenReq, opts ...grpc.CallOption) (*OKResp, error)
// GetUidByAccount 用帳號換取 UID // GetUIDByAccount 用帳號換取 UID
GetUidByAccount(ctx context.Context, in *GetUIDByAccountReq, opts ...grpc.CallOption) (*GetUidByAccountResp, error) GetUIDByAccount(ctx context.Context, in *GetUIDByAccountReq, opts ...grpc.CallOption) (*GetUIDByAccountResp, error)
// BindAccount 綁定帳號 -> account bind to UID // BindAccount 綁定帳號 -> account bind to UID
BindAccount(ctx context.Context, in *BindingUserReq, opts ...grpc.CallOption) (*BindingUserResp, error) BindAccount(ctx context.Context, in *BindingUserReq, opts ...grpc.CallOption) (*BindingUserResp, error)
// BindUserInfo 初次,綁定 User Info // BindUserInfo 初次,綁定 User Info
BindUserInfo(ctx context.Context, in *CreateUserInfoReq, opts ...grpc.CallOption) (*OKResp, error) BindUserInfo(ctx context.Context, in *CreateUserInfoReq, opts ...grpc.CallOption) (*OKResp, error)
// BindVerifyEmail 綁定 Email
BindVerifyEmail(ctx context.Context, in *BindVerifyEmailReq, opts ...grpc.CallOption) (*OKResp, error)
// BindVerifyPhone 綁定 Phone
BindVerifyPhone(ctx context.Context, in *BindVerifyPhoneReq, opts ...grpc.CallOption) (*OKResp, error)
// UpdateUserInfo 更新 User Info // UpdateUserInfo 更新 User Info
UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*OKResp, error) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*OKResp, error)
// UpdateStatus 修改狀態 // UpdateStatus 修改狀態
@ -67,9 +76,13 @@ type AccountClient interface {
// CheckRefreshCode 驗證忘記密碼 token 不刪除,只確認) // CheckRefreshCode 驗證忘記密碼 token 不刪除,只確認)
CheckRefreshCode(ctx context.Context, in *VerifyRefreshCodeReq, opts ...grpc.CallOption) (*OKResp, error) CheckRefreshCode(ctx context.Context, in *VerifyRefreshCodeReq, opts ...grpc.CallOption) (*OKResp, error)
// VerifyGoogleAuthResult 驗證 google 登入是否有效 // VerifyGoogleAuthResult 驗證 google 登入是否有效
VerifyGoogleAuthResult(ctx context.Context, in *VerifyAuthResultReq, opts ...grpc.CallOption) (*VerifyAuthResultResp, error) VerifyGoogleAuthResult(ctx context.Context, in *VerifyAuthResultReq, opts ...grpc.CallOption) (*VerifyGoogleAuthResultResp, error)
// VerifyPlatformAuthResult 驗證 google 登入是否有效 // VerifyPlatformAuthResult 驗證 google 登入是否有效
VerifyPlatformAuthResult(ctx context.Context, in *VerifyAuthResultReq, opts ...grpc.CallOption) (*VerifyAuthResultResp, error) VerifyPlatformAuthResult(ctx context.Context, in *VerifyAuthResultReq, opts ...grpc.CallOption) (*VerifyAuthResultResp, error)
// LineCodeToAccessToken Line 驗證相關
LineCodeToAccessToken(ctx context.Context, in *LineGetTokenReq, opts ...grpc.CallOption) (*LineAccessTokenResp, error)
// LineGetProfileByAccessToken Line 驗證相關
LineGetProfileByAccessToken(ctx context.Context, in *LineGetUserInfoReq, opts ...grpc.CallOption) (*LineUserProfile, error)
} }
type accountClient struct { type accountClient struct {
@ -110,10 +123,10 @@ func (c *accountClient) UpdateUserToken(ctx context.Context, in *UpdateTokenReq,
return out, nil return out, nil
} }
func (c *accountClient) GetUidByAccount(ctx context.Context, in *GetUIDByAccountReq, opts ...grpc.CallOption) (*GetUidByAccountResp, error) { func (c *accountClient) GetUIDByAccount(ctx context.Context, in *GetUIDByAccountReq, opts ...grpc.CallOption) (*GetUIDByAccountResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetUidByAccountResp) out := new(GetUIDByAccountResp)
err := c.cc.Invoke(ctx, Account_GetUidByAccount_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, Account_GetUIDByAccount_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -140,6 +153,26 @@ func (c *accountClient) BindUserInfo(ctx context.Context, in *CreateUserInfoReq,
return out, nil return out, nil
} }
func (c *accountClient) BindVerifyEmail(ctx context.Context, in *BindVerifyEmailReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, Account_BindVerifyEmail_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) BindVerifyPhone(ctx context.Context, in *BindVerifyPhoneReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, Account_BindVerifyPhone_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) { func (c *accountClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp) out := new(OKResp)
@ -210,9 +243,9 @@ func (c *accountClient) CheckRefreshCode(ctx context.Context, in *VerifyRefreshC
return out, nil return out, nil
} }
func (c *accountClient) VerifyGoogleAuthResult(ctx context.Context, in *VerifyAuthResultReq, opts ...grpc.CallOption) (*VerifyAuthResultResp, error) { func (c *accountClient) VerifyGoogleAuthResult(ctx context.Context, in *VerifyAuthResultReq, opts ...grpc.CallOption) (*VerifyGoogleAuthResultResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(VerifyAuthResultResp) out := new(VerifyGoogleAuthResultResp)
err := c.cc.Invoke(ctx, Account_VerifyGoogleAuthResult_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, Account_VerifyGoogleAuthResult_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
@ -230,9 +263,29 @@ func (c *accountClient) VerifyPlatformAuthResult(ctx context.Context, in *Verify
return out, nil return out, nil
} }
func (c *accountClient) LineCodeToAccessToken(ctx context.Context, in *LineGetTokenReq, opts ...grpc.CallOption) (*LineAccessTokenResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LineAccessTokenResp)
err := c.cc.Invoke(ctx, Account_LineCodeToAccessToken_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountClient) LineGetProfileByAccessToken(ctx context.Context, in *LineGetUserInfoReq, opts ...grpc.CallOption) (*LineUserProfile, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LineUserProfile)
err := c.cc.Invoke(ctx, Account_LineGetProfileByAccessToken_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AccountServer is the server API for Account service. // AccountServer is the server API for Account service.
// All implementations must embed UnimplementedAccountServer // All implementations must embed UnimplementedAccountServer
// for forward compatibility // for forward compatibility.
type AccountServer interface { type AccountServer interface {
// CreateUserAccount 建立帳號與密碼 -> 可登入,但可不可以做其他事情看業務流程,也可以只註冊就好 // CreateUserAccount 建立帳號與密碼 -> 可登入,但可不可以做其他事情看業務流程,也可以只註冊就好
CreateUserAccount(context.Context, *CreateLoginUserReq) (*OKResp, error) CreateUserAccount(context.Context, *CreateLoginUserReq) (*OKResp, error)
@ -240,12 +293,16 @@ type AccountServer interface {
GetUserAccountInfo(context.Context, *GetUIDByAccountReq) (*GetAccountInfoResp, error) GetUserAccountInfo(context.Context, *GetUIDByAccountReq) (*GetAccountInfoResp, error)
// UpdateUserToken 更新密碼 // UpdateUserToken 更新密碼
UpdateUserToken(context.Context, *UpdateTokenReq) (*OKResp, error) UpdateUserToken(context.Context, *UpdateTokenReq) (*OKResp, error)
// GetUidByAccount 用帳號換取 UID // GetUIDByAccount 用帳號換取 UID
GetUidByAccount(context.Context, *GetUIDByAccountReq) (*GetUidByAccountResp, error) GetUIDByAccount(context.Context, *GetUIDByAccountReq) (*GetUIDByAccountResp, error)
// BindAccount 綁定帳號 -> account bind to UID // BindAccount 綁定帳號 -> account bind to UID
BindAccount(context.Context, *BindingUserReq) (*BindingUserResp, error) BindAccount(context.Context, *BindingUserReq) (*BindingUserResp, error)
// BindUserInfo 初次,綁定 User Info // BindUserInfo 初次,綁定 User Info
BindUserInfo(context.Context, *CreateUserInfoReq) (*OKResp, error) BindUserInfo(context.Context, *CreateUserInfoReq) (*OKResp, error)
// BindVerifyEmail 綁定 Email
BindVerifyEmail(context.Context, *BindVerifyEmailReq) (*OKResp, error)
// BindVerifyPhone 綁定 Phone
BindVerifyPhone(context.Context, *BindVerifyPhoneReq) (*OKResp, error)
// UpdateUserInfo 更新 User Info // UpdateUserInfo 更新 User Info
UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*OKResp, error) UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*OKResp, error)
// UpdateStatus 修改狀態 // UpdateStatus 修改狀態
@ -261,15 +318,22 @@ type AccountServer interface {
// CheckRefreshCode 驗證忘記密碼 token 不刪除,只確認) // CheckRefreshCode 驗證忘記密碼 token 不刪除,只確認)
CheckRefreshCode(context.Context, *VerifyRefreshCodeReq) (*OKResp, error) CheckRefreshCode(context.Context, *VerifyRefreshCodeReq) (*OKResp, error)
// VerifyGoogleAuthResult 驗證 google 登入是否有效 // VerifyGoogleAuthResult 驗證 google 登入是否有效
VerifyGoogleAuthResult(context.Context, *VerifyAuthResultReq) (*VerifyAuthResultResp, error) VerifyGoogleAuthResult(context.Context, *VerifyAuthResultReq) (*VerifyGoogleAuthResultResp, error)
// VerifyPlatformAuthResult 驗證 google 登入是否有效 // VerifyPlatformAuthResult 驗證 google 登入是否有效
VerifyPlatformAuthResult(context.Context, *VerifyAuthResultReq) (*VerifyAuthResultResp, error) VerifyPlatformAuthResult(context.Context, *VerifyAuthResultReq) (*VerifyAuthResultResp, error)
// LineCodeToAccessToken Line 驗證相關
LineCodeToAccessToken(context.Context, *LineGetTokenReq) (*LineAccessTokenResp, error)
// LineGetProfileByAccessToken Line 驗證相關
LineGetProfileByAccessToken(context.Context, *LineGetUserInfoReq) (*LineUserProfile, error)
mustEmbedUnimplementedAccountServer() mustEmbedUnimplementedAccountServer()
} }
// UnimplementedAccountServer must be embedded to have forward compatible implementations. // UnimplementedAccountServer must be embedded to have
type UnimplementedAccountServer struct { // forward compatible implementations.
} //
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAccountServer struct{}
func (UnimplementedAccountServer) CreateUserAccount(context.Context, *CreateLoginUserReq) (*OKResp, error) { func (UnimplementedAccountServer) CreateUserAccount(context.Context, *CreateLoginUserReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateUserAccount not implemented") return nil, status.Errorf(codes.Unimplemented, "method CreateUserAccount not implemented")
@ -280,8 +344,8 @@ func (UnimplementedAccountServer) GetUserAccountInfo(context.Context, *GetUIDByA
func (UnimplementedAccountServer) UpdateUserToken(context.Context, *UpdateTokenReq) (*OKResp, error) { func (UnimplementedAccountServer) UpdateUserToken(context.Context, *UpdateTokenReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateUserToken not implemented") return nil, status.Errorf(codes.Unimplemented, "method UpdateUserToken not implemented")
} }
func (UnimplementedAccountServer) GetUidByAccount(context.Context, *GetUIDByAccountReq) (*GetUidByAccountResp, error) { func (UnimplementedAccountServer) GetUIDByAccount(context.Context, *GetUIDByAccountReq) (*GetUIDByAccountResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUidByAccount not implemented") return nil, status.Errorf(codes.Unimplemented, "method GetUIDByAccount not implemented")
} }
func (UnimplementedAccountServer) BindAccount(context.Context, *BindingUserReq) (*BindingUserResp, error) { func (UnimplementedAccountServer) BindAccount(context.Context, *BindingUserReq) (*BindingUserResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BindAccount not implemented") return nil, status.Errorf(codes.Unimplemented, "method BindAccount not implemented")
@ -289,6 +353,12 @@ func (UnimplementedAccountServer) BindAccount(context.Context, *BindingUserReq)
func (UnimplementedAccountServer) BindUserInfo(context.Context, *CreateUserInfoReq) (*OKResp, error) { func (UnimplementedAccountServer) BindUserInfo(context.Context, *CreateUserInfoReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BindUserInfo not implemented") return nil, status.Errorf(codes.Unimplemented, "method BindUserInfo not implemented")
} }
func (UnimplementedAccountServer) BindVerifyEmail(context.Context, *BindVerifyEmailReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BindVerifyEmail not implemented")
}
func (UnimplementedAccountServer) BindVerifyPhone(context.Context, *BindVerifyPhoneReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BindVerifyPhone not implemented")
}
func (UnimplementedAccountServer) UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*OKResp, error) { func (UnimplementedAccountServer) UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInfo not implemented") return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInfo not implemented")
} }
@ -310,13 +380,20 @@ func (UnimplementedAccountServer) VerifyRefreshCode(context.Context, *VerifyRefr
func (UnimplementedAccountServer) CheckRefreshCode(context.Context, *VerifyRefreshCodeReq) (*OKResp, error) { func (UnimplementedAccountServer) CheckRefreshCode(context.Context, *VerifyRefreshCodeReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CheckRefreshCode not implemented") return nil, status.Errorf(codes.Unimplemented, "method CheckRefreshCode not implemented")
} }
func (UnimplementedAccountServer) VerifyGoogleAuthResult(context.Context, *VerifyAuthResultReq) (*VerifyAuthResultResp, error) { func (UnimplementedAccountServer) VerifyGoogleAuthResult(context.Context, *VerifyAuthResultReq) (*VerifyGoogleAuthResultResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifyGoogleAuthResult not implemented") return nil, status.Errorf(codes.Unimplemented, "method VerifyGoogleAuthResult not implemented")
} }
func (UnimplementedAccountServer) VerifyPlatformAuthResult(context.Context, *VerifyAuthResultReq) (*VerifyAuthResultResp, error) { func (UnimplementedAccountServer) VerifyPlatformAuthResult(context.Context, *VerifyAuthResultReq) (*VerifyAuthResultResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifyPlatformAuthResult not implemented") return nil, status.Errorf(codes.Unimplemented, "method VerifyPlatformAuthResult not implemented")
} }
func (UnimplementedAccountServer) LineCodeToAccessToken(context.Context, *LineGetTokenReq) (*LineAccessTokenResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method LineCodeToAccessToken not implemented")
}
func (UnimplementedAccountServer) LineGetProfileByAccessToken(context.Context, *LineGetUserInfoReq) (*LineUserProfile, error) {
return nil, status.Errorf(codes.Unimplemented, "method LineGetProfileByAccessToken not implemented")
}
func (UnimplementedAccountServer) mustEmbedUnimplementedAccountServer() {} func (UnimplementedAccountServer) mustEmbedUnimplementedAccountServer() {}
func (UnimplementedAccountServer) testEmbeddedByValue() {}
// UnsafeAccountServer may be embedded to opt out of forward compatibility for this service. // 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 // Use of this interface is not recommended, as added methods to AccountServer will
@ -326,6 +403,13 @@ type UnsafeAccountServer interface {
} }
func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer) { func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer) {
// If the following call pancis, it indicates UnimplementedAccountServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Account_ServiceDesc, srv) s.RegisterService(&Account_ServiceDesc, srv)
} }
@ -383,20 +467,20 @@ func _Account_UpdateUserToken_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Account_GetUidByAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Account_GetUIDByAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUIDByAccountReq) in := new(GetUIDByAccountReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(AccountServer).GetUidByAccount(ctx, in) return srv.(AccountServer).GetUIDByAccount(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Account_GetUidByAccount_FullMethodName, FullMethod: Account_GetUIDByAccount_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).GetUidByAccount(ctx, req.(*GetUIDByAccountReq)) return srv.(AccountServer).GetUIDByAccount(ctx, req.(*GetUIDByAccountReq))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -437,6 +521,42 @@ func _Account_BindUserInfo_Handler(srv interface{}, ctx context.Context, dec fun
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Account_BindVerifyEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BindVerifyEmailReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).BindVerifyEmail(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_BindVerifyEmail_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).BindVerifyEmail(ctx, req.(*BindVerifyEmailReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_BindVerifyPhone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BindVerifyPhoneReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).BindVerifyPhone(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_BindVerifyPhone_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).BindVerifyPhone(ctx, req.(*BindVerifyPhoneReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Account_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateUserInfoReq) in := new(UpdateUserInfoReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -599,6 +719,42 @@ func _Account_VerifyPlatformAuthResult_Handler(srv interface{}, ctx context.Cont
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Account_LineCodeToAccessToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LineGetTokenReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).LineCodeToAccessToken(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_LineCodeToAccessToken_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).LineCodeToAccessToken(ctx, req.(*LineGetTokenReq))
}
return interceptor(ctx, in, info, handler)
}
func _Account_LineGetProfileByAccessToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LineGetUserInfoReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServer).LineGetProfileByAccessToken(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Account_LineGetProfileByAccessToken_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServer).LineGetProfileByAccessToken(ctx, req.(*LineGetUserInfoReq))
}
return interceptor(ctx, in, info, handler)
}
// Account_ServiceDesc is the grpc.ServiceDesc for Account service. // Account_ServiceDesc is the grpc.ServiceDesc for Account service.
// It's only intended for direct use with grpc.RegisterService, // It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
@ -619,8 +775,8 @@ var Account_ServiceDesc = grpc.ServiceDesc{
Handler: _Account_UpdateUserToken_Handler, Handler: _Account_UpdateUserToken_Handler,
}, },
{ {
MethodName: "GetUidByAccount", MethodName: "GetUIDByAccount",
Handler: _Account_GetUidByAccount_Handler, Handler: _Account_GetUIDByAccount_Handler,
}, },
{ {
MethodName: "BindAccount", MethodName: "BindAccount",
@ -630,6 +786,14 @@ var Account_ServiceDesc = grpc.ServiceDesc{
MethodName: "BindUserInfo", MethodName: "BindUserInfo",
Handler: _Account_BindUserInfo_Handler, Handler: _Account_BindUserInfo_Handler,
}, },
{
MethodName: "BindVerifyEmail",
Handler: _Account_BindVerifyEmail_Handler,
},
{
MethodName: "BindVerifyPhone",
Handler: _Account_BindVerifyPhone_Handler,
},
{ {
MethodName: "UpdateUserInfo", MethodName: "UpdateUserInfo",
Handler: _Account_UpdateUserInfo_Handler, Handler: _Account_UpdateUserInfo_Handler,
@ -666,6 +830,14 @@ var Account_ServiceDesc = grpc.ServiceDesc{
MethodName: "VerifyPlatformAuthResult", MethodName: "VerifyPlatformAuthResult",
Handler: _Account_VerifyPlatformAuthResult_Handler, Handler: _Account_VerifyPlatformAuthResult_Handler,
}, },
{
MethodName: "LineCodeToAccessToken",
Handler: _Account_LineCodeToAccessToken_Handler,
},
{
MethodName: "LineGetProfileByAccessToken",
Handler: _Account_LineGetProfileByAccessToken_Handler,
},
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "generate/protobuf/member.proto", Metadata: "generate/protobuf/member.proto",

View File

@ -1,16 +1,17 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.2 // protoc-gen-go v1.36.1
// protoc v3.19.4 // protoc v3.19.4
// source: generate/protobuf/notification.proto // source: generate/protobuf/notification.proto
package notification package notification
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
) )
const ( const (
@ -22,18 +23,16 @@ const (
// OKResp // OKResp
type OKResp struct { type OKResp struct {
state protoimpl.MessageState state protoimpl.MessageState `protogen:"open.v1"`
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
} }
func (x *OKResp) Reset() { func (x *OKResp) Reset() {
*x = OKResp{} *x = OKResp{}
if protoimpl.UnsafeEnabled { mi := &file_generate_protobuf_notification_proto_msgTypes[0]
mi := &file_generate_protobuf_notification_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi)
ms.StoreMessageInfo(mi)
}
} }
func (x *OKResp) String() string { func (x *OKResp) String() string {
@ -44,7 +43,7 @@ func (*OKResp) ProtoMessage() {}
func (x *OKResp) ProtoReflect() protoreflect.Message { func (x *OKResp) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_notification_proto_msgTypes[0] mi := &file_generate_protobuf_notification_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -61,18 +60,16 @@ func (*OKResp) Descriptor() ([]byte, []int) {
// NoneReq // NoneReq
type NoneReq struct { type NoneReq struct {
state protoimpl.MessageState state protoimpl.MessageState `protogen:"open.v1"`
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
} }
func (x *NoneReq) Reset() { func (x *NoneReq) Reset() {
*x = NoneReq{} *x = NoneReq{}
if protoimpl.UnsafeEnabled { mi := &file_generate_protobuf_notification_proto_msgTypes[1]
mi := &file_generate_protobuf_notification_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi)
ms.StoreMessageInfo(mi)
}
} }
func (x *NoneReq) String() string { func (x *NoneReq) String() string {
@ -83,7 +80,7 @@ func (*NoneReq) ProtoMessage() {}
func (x *NoneReq) ProtoReflect() protoreflect.Message { func (x *NoneReq) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_notification_proto_msgTypes[1] mi := &file_generate_protobuf_notification_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -99,23 +96,20 @@ func (*NoneReq) Descriptor() ([]byte, []int) {
} }
type SendMailReq struct { type SendMailReq struct {
state protoimpl.MessageState state protoimpl.MessageState `protogen:"open.v1"`
sizeCache protoimpl.SizeCache 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"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
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() { func (x *SendMailReq) Reset() {
*x = SendMailReq{} *x = SendMailReq{}
if protoimpl.UnsafeEnabled { mi := &file_generate_protobuf_notification_proto_msgTypes[2]
mi := &file_generate_protobuf_notification_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi)
ms.StoreMessageInfo(mi)
}
} }
func (x *SendMailReq) String() string { func (x *SendMailReq) String() string {
@ -126,7 +120,7 @@ func (*SendMailReq) ProtoMessage() {}
func (x *SendMailReq) ProtoReflect() protoreflect.Message { func (x *SendMailReq) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_notification_proto_msgTypes[2] mi := &file_generate_protobuf_notification_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -170,22 +164,19 @@ func (x *SendMailReq) GetFrom() string {
} }
type SendSMSReq struct { type SendSMSReq struct {
state protoimpl.MessageState state protoimpl.MessageState `protogen:"open.v1"`
sizeCache protoimpl.SizeCache 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"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
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() { func (x *SendSMSReq) Reset() {
*x = SendSMSReq{} *x = SendSMSReq{}
if protoimpl.UnsafeEnabled { mi := &file_generate_protobuf_notification_proto_msgTypes[3]
mi := &file_generate_protobuf_notification_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi)
ms.StoreMessageInfo(mi)
}
} }
func (x *SendSMSReq) String() string { func (x *SendSMSReq) String() string {
@ -196,7 +187,7 @@ func (*SendSMSReq) ProtoMessage() {}
func (x *SendSMSReq) ProtoReflect() protoreflect.Message { func (x *SendSMSReq) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_notification_proto_msgTypes[3] mi := &file_generate_protobuf_notification_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -232,35 +223,30 @@ func (x *SendSMSReq) GetRecipientName() string {
return "" return ""
} }
type SendByTemplateIDReq struct { type TemplateReq struct {
state protoimpl.MessageState state protoimpl.MessageState `protogen:"open.v1"`
sizeCache protoimpl.SizeCache Language string `protobuf:"bytes,1,opt,name=language,proto3" json:"language,omitempty"`
TemplateId string `protobuf:"bytes,2,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
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() { func (x *TemplateReq) Reset() {
*x = SendByTemplateIDReq{} *x = TemplateReq{}
if protoimpl.UnsafeEnabled { mi := &file_generate_protobuf_notification_proto_msgTypes[4]
mi := &file_generate_protobuf_notification_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi)
ms.StoreMessageInfo(mi)
}
} }
func (x *SendByTemplateIDReq) String() string { func (x *TemplateReq) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*SendByTemplateIDReq) ProtoMessage() {} func (*TemplateReq) ProtoMessage() {}
func (x *SendByTemplateIDReq) ProtoReflect() protoreflect.Message { func (x *TemplateReq) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_notification_proto_msgTypes[4] mi := &file_generate_protobuf_notification_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -270,37 +256,75 @@ func (x *SendByTemplateIDReq) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use SendByTemplateIDReq.ProtoReflect.Descriptor instead. // Deprecated: Use TemplateReq.ProtoReflect.Descriptor instead.
func (*SendByTemplateIDReq) Descriptor() ([]byte, []int) { func (*TemplateReq) Descriptor() ([]byte, []int) {
return file_generate_protobuf_notification_proto_rawDescGZIP(), []int{4} return file_generate_protobuf_notification_proto_rawDescGZIP(), []int{4}
} }
func (x *SendByTemplateIDReq) GetTo() string { func (x *TemplateReq) GetLanguage() string {
if x != nil { if x != nil {
return x.To return x.Language
} }
return "" return ""
} }
func (x *SendByTemplateIDReq) GetTemplateId() string { func (x *TemplateReq) GetTemplateId() string {
if x != nil { if x != nil {
return x.TemplateId return x.TemplateId
} }
return "" return ""
} }
func (x *SendByTemplateIDReq) GetLang() string { type TemplateResp struct {
state protoimpl.MessageState `protogen:"open.v1"`
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Body string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TemplateResp) Reset() {
*x = TemplateResp{}
mi := &file_generate_protobuf_notification_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TemplateResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TemplateResp) ProtoMessage() {}
func (x *TemplateResp) ProtoReflect() protoreflect.Message {
mi := &file_generate_protobuf_notification_proto_msgTypes[5]
if x != nil { if x != nil {
return x.Lang ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TemplateResp.ProtoReflect.Descriptor instead.
func (*TemplateResp) Descriptor() ([]byte, []int) {
return file_generate_protobuf_notification_proto_rawDescGZIP(), []int{5}
}
func (x *TemplateResp) GetTitle() string {
if x != nil {
return x.Title
} }
return "" return ""
} }
func (x *SendByTemplateIDReq) GetContentData() map[string]string { func (x *TemplateResp) GetBody() string {
if x != nil { if x != nil {
return x.ContentData return x.Body
} }
return nil return ""
} }
var File_generate_protobuf_notification_proto protoreflect.FileDescriptor var File_generate_protobuf_notification_proto protoreflect.FileDescriptor
@ -322,42 +346,30 @@ var file_generate_protobuf_notification_proto_rawDesc = []byte{
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x25, 0x0a, 0x0e, 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, 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, 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, 0x61, 0x6d, 0x65, 0x22, 0x4a, 0x0a, 0x0b, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x01,
0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x1f,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20,
0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x22,
0x6c, 0x61, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x38, 0x0a, 0x0c, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12,
0x12, 0x55, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x54, 0x65, 0x6d, 0x70, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x32, 0xd3, 0x01, 0x0a, 0x0d, 0x53, 0x65,
0x6c, 0x61, 0x74, 0x65, 0x49, 0x44, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x6e, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x53,
0x74, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69,
0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x3e, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x61, 0x69, 0x6c, 0x52,
0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x6e, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x07, 0x53, 0x65, 0x6e, 0x64,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x53, 0x6d, 0x73, 0x12, 0x18, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xa8, 0x02, 0x0a, 0x0d, 0x53, 0x65, 0x6e, 0x64, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x4d, 0x53, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e,
0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x53, 0x65, 0x6e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x4b, 0x52,
0x64, 0x4d, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66,
0x1a, 0x14, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x07, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
0x73, 0x12, 0x18, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42,
0x2e, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x4d, 0x53, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6e, 0x6f, 0x10, 0x5a, 0x0e, 0x2e, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
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 ( var (
@ -374,28 +386,25 @@ func file_generate_protobuf_notification_proto_rawDescGZIP() []byte {
var file_generate_protobuf_notification_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_generate_protobuf_notification_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_generate_protobuf_notification_proto_goTypes = []any{ var file_generate_protobuf_notification_proto_goTypes = []any{
(*OKResp)(nil), // 0: notification.OKResp (*OKResp)(nil), // 0: notification.OKResp
(*NoneReq)(nil), // 1: notification.NoneReq (*NoneReq)(nil), // 1: notification.NoneReq
(*SendMailReq)(nil), // 2: notification.SendMailReq (*SendMailReq)(nil), // 2: notification.SendMailReq
(*SendSMSReq)(nil), // 3: notification.SendSMSReq (*SendSMSReq)(nil), // 3: notification.SendSMSReq
(*SendByTemplateIDReq)(nil), // 4: notification.SendByTemplateIDReq (*TemplateReq)(nil), // 4: notification.TemplateReq
nil, // 5: notification.SendByTemplateIDReq.ContentDataEntry (*TemplateResp)(nil), // 5: notification.TemplateResp
} }
var file_generate_protobuf_notification_proto_depIdxs = []int32{ var file_generate_protobuf_notification_proto_depIdxs = []int32{
5, // 0: notification.SendByTemplateIDReq.content_data:type_name -> notification.SendByTemplateIDReq.ContentDataEntry 2, // 0: notification.SenderService.SendMail:input_type -> notification.SendMailReq
2, // 1: notification.SenderService.SendMail:input_type -> notification.SendMailReq 3, // 1: notification.SenderService.SendSms:input_type -> notification.SendSMSReq
3, // 2: notification.SenderService.SendSms:input_type -> notification.SendSMSReq 4, // 2: notification.SenderService.GetStaticTemplate:input_type -> notification.TemplateReq
4, // 3: notification.SenderService.SendMailByTemplateId:input_type -> notification.SendByTemplateIDReq 0, // 3: notification.SenderService.SendMail:output_type -> notification.OKResp
4, // 4: notification.SenderService.SendSmsByTemplateId:input_type -> notification.SendByTemplateIDReq 0, // 4: notification.SenderService.SendSms:output_type -> notification.OKResp
0, // 5: notification.SenderService.SendMail:output_type -> notification.OKResp 5, // 5: notification.SenderService.GetStaticTemplate:output_type -> notification.TemplateResp
0, // 6: notification.SenderService.SendSms:output_type -> notification.OKResp 3, // [3:6] is the sub-list for method output_type
0, // 7: notification.SenderService.SendMailByTemplateId:output_type -> notification.OKResp 0, // [0:3] is the sub-list for method input_type
0, // 8: notification.SenderService.SendSmsByTemplateId:output_type -> notification.OKResp 0, // [0:0] is the sub-list for extension type_name
5, // [5:9] is the sub-list for method output_type 0, // [0:0] is the sub-list for extension extendee
1, // [1:5] is the sub-list for method input_type 0, // [0:0] is the sub-list for field type_name
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_notification_proto_init() } func init() { file_generate_protobuf_notification_proto_init() }
@ -403,68 +412,6 @@ func file_generate_protobuf_notification_proto_init() {
if File_generate_protobuf_notification_proto != nil { if File_generate_protobuf_notification_proto != nil {
return return
} }
if !protoimpl.UnsafeEnabled {
file_generate_protobuf_notification_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_notification_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_notification_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_notification_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_notification_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{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.4.0 // - protoc-gen-go-grpc v1.5.1
// - protoc v3.19.4 // - protoc v3.19.4
// source: generate/protobuf/notification.proto // source: generate/protobuf/notification.proto
@ -8,6 +8,7 @@ package notification
import ( import (
context "context" context "context"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
@ -15,14 +16,13 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.62.0 or later. // Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion8 const _ = grpc.SupportPackageIsVersion9
const ( const (
SenderService_SendMail_FullMethodName = "/notification.SenderService/SendMail" SenderService_SendMail_FullMethodName = "/notification.SenderService/SendMail"
SenderService_SendSms_FullMethodName = "/notification.SenderService/SendSms" SenderService_SendSms_FullMethodName = "/notification.SenderService/SendSms"
SenderService_SendMailByTemplateId_FullMethodName = "/notification.SenderService/SendMailByTemplateId" SenderService_GetStaticTemplate_FullMethodName = "/notification.SenderService/GetStaticTemplate"
SenderService_SendSmsByTemplateId_FullMethodName = "/notification.SenderService/SendSmsByTemplateId"
) )
// SenderServiceClient is the client API for SenderService service. // SenderServiceClient is the client API for SenderService service.
@ -33,10 +33,8 @@ type SenderServiceClient interface {
SendMail(ctx context.Context, in *SendMailReq, opts ...grpc.CallOption) (*OKResp, error) SendMail(ctx context.Context, in *SendMailReq, opts ...grpc.CallOption) (*OKResp, error)
// SendSms 寄簡訊 // SendSms 寄簡訊
SendSms(ctx context.Context, in *SendSMSReq, opts ...grpc.CallOption) (*OKResp, error) SendSms(ctx context.Context, in *SendSMSReq, opts ...grpc.CallOption) (*OKResp, error)
// SendMailByTemplateId 寄送模板信件 // 取得 Template
SendMailByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error) GetStaticTemplate(ctx context.Context, in *TemplateReq, opts ...grpc.CallOption) (*TemplateResp, error)
// SendSmsByTemplateId 寄送模板簡訊
SendSmsByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error)
} }
type senderServiceClient struct { type senderServiceClient struct {
@ -67,20 +65,10 @@ func (c *senderServiceClient) SendSms(ctx context.Context, in *SendSMSReq, opts
return out, nil return out, nil
} }
func (c *senderServiceClient) SendMailByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error) { func (c *senderServiceClient) GetStaticTemplate(ctx context.Context, in *TemplateReq, opts ...grpc.CallOption) (*TemplateResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp) out := new(TemplateResp)
err := c.cc.Invoke(ctx, SenderService_SendMailByTemplateId_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, SenderService_GetStaticTemplate_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 { if err != nil {
return nil, err return nil, err
} }
@ -89,22 +77,23 @@ func (c *senderServiceClient) SendSmsByTemplateId(ctx context.Context, in *SendB
// SenderServiceServer is the server API for SenderService service. // SenderServiceServer is the server API for SenderService service.
// All implementations must embed UnimplementedSenderServiceServer // All implementations must embed UnimplementedSenderServiceServer
// for forward compatibility // for forward compatibility.
type SenderServiceServer interface { type SenderServiceServer interface {
// SendMail 寄信 // SendMail 寄信
SendMail(context.Context, *SendMailReq) (*OKResp, error) SendMail(context.Context, *SendMailReq) (*OKResp, error)
// SendSms 寄簡訊 // SendSms 寄簡訊
SendSms(context.Context, *SendSMSReq) (*OKResp, error) SendSms(context.Context, *SendSMSReq) (*OKResp, error)
// SendMailByTemplateId 寄送模板信件 // 取得 Template
SendMailByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error) GetStaticTemplate(context.Context, *TemplateReq) (*TemplateResp, error)
// SendSmsByTemplateId 寄送模板簡訊
SendSmsByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error)
mustEmbedUnimplementedSenderServiceServer() mustEmbedUnimplementedSenderServiceServer()
} }
// UnimplementedSenderServiceServer must be embedded to have forward compatible implementations. // UnimplementedSenderServiceServer must be embedded to have
type UnimplementedSenderServiceServer struct { // forward compatible implementations.
} //
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedSenderServiceServer struct{}
func (UnimplementedSenderServiceServer) SendMail(context.Context, *SendMailReq) (*OKResp, error) { func (UnimplementedSenderServiceServer) SendMail(context.Context, *SendMailReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendMail not implemented") return nil, status.Errorf(codes.Unimplemented, "method SendMail not implemented")
@ -112,13 +101,11 @@ func (UnimplementedSenderServiceServer) SendMail(context.Context, *SendMailReq)
func (UnimplementedSenderServiceServer) SendSms(context.Context, *SendSMSReq) (*OKResp, error) { func (UnimplementedSenderServiceServer) SendSms(context.Context, *SendSMSReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendSms not implemented") return nil, status.Errorf(codes.Unimplemented, "method SendSms not implemented")
} }
func (UnimplementedSenderServiceServer) SendMailByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error) { func (UnimplementedSenderServiceServer) GetStaticTemplate(context.Context, *TemplateReq) (*TemplateResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendMailByTemplateId not implemented") return nil, status.Errorf(codes.Unimplemented, "method GetStaticTemplate not implemented")
}
func (UnimplementedSenderServiceServer) SendSmsByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendSmsByTemplateId not implemented")
} }
func (UnimplementedSenderServiceServer) mustEmbedUnimplementedSenderServiceServer() {} func (UnimplementedSenderServiceServer) mustEmbedUnimplementedSenderServiceServer() {}
func (UnimplementedSenderServiceServer) testEmbeddedByValue() {}
// UnsafeSenderServiceServer may be embedded to opt out of forward compatibility for this service. // 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 // Use of this interface is not recommended, as added methods to SenderServiceServer will
@ -128,6 +115,13 @@ type UnsafeSenderServiceServer interface {
} }
func RegisterSenderServiceServer(s grpc.ServiceRegistrar, srv SenderServiceServer) { func RegisterSenderServiceServer(s grpc.ServiceRegistrar, srv SenderServiceServer) {
// If the following call pancis, it indicates UnimplementedSenderServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&SenderService_ServiceDesc, srv) s.RegisterService(&SenderService_ServiceDesc, srv)
} }
@ -167,38 +161,20 @@ func _SenderService_SendSms_Handler(srv interface{}, ctx context.Context, dec fu
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _SenderService_SendMailByTemplateId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _SenderService_GetStaticTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendByTemplateIDReq) in := new(TemplateReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(SenderServiceServer).SendMailByTemplateId(ctx, in) return srv.(SenderServiceServer).GetStaticTemplate(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: SenderService_SendMailByTemplateId_FullMethodName, FullMethod: SenderService_GetStaticTemplate_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SenderServiceServer).SendMailByTemplateId(ctx, req.(*SendByTemplateIDReq)) return srv.(SenderServiceServer).GetStaticTemplate(ctx, req.(*TemplateReq))
}
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) return interceptor(ctx, in, info, handler)
} }
@ -219,12 +195,8 @@ var SenderService_ServiceDesc = grpc.ServiceDesc{
Handler: _SenderService_SendSms_Handler, Handler: _SenderService_SendSms_Handler,
}, },
{ {
MethodName: "SendMailByTemplateId", MethodName: "GetStaticTemplate",
Handler: _SenderService_SendMailByTemplateId_Handler, Handler: _SenderService_GetStaticTemplate_Handler,
},
{
MethodName: "SendSmsByTemplateId",
Handler: _SenderService_SendSmsByTemplateId_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.4.0 // - protoc-gen-go-grpc v1.5.1
// - protoc v3.19.4 // - protoc v3.19.4
// source: generate/protobuf/permission.proto // source: generate/protobuf/permission.proto
@ -15,8 +15,8 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.62.0 or later. // Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion8 const _ = grpc.SupportPackageIsVersion9
const ( const (
TokenService_NewToken_FullMethodName = "/permission.TokenService/NewToken" TokenService_NewToken_FullMethodName = "/permission.TokenService/NewToken"
@ -24,11 +24,9 @@ const (
TokenService_CancelToken_FullMethodName = "/permission.TokenService/CancelToken" TokenService_CancelToken_FullMethodName = "/permission.TokenService/CancelToken"
TokenService_ValidationToken_FullMethodName = "/permission.TokenService/ValidationToken" TokenService_ValidationToken_FullMethodName = "/permission.TokenService/ValidationToken"
TokenService_CancelTokens_FullMethodName = "/permission.TokenService/CancelTokens" TokenService_CancelTokens_FullMethodName = "/permission.TokenService/CancelTokens"
TokenService_CancelTokenByDeviceId_FullMethodName = "/permission.TokenService/CancelTokenByDeviceId" TokenService_CancelTokenByDeviceID_FullMethodName = "/permission.TokenService/CancelTokenByDeviceID"
TokenService_GetUserTokensByDeviceId_FullMethodName = "/permission.TokenService/GetUserTokensByDeviceId" TokenService_GetUserTokensByDeviceID_FullMethodName = "/permission.TokenService/GetUserTokensByDeviceID"
TokenService_GetUserTokensByUid_FullMethodName = "/permission.TokenService/GetUserTokensByUid" TokenService_GetUserTokensByUID_FullMethodName = "/permission.TokenService/GetUserTokensByUID"
TokenService_NewOneTimeToken_FullMethodName = "/permission.TokenService/NewOneTimeToken"
TokenService_CancelOneTimeToken_FullMethodName = "/permission.TokenService/CancelOneTimeToken"
) )
// TokenServiceClient is the client API for TokenService service. // TokenServiceClient is the client API for TokenService service.
@ -49,16 +47,12 @@ type TokenServiceClient interface {
ValidationToken(ctx context.Context, in *ValidationTokenReq, opts ...grpc.CallOption) (*ValidationTokenResp, error) ValidationToken(ctx context.Context, in *ValidationTokenReq, opts ...grpc.CallOption) (*ValidationTokenResp, error)
// CancelTokens 取消 Token 從UID 視角,以及 token id 視角出發, UID 登出,底下所有 Device ID 也要登出, Token ID 登出, 所有 UID + Device 都要登出 // CancelTokens 取消 Token 從UID 視角,以及 token id 視角出發, UID 登出,底下所有 Device ID 也要登出, Token ID 登出, 所有 UID + Device 都要登出
CancelTokens(ctx context.Context, in *DoTokenByUIDReq, opts ...grpc.CallOption) (*OKResp, error) CancelTokens(ctx context.Context, in *DoTokenByUIDReq, opts ...grpc.CallOption) (*OKResp, error)
// CancelTokenByDeviceId 取消 Token 從 Device 視角出發可以選登出這個Device 下所有 token 登出這個Device 下指定token // CancelTokenByDeviceID 取消 Token 從 Device 視角出發可以選登出這個Device 下所有 token 登出這個Device 下指定token
CancelTokenByDeviceId(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*OKResp, error) CancelTokenByDeviceID(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*OKResp, error)
// GetUserTokensByDeviceId 取得目前所對應的 DeviceID 所存在的 Tokens // GetUserTokensByDeviceID 取得目前所對應的 DeviceID 所存在的 Tokens
GetUserTokensByDeviceId(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*Tokens, error) GetUserTokensByDeviceID(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*Tokens, error)
// GetUserTokensByUid 取得目前所對應的 UID 所存在的 Tokens // GetUserTokensByUID 取得目前所對應的 UID 所存在的 Tokens
GetUserTokensByUid(ctx context.Context, in *QueryTokenByUIDReq, opts ...grpc.CallOption) (*Tokens, error) GetUserTokensByUID(ctx context.Context, in *QueryTokenByUIDReq, opts ...grpc.CallOption) (*Tokens, error)
// NewOneTimeToken 建立一次性使用例如RefreshToken
NewOneTimeToken(ctx context.Context, in *CreateOneTimeTokenReq, opts ...grpc.CallOption) (*CreateOneTimeTokenResp, error)
// CancelOneTimeToken 取消一次性使用
CancelOneTimeToken(ctx context.Context, in *CancelOneTimeTokenReq, opts ...grpc.CallOption) (*OKResp, error)
} }
type tokenServiceClient struct { type tokenServiceClient struct {
@ -119,50 +113,30 @@ func (c *tokenServiceClient) CancelTokens(ctx context.Context, in *DoTokenByUIDR
return out, nil return out, nil
} }
func (c *tokenServiceClient) CancelTokenByDeviceId(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*OKResp, error) { func (c *tokenServiceClient) CancelTokenByDeviceID(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp) out := new(OKResp)
err := c.cc.Invoke(ctx, TokenService_CancelTokenByDeviceId_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, TokenService_CancelTokenByDeviceID_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *tokenServiceClient) GetUserTokensByDeviceId(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*Tokens, error) { func (c *tokenServiceClient) GetUserTokensByDeviceID(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*Tokens, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Tokens) out := new(Tokens)
err := c.cc.Invoke(ctx, TokenService_GetUserTokensByDeviceId_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, TokenService_GetUserTokensByDeviceID_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *tokenServiceClient) GetUserTokensByUid(ctx context.Context, in *QueryTokenByUIDReq, opts ...grpc.CallOption) (*Tokens, error) { func (c *tokenServiceClient) GetUserTokensByUID(ctx context.Context, in *QueryTokenByUIDReq, opts ...grpc.CallOption) (*Tokens, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Tokens) out := new(Tokens)
err := c.cc.Invoke(ctx, TokenService_GetUserTokensByUid_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, TokenService_GetUserTokensByUID_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tokenServiceClient) NewOneTimeToken(ctx context.Context, in *CreateOneTimeTokenReq, opts ...grpc.CallOption) (*CreateOneTimeTokenResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateOneTimeTokenResp)
err := c.cc.Invoke(ctx, TokenService_NewOneTimeToken_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tokenServiceClient) CancelOneTimeToken(ctx context.Context, in *CancelOneTimeTokenReq, opts ...grpc.CallOption) (*OKResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
err := c.cc.Invoke(ctx, TokenService_CancelOneTimeToken_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -171,7 +145,7 @@ func (c *tokenServiceClient) CancelOneTimeToken(ctx context.Context, in *CancelO
// TokenServiceServer is the server API for TokenService service. // TokenServiceServer is the server API for TokenService service.
// All implementations must embed UnimplementedTokenServiceServer // All implementations must embed UnimplementedTokenServiceServer
// for forward compatibility // for forward compatibility.
// //
// 跟 Token 相關的大小事,這次只回應錯誤,以及結果,不統一規範 // 跟 Token 相關的大小事,這次只回應錯誤,以及結果,不統一規範
// 錯誤碼應該在 Biz GW 在做回應,另外我這邊取名字比較通用, // 錯誤碼應該在 Biz GW 在做回應,另外我這邊取名字比較通用,
@ -187,22 +161,21 @@ type TokenServiceServer interface {
ValidationToken(context.Context, *ValidationTokenReq) (*ValidationTokenResp, error) ValidationToken(context.Context, *ValidationTokenReq) (*ValidationTokenResp, error)
// CancelTokens 取消 Token 從UID 視角,以及 token id 視角出發, UID 登出,底下所有 Device ID 也要登出, Token ID 登出, 所有 UID + Device 都要登出 // CancelTokens 取消 Token 從UID 視角,以及 token id 視角出發, UID 登出,底下所有 Device ID 也要登出, Token ID 登出, 所有 UID + Device 都要登出
CancelTokens(context.Context, *DoTokenByUIDReq) (*OKResp, error) CancelTokens(context.Context, *DoTokenByUIDReq) (*OKResp, error)
// CancelTokenByDeviceId 取消 Token 從 Device 視角出發可以選登出這個Device 下所有 token 登出這個Device 下指定token // CancelTokenByDeviceID 取消 Token 從 Device 視角出發可以選登出這個Device 下所有 token 登出這個Device 下指定token
CancelTokenByDeviceId(context.Context, *DoTokenByDeviceIDReq) (*OKResp, error) CancelTokenByDeviceID(context.Context, *DoTokenByDeviceIDReq) (*OKResp, error)
// GetUserTokensByDeviceId 取得目前所對應的 DeviceID 所存在的 Tokens // GetUserTokensByDeviceID 取得目前所對應的 DeviceID 所存在的 Tokens
GetUserTokensByDeviceId(context.Context, *DoTokenByDeviceIDReq) (*Tokens, error) GetUserTokensByDeviceID(context.Context, *DoTokenByDeviceIDReq) (*Tokens, error)
// GetUserTokensByUid 取得目前所對應的 UID 所存在的 Tokens // GetUserTokensByUID 取得目前所對應的 UID 所存在的 Tokens
GetUserTokensByUid(context.Context, *QueryTokenByUIDReq) (*Tokens, error) GetUserTokensByUID(context.Context, *QueryTokenByUIDReq) (*Tokens, error)
// NewOneTimeToken 建立一次性使用例如RefreshToken
NewOneTimeToken(context.Context, *CreateOneTimeTokenReq) (*CreateOneTimeTokenResp, error)
// CancelOneTimeToken 取消一次性使用
CancelOneTimeToken(context.Context, *CancelOneTimeTokenReq) (*OKResp, error)
mustEmbedUnimplementedTokenServiceServer() mustEmbedUnimplementedTokenServiceServer()
} }
// UnimplementedTokenServiceServer must be embedded to have forward compatible implementations. // UnimplementedTokenServiceServer must be embedded to have
type UnimplementedTokenServiceServer struct { // forward compatible implementations.
} //
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedTokenServiceServer struct{}
func (UnimplementedTokenServiceServer) NewToken(context.Context, *AuthorizationReq) (*TokenResp, error) { func (UnimplementedTokenServiceServer) NewToken(context.Context, *AuthorizationReq) (*TokenResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method NewToken not implemented") return nil, status.Errorf(codes.Unimplemented, "method NewToken not implemented")
@ -219,22 +192,17 @@ func (UnimplementedTokenServiceServer) ValidationToken(context.Context, *Validat
func (UnimplementedTokenServiceServer) CancelTokens(context.Context, *DoTokenByUIDReq) (*OKResp, error) { func (UnimplementedTokenServiceServer) CancelTokens(context.Context, *DoTokenByUIDReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CancelTokens not implemented") return nil, status.Errorf(codes.Unimplemented, "method CancelTokens not implemented")
} }
func (UnimplementedTokenServiceServer) CancelTokenByDeviceId(context.Context, *DoTokenByDeviceIDReq) (*OKResp, error) { func (UnimplementedTokenServiceServer) CancelTokenByDeviceID(context.Context, *DoTokenByDeviceIDReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CancelTokenByDeviceId not implemented") return nil, status.Errorf(codes.Unimplemented, "method CancelTokenByDeviceID not implemented")
} }
func (UnimplementedTokenServiceServer) GetUserTokensByDeviceId(context.Context, *DoTokenByDeviceIDReq) (*Tokens, error) { func (UnimplementedTokenServiceServer) GetUserTokensByDeviceID(context.Context, *DoTokenByDeviceIDReq) (*Tokens, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserTokensByDeviceId not implemented") return nil, status.Errorf(codes.Unimplemented, "method GetUserTokensByDeviceID not implemented")
} }
func (UnimplementedTokenServiceServer) GetUserTokensByUid(context.Context, *QueryTokenByUIDReq) (*Tokens, error) { func (UnimplementedTokenServiceServer) GetUserTokensByUID(context.Context, *QueryTokenByUIDReq) (*Tokens, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserTokensByUid not implemented") return nil, status.Errorf(codes.Unimplemented, "method GetUserTokensByUID not implemented")
}
func (UnimplementedTokenServiceServer) NewOneTimeToken(context.Context, *CreateOneTimeTokenReq) (*CreateOneTimeTokenResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method NewOneTimeToken not implemented")
}
func (UnimplementedTokenServiceServer) CancelOneTimeToken(context.Context, *CancelOneTimeTokenReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CancelOneTimeToken not implemented")
} }
func (UnimplementedTokenServiceServer) mustEmbedUnimplementedTokenServiceServer() {} func (UnimplementedTokenServiceServer) mustEmbedUnimplementedTokenServiceServer() {}
func (UnimplementedTokenServiceServer) testEmbeddedByValue() {}
// UnsafeTokenServiceServer may be embedded to opt out of forward compatibility for this service. // UnsafeTokenServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TokenServiceServer will // Use of this interface is not recommended, as added methods to TokenServiceServer will
@ -244,6 +212,13 @@ type UnsafeTokenServiceServer interface {
} }
func RegisterTokenServiceServer(s grpc.ServiceRegistrar, srv TokenServiceServer) { func RegisterTokenServiceServer(s grpc.ServiceRegistrar, srv TokenServiceServer) {
// If the following call pancis, it indicates UnimplementedTokenServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&TokenService_ServiceDesc, srv) s.RegisterService(&TokenService_ServiceDesc, srv)
} }
@ -337,92 +312,56 @@ func _TokenService_CancelTokens_Handler(srv interface{}, ctx context.Context, de
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _TokenService_CancelTokenByDeviceId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _TokenService_CancelTokenByDeviceID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DoTokenByDeviceIDReq) in := new(DoTokenByDeviceIDReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(TokenServiceServer).CancelTokenByDeviceId(ctx, in) return srv.(TokenServiceServer).CancelTokenByDeviceID(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: TokenService_CancelTokenByDeviceId_FullMethodName, FullMethod: TokenService_CancelTokenByDeviceID_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TokenServiceServer).CancelTokenByDeviceId(ctx, req.(*DoTokenByDeviceIDReq)) return srv.(TokenServiceServer).CancelTokenByDeviceID(ctx, req.(*DoTokenByDeviceIDReq))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _TokenService_GetUserTokensByDeviceId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _TokenService_GetUserTokensByDeviceID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DoTokenByDeviceIDReq) in := new(DoTokenByDeviceIDReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(TokenServiceServer).GetUserTokensByDeviceId(ctx, in) return srv.(TokenServiceServer).GetUserTokensByDeviceID(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: TokenService_GetUserTokensByDeviceId_FullMethodName, FullMethod: TokenService_GetUserTokensByDeviceID_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TokenServiceServer).GetUserTokensByDeviceId(ctx, req.(*DoTokenByDeviceIDReq)) return srv.(TokenServiceServer).GetUserTokensByDeviceID(ctx, req.(*DoTokenByDeviceIDReq))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _TokenService_GetUserTokensByUid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _TokenService_GetUserTokensByUID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryTokenByUIDReq) in := new(QueryTokenByUIDReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(TokenServiceServer).GetUserTokensByUid(ctx, in) return srv.(TokenServiceServer).GetUserTokensByUID(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: TokenService_GetUserTokensByUid_FullMethodName, FullMethod: TokenService_GetUserTokensByUID_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TokenServiceServer).GetUserTokensByUid(ctx, req.(*QueryTokenByUIDReq)) return srv.(TokenServiceServer).GetUserTokensByUID(ctx, req.(*QueryTokenByUIDReq))
}
return interceptor(ctx, in, info, handler)
}
func _TokenService_NewOneTimeToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateOneTimeTokenReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TokenServiceServer).NewOneTimeToken(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: TokenService_NewOneTimeToken_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TokenServiceServer).NewOneTimeToken(ctx, req.(*CreateOneTimeTokenReq))
}
return interceptor(ctx, in, info, handler)
}
func _TokenService_CancelOneTimeToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CancelOneTimeTokenReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TokenServiceServer).CancelOneTimeToken(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: TokenService_CancelOneTimeToken_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TokenServiceServer).CancelOneTimeToken(ctx, req.(*CancelOneTimeTokenReq))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -455,24 +394,16 @@ var TokenService_ServiceDesc = grpc.ServiceDesc{
Handler: _TokenService_CancelTokens_Handler, Handler: _TokenService_CancelTokens_Handler,
}, },
{ {
MethodName: "CancelTokenByDeviceId", MethodName: "CancelTokenByDeviceID",
Handler: _TokenService_CancelTokenByDeviceId_Handler, Handler: _TokenService_CancelTokenByDeviceID_Handler,
}, },
{ {
MethodName: "GetUserTokensByDeviceId", MethodName: "GetUserTokensByDeviceID",
Handler: _TokenService_GetUserTokensByDeviceId_Handler, Handler: _TokenService_GetUserTokensByDeviceID_Handler,
}, },
{ {
MethodName: "GetUserTokensByUid", MethodName: "GetUserTokensByUID",
Handler: _TokenService_GetUserTokensByUid_Handler, Handler: _TokenService_GetUserTokensByUID_Handler,
},
{
MethodName: "NewOneTimeToken",
Handler: _TokenService_NewOneTimeToken_Handler,
},
{
MethodName: "CancelOneTimeToken",
Handler: _TokenService_CancelOneTimeToken_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},