🐛 Fix grpc namespace conflict

This commit is contained in:
LittleSheep 2024-10-31 22:40:10 +08:00
parent c3619f6d25
commit d1f1183beb
6 changed files with 80 additions and 75 deletions

View File

@ -4,14 +4,13 @@
<option name="autoReloadType" value="ALL" /> <option name="autoReloadType" value="ALL" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Add list relative method into authkit"> <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Realm operations now available in authkit">
<change afterPath="$PROJECT_DIR$/pkg/authkit/realm.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/authkit/models/realms.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/authkit/models/realms.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/authkit/notify.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/authkit/notify.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/grpc/realms.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/grpc/realms.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/internal/grpc/notify.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/grpc/notify.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/proto/realm.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/realm.pb.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/proto/notify.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/notify.pb.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/proto/realm.proto" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/realm.proto" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/proto/notify.proto" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/notify.proto" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/proto/realm_grpc.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/realm_grpc.pb.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/proto/notify_grpc.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/notify_grpc.pb.go" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -34,6 +33,10 @@
</option> </option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="KubernetesApiPersistence"><![CDATA[{}]]></component>
<component name="KubernetesApiProvider"><![CDATA[{
"isMigrated": true
}]]></component>
<component name="ProblemsViewState"> <component name="ProblemsViewState">
<option name="selectedTabId" value="ProjectErrors" /> <option name="selectedTabId" value="ProjectErrors" />
</component> </component>
@ -159,7 +162,6 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" /> <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<MESSAGE value=":bug: Bug fixes on multi-factors based authentication" />
<MESSAGE value=":bug: Bug fixes on settings auth preferences" /> <MESSAGE value=":bug: Bug fixes on settings auth preferences" />
<MESSAGE value=":sparkles: Implement event recorder grpc" /> <MESSAGE value=":sparkles: Implement event recorder grpc" />
<MESSAGE value=":sparkles: More event logs point" /> <MESSAGE value=":sparkles: More event logs point" />
@ -184,7 +186,8 @@
<MESSAGE value=":sparkles: Support users related rpc calls" /> <MESSAGE value=":sparkles: Support users related rpc calls" />
<MESSAGE value=":technologist: Improve DX by extending authkit" /> <MESSAGE value=":technologist: Improve DX by extending authkit" />
<MESSAGE value=":sparkles: Add list relative method into authkit" /> <MESSAGE value=":sparkles: Add list relative method into authkit" />
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Add list relative method into authkit" /> <MESSAGE value=":sparkles: Realm operations now available in authkit" />
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Realm operations now available in authkit" />
<option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" /> <option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" />
</component> </component>
<component name="VgoProject"> <component name="VgoProject">

View File

@ -19,7 +19,7 @@ func NotifyUser(nx *nex.Conn, userId uint64, notify pushkit.Notification, unsave
} }
_, err = proto.NewNotifyServiceClient(conn).NotifyUser(nil, &proto.NotifyUserRequest{ _, err = proto.NewNotifyServiceClient(conn).NotifyUser(nil, &proto.NotifyUserRequest{
UserId: userId, UserId: userId,
Notify: &proto.NotifyInfo{ Notify: &proto.NotifyInfoPayload{
Unsaved: unsaved[0], Unsaved: unsaved[0],
Data: raw, Data: raw,
}, },
@ -38,7 +38,7 @@ func NotifyUserBatch(nx *nex.Conn, userId []uint64, notify pushkit.Notification,
} }
_, err = proto.NewNotifyServiceClient(conn).NotifyUserBatch(nil, &proto.NotifyUserBatchRequest{ _, err = proto.NewNotifyServiceClient(conn).NotifyUserBatch(nil, &proto.NotifyUserBatchRequest{
UserId: userId, UserId: userId,
Notify: &proto.NotifyInfo{ Notify: &proto.NotifyInfoPayload{
Unsaved: unsaved[0], Unsaved: unsaved[0],
Data: raw, Data: raw,
}, },

View File

@ -92,7 +92,7 @@ func (v *App) NotifyUserBatch(_ context.Context, in *proto.NotifyUserBatchReques
}, nil }, nil
} }
func (v *App) NotifyAllUser(_ context.Context, in *proto.NotifyInfo) (*proto.NotifyResponse, error) { func (v *App) NotifyAllUser(_ context.Context, in *proto.NotifyInfoPayload) (*proto.NotifyResponse, error) {
var users []models.Account var users []models.Account
if err := database.C.Find(&users).Error; err != nil { if err := database.C.Find(&users).Error; err != nil {
return nil, fmt.Errorf("unable to get account: %v", err) return nil, fmt.Errorf("unable to get account: %v", err)

View File

@ -20,7 +20,7 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
type NotifyInfo struct { type NotifyInfoPayload struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
@ -31,20 +31,20 @@ type NotifyInfo struct {
Unsaved bool `protobuf:"varint,2,opt,name=unsaved,proto3" json:"unsaved,omitempty"` Unsaved bool `protobuf:"varint,2,opt,name=unsaved,proto3" json:"unsaved,omitempty"`
} }
func (x *NotifyInfo) Reset() { func (x *NotifyInfoPayload) Reset() {
*x = NotifyInfo{} *x = NotifyInfoPayload{}
mi := &file_notify_proto_msgTypes[0] mi := &file_notify_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 *NotifyInfo) String() string { func (x *NotifyInfoPayload) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*NotifyInfo) ProtoMessage() {} func (*NotifyInfoPayload) ProtoMessage() {}
func (x *NotifyInfo) ProtoReflect() protoreflect.Message { func (x *NotifyInfoPayload) ProtoReflect() protoreflect.Message {
mi := &file_notify_proto_msgTypes[0] mi := &file_notify_proto_msgTypes[0]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -56,19 +56,19 @@ func (x *NotifyInfo) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use NotifyInfo.ProtoReflect.Descriptor instead. // Deprecated: Use NotifyInfoPayload.ProtoReflect.Descriptor instead.
func (*NotifyInfo) Descriptor() ([]byte, []int) { func (*NotifyInfoPayload) Descriptor() ([]byte, []int) {
return file_notify_proto_rawDescGZIP(), []int{0} return file_notify_proto_rawDescGZIP(), []int{0}
} }
func (x *NotifyInfo) GetData() []byte { func (x *NotifyInfoPayload) GetData() []byte {
if x != nil { if x != nil {
return x.Data return x.Data
} }
return nil return nil
} }
func (x *NotifyInfo) GetUnsaved() bool { func (x *NotifyInfoPayload) GetUnsaved() bool {
if x != nil { if x != nil {
return x.Unsaved return x.Unsaved
} }
@ -81,7 +81,7 @@ type NotifyUserRequest struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Notify *NotifyInfo `protobuf:"bytes,2,opt,name=notify,proto3" json:"notify,omitempty"` Notify *NotifyInfoPayload `protobuf:"bytes,2,opt,name=notify,proto3" json:"notify,omitempty"`
} }
func (x *NotifyUserRequest) Reset() { func (x *NotifyUserRequest) Reset() {
@ -121,7 +121,7 @@ func (x *NotifyUserRequest) GetUserId() uint64 {
return 0 return 0
} }
func (x *NotifyUserRequest) GetNotify() *NotifyInfo { func (x *NotifyUserRequest) GetNotify() *NotifyInfoPayload {
if x != nil { if x != nil {
return x.Notify return x.Notify
} }
@ -134,7 +134,7 @@ type NotifyUserBatchRequest struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserId []uint64 `protobuf:"varint,1,rep,packed,name=user_id,json=userId,proto3" json:"user_id,omitempty"` UserId []uint64 `protobuf:"varint,1,rep,packed,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Notify *NotifyInfo `protobuf:"bytes,2,opt,name=notify,proto3" json:"notify,omitempty"` Notify *NotifyInfoPayload `protobuf:"bytes,2,opt,name=notify,proto3" json:"notify,omitempty"`
} }
func (x *NotifyUserBatchRequest) Reset() { func (x *NotifyUserBatchRequest) Reset() {
@ -174,7 +174,7 @@ func (x *NotifyUserBatchRequest) GetUserId() []uint64 {
return nil return nil
} }
func (x *NotifyUserBatchRequest) GetNotify() *NotifyInfo { func (x *NotifyUserBatchRequest) GetNotify() *NotifyInfoPayload {
if x != nil { if x != nil {
return x.Notify return x.Notify
} }
@ -230,40 +230,42 @@ var File_notify_proto protoreflect.FileDescriptor
var file_notify_proto_rawDesc = []byte{ var file_notify_proto_rawDesc = []byte{
0x0a, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x0a, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x41, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49,
0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x6e, 0x66, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61,
0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x73, 0x61, 0x76, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18,
0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x75, 0x6e, 0x73, 0x61, 0x76, 0x65, 0x0a, 0x07, 0x75, 0x6e, 0x73, 0x61, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
0x64, 0x22, 0x57, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x07, 0x75, 0x6e, 0x73, 0x61, 0x76, 0x65, 0x64, 0x22, 0x5e, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x69,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06,
0x29, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79,
0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e,
0x66, 0x6f, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x22, 0x5c, 0x0a, 0x16, 0x4e, 0x6f, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x22, 0x63, 0x0a, 0x16, 0x4e, 0x6f, 0x74, 0x69,
0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65,
0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x03, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x06, 0x6e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72,
0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x22, 0x2f, 0x0a, 0x0e, 0x4e, 0x6f, 0x74, 0x69, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x61,
0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x22, 0x2f, 0x0a,
0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x0e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0xd8, 0x01, 0x0a, 0x0d, 0x4e, 0x6f, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20,
0x74, 0x69, 0x66, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x4e, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0xdf,
0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x01, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x12, 0x3f, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65,
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x00, 0x12, 0x49, 0x0a, 0x0f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42,
0x61, 0x74, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74,
0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69,
0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0f, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d,
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18, 0x2e,
0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x66, 0x6f,
0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x79, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x6f, 0x33,
0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x15, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -280,17 +282,17 @@ func file_notify_proto_rawDescGZIP() []byte {
var file_notify_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_notify_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_notify_proto_goTypes = []any{ var file_notify_proto_goTypes = []any{
(*NotifyInfo)(nil), // 0: proto.NotifyInfo (*NotifyInfoPayload)(nil), // 0: proto.NotifyInfoPayload
(*NotifyUserRequest)(nil), // 1: proto.NotifyUserRequest (*NotifyUserRequest)(nil), // 1: proto.NotifyUserRequest
(*NotifyUserBatchRequest)(nil), // 2: proto.NotifyUserBatchRequest (*NotifyUserBatchRequest)(nil), // 2: proto.NotifyUserBatchRequest
(*NotifyResponse)(nil), // 3: proto.NotifyResponse (*NotifyResponse)(nil), // 3: proto.NotifyResponse
} }
var file_notify_proto_depIdxs = []int32{ var file_notify_proto_depIdxs = []int32{
0, // 0: proto.NotifyUserRequest.notify:type_name -> proto.NotifyInfo 0, // 0: proto.NotifyUserRequest.notify:type_name -> proto.NotifyInfoPayload
0, // 1: proto.NotifyUserBatchRequest.notify:type_name -> proto.NotifyInfo 0, // 1: proto.NotifyUserBatchRequest.notify:type_name -> proto.NotifyInfoPayload
1, // 2: proto.NotifyService.NotifyUser:input_type -> proto.NotifyUserRequest 1, // 2: proto.NotifyService.NotifyUser:input_type -> proto.NotifyUserRequest
2, // 3: proto.NotifyService.NotifyUserBatch:input_type -> proto.NotifyUserBatchRequest 2, // 3: proto.NotifyService.NotifyUserBatch:input_type -> proto.NotifyUserBatchRequest
0, // 4: proto.NotifyService.NotifyAllUser:input_type -> proto.NotifyInfo 0, // 4: proto.NotifyService.NotifyAllUser:input_type -> proto.NotifyInfoPayload
3, // 5: proto.NotifyService.NotifyUser:output_type -> proto.NotifyResponse 3, // 5: proto.NotifyService.NotifyUser:output_type -> proto.NotifyResponse
3, // 6: proto.NotifyService.NotifyUserBatch:output_type -> proto.NotifyResponse 3, // 6: proto.NotifyService.NotifyUserBatch:output_type -> proto.NotifyResponse
3, // 7: proto.NotifyService.NotifyAllUser:output_type -> proto.NotifyResponse 3, // 7: proto.NotifyService.NotifyAllUser:output_type -> proto.NotifyResponse

View File

@ -7,10 +7,10 @@ package proto;
service NotifyService { service NotifyService {
rpc NotifyUser(NotifyUserRequest) returns (NotifyResponse) {} rpc NotifyUser(NotifyUserRequest) returns (NotifyResponse) {}
rpc NotifyUserBatch(NotifyUserBatchRequest) returns (NotifyResponse) {} rpc NotifyUserBatch(NotifyUserBatchRequest) returns (NotifyResponse) {}
rpc NotifyAllUser(NotifyInfo) returns(NotifyResponse) {} rpc NotifyAllUser(NotifyInfoPayload) returns(NotifyResponse) {}
} }
message NotifyInfo { message NotifyInfoPayload {
// This bytes is directly encoded from pushkit.Notification // This bytes is directly encoded from pushkit.Notification
// Which is passed to the pusher service, we don't need to care about the content // Which is passed to the pusher service, we don't need to care about the content
bytes data = 1; bytes data = 1;
@ -19,12 +19,12 @@ message NotifyInfo {
message NotifyUserRequest { message NotifyUserRequest {
uint64 user_id = 1; uint64 user_id = 1;
NotifyInfo notify = 2; NotifyInfoPayload notify = 2;
} }
message NotifyUserBatchRequest { message NotifyUserBatchRequest {
repeated uint64 user_id = 1; repeated uint64 user_id = 1;
NotifyInfo notify = 2; NotifyInfoPayload notify = 2;
} }
message NotifyResponse { message NotifyResponse {

View File

@ -30,7 +30,7 @@ const (
type NotifyServiceClient interface { type NotifyServiceClient interface {
NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error) NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, opts ...grpc.CallOption) (*NotifyResponse, error) NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
NotifyAllUser(ctx context.Context, in *NotifyInfo, opts ...grpc.CallOption) (*NotifyResponse, error) NotifyAllUser(ctx context.Context, in *NotifyInfoPayload, opts ...grpc.CallOption) (*NotifyResponse, error)
} }
type notifyServiceClient struct { type notifyServiceClient struct {
@ -61,7 +61,7 @@ func (c *notifyServiceClient) NotifyUserBatch(ctx context.Context, in *NotifyUse
return out, nil return out, nil
} }
func (c *notifyServiceClient) NotifyAllUser(ctx context.Context, in *NotifyInfo, opts ...grpc.CallOption) (*NotifyResponse, error) { func (c *notifyServiceClient) NotifyAllUser(ctx context.Context, in *NotifyInfoPayload, opts ...grpc.CallOption) (*NotifyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(NotifyResponse) out := new(NotifyResponse)
err := c.cc.Invoke(ctx, NotifyService_NotifyAllUser_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, NotifyService_NotifyAllUser_FullMethodName, in, out, cOpts...)
@ -77,7 +77,7 @@ func (c *notifyServiceClient) NotifyAllUser(ctx context.Context, in *NotifyInfo,
type NotifyServiceServer interface { type NotifyServiceServer interface {
NotifyUser(context.Context, *NotifyUserRequest) (*NotifyResponse, error) NotifyUser(context.Context, *NotifyUserRequest) (*NotifyResponse, error)
NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error) NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error)
NotifyAllUser(context.Context, *NotifyInfo) (*NotifyResponse, error) NotifyAllUser(context.Context, *NotifyInfoPayload) (*NotifyResponse, error)
mustEmbedUnimplementedNotifyServiceServer() mustEmbedUnimplementedNotifyServiceServer()
} }
@ -94,7 +94,7 @@ func (UnimplementedNotifyServiceServer) NotifyUser(context.Context, *NotifyUserR
func (UnimplementedNotifyServiceServer) NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error) { func (UnimplementedNotifyServiceServer) NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NotifyUserBatch not implemented") return nil, status.Errorf(codes.Unimplemented, "method NotifyUserBatch not implemented")
} }
func (UnimplementedNotifyServiceServer) NotifyAllUser(context.Context, *NotifyInfo) (*NotifyResponse, error) { func (UnimplementedNotifyServiceServer) NotifyAllUser(context.Context, *NotifyInfoPayload) (*NotifyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NotifyAllUser not implemented") return nil, status.Errorf(codes.Unimplemented, "method NotifyAllUser not implemented")
} }
func (UnimplementedNotifyServiceServer) mustEmbedUnimplementedNotifyServiceServer() {} func (UnimplementedNotifyServiceServer) mustEmbedUnimplementedNotifyServiceServer() {}
@ -155,7 +155,7 @@ func _NotifyService_NotifyUserBatch_Handler(srv interface{}, ctx context.Context
} }
func _NotifyService_NotifyAllUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _NotifyService_NotifyAllUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NotifyInfo) in := new(NotifyInfoPayload)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
@ -167,7 +167,7 @@ func _NotifyService_NotifyAllUser_Handler(srv interface{}, ctx context.Context,
FullMethod: NotifyService_NotifyAllUser_FullMethodName, FullMethod: NotifyService_NotifyAllUser_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NotifyServiceServer).NotifyAllUser(ctx, req.(*NotifyInfo)) return srv.(NotifyServiceServer).NotifyAllUser(ctx, req.(*NotifyInfoPayload))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }