code to create and delete groupMmber collection in DB
This commit is contained in:
parent
57540f2587
commit
312200e210
|
@ -1096,6 +1096,100 @@ func (x *SubscribeMemberResponse) GetGroup() *GroupMember {
|
|||
return nil
|
||||
}
|
||||
|
||||
type UnsubscribeMemberRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,44,opt,name=id,proto3" json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *UnsubscribeMemberRequest) Reset() {
|
||||
*x = UnsubscribeMemberRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_groupsmanagement_proto_msgTypes[22]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *UnsubscribeMemberRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UnsubscribeMemberRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UnsubscribeMemberRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_groupsmanagement_proto_msgTypes[22]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UnsubscribeMemberRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UnsubscribeMemberRequest) Descriptor() ([]byte, []int) {
|
||||
return file_groupsmanagement_proto_rawDescGZIP(), []int{22}
|
||||
}
|
||||
|
||||
func (x *UnsubscribeMemberRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type UnsubscribeMemberResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,45,opt,name=id,proto3" json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *UnsubscribeMemberResponse) Reset() {
|
||||
*x = UnsubscribeMemberResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_groupsmanagement_proto_msgTypes[23]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *UnsubscribeMemberResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UnsubscribeMemberResponse) ProtoMessage() {}
|
||||
|
||||
func (x *UnsubscribeMemberResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_groupsmanagement_proto_msgTypes[23]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UnsubscribeMemberResponse.ProtoReflect.Descriptor instead.
|
||||
func (*UnsubscribeMemberResponse) Descriptor() ([]byte, []int) {
|
||||
return file_groupsmanagement_proto_rawDescGZIP(), []int{23}
|
||||
}
|
||||
|
||||
func (x *UnsubscribeMemberResponse) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_groupsmanagement_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_groupsmanagement_proto_rawDesc = []byte{
|
||||
|
@ -1184,57 +1278,67 @@ var file_groupsmanagement_proto_rawDesc = []byte{
|
|||
0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x2b, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x32, 0xd6, 0x05, 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x75,
|
||||
0x70, 0x73, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x08,
|
||||
0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72,
|
||||
0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x41, 0x64, 0x64,
|
||||
0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
||||
0x31, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x2e, 0x47, 0x65,
|
||||
0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e,
|
||||
0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x12, 0x34, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12,
|
||||
0x11, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x12, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x47,
|
||||
0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74,
|
||||
0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x61,
|
||||
0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x34, 0x0a,
|
||||
0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x11, 0x2e, 0x53, 0x75, 0x62,
|
||||
0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e,
|
||||
0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x0b, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
|
||||
0x62, 0x65, 0x12, 0x13, 0x2e, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73,
|
||||
0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
||||
0x43, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65,
|
||||
0x72, 0x12, 0x16, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62,
|
||||
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x41, 0x64, 0x64, 0x47,
|
||||
0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70,
|
||||
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75,
|
||||
0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17,
|
||||
0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x47, 0x65, 0x74,
|
||||
0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x47,
|
||||
0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70,
|
||||
0x73, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x12, 0x55, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x61,
|
||||
0x74, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x47, 0x65, 0x74, 0x47,
|
||||
0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f,
|
||||
0x75, 0x70, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x53, 0x75, 0x62, 0x73,
|
||||
0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x53, 0x75,
|
||||
0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
|
||||
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||
0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2e, 0x69,
|
||||
0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72,
|
||||
0x6d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x2a, 0x0a, 0x18, 0x55, 0x6e, 0x73, 0x75, 0x62,
|
||||
0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x02, 0x69, 0x64, 0x22, 0x2b, 0x0a, 0x19, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
|
||||
0x62, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64,
|
||||
0x32, 0xa4, 0x06, 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x4d, 0x61, 0x6e, 0x61, 0x67,
|
||||
0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75,
|
||||
0x70, 0x12, 0x10, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x47,
|
||||
0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75,
|
||||
0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x09, 0x47,
|
||||
0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x11, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72,
|
||||
0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x47, 0x65,
|
||||
0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x61,
|
||||
0x74, 0x63, 0x68, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42,
|
||||
0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65,
|
||||
0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
|
||||
0x69, 0x62, 0x65, 0x12, 0x11, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
|
||||
0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x0b,
|
||||
0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x13, 0x2e, 0x55, 0x6e,
|
||||
0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x14, 0x2e, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x47,
|
||||
0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x41, 0x64, 0x64,
|
||||
0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x17, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d,
|
||||
0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a,
|
||||
0x0e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12,
|
||||
0x16, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f,
|
||||
0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x4d,
|
||||
0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70,
|
||||
0x73, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18,
|
||||
0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x14, 0x47, 0x65,
|
||||
0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x62,
|
||||
0x65, 0x72, 0x12, 0x1c, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x61,
|
||||
0x74, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x1d, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x61, 0x74, 0x63,
|
||||
0x68, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x12, 0x46, 0x0a, 0x0f, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65,
|
||||
0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
|
||||
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e,
|
||||
0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x11, 0x55, 0x6e, 0x73,
|
||||
0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x19,
|
||||
0x2e, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65, 0x6d, 0x62,
|
||||
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x55, 0x6e, 0x73, 0x75,
|
||||
0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x2e, 0x63,
|
||||
0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d,
|
||||
0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2d,
|
||||
0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x61,
|
||||
0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -1249,7 +1353,7 @@ func file_groupsmanagement_proto_rawDescGZIP() []byte {
|
|||
return file_groupsmanagement_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_groupsmanagement_proto_msgTypes = make([]protoimpl.MessageInfo, 22)
|
||||
var file_groupsmanagement_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
|
||||
var file_groupsmanagement_proto_goTypes = []interface{}{
|
||||
(*AddGroupRequest)(nil), // 0: AddGroupRequest
|
||||
(*AddGroupResponse)(nil), // 1: AddGroupResponse
|
||||
|
@ -1273,22 +1377,24 @@ var file_groupsmanagement_proto_goTypes = []interface{}{
|
|||
(*GetGroupsBatchMemberResponse)(nil), // 19: GetGroupsBatchMemberResponse
|
||||
(*SubscribeMemberRequest)(nil), // 20: SubscribeMemberRequest
|
||||
(*SubscribeMemberResponse)(nil), // 21: SubscribeMemberResponse
|
||||
(*Group)(nil), // 22: Group
|
||||
(*GroupMember)(nil), // 23: GroupMember
|
||||
(*UnsubscribeMemberRequest)(nil), // 22: UnsubscribeMemberRequest
|
||||
(*UnsubscribeMemberResponse)(nil), // 23: UnsubscribeMemberResponse
|
||||
(*Group)(nil), // 24: Group
|
||||
(*GroupMember)(nil), // 25: GroupMember
|
||||
}
|
||||
var file_groupsmanagement_proto_depIdxs = []int32{
|
||||
22, // 0: AddGroupRequest.group:type_name -> Group
|
||||
22, // 1: AddGroupResponse.group:type_name -> Group
|
||||
22, // 2: GetGroupResponse.group:type_name -> Group
|
||||
22, // 3: GetGroupsResponse.groups:type_name -> Group
|
||||
22, // 4: GetGroupsBatchResponse.groups:type_name -> Group
|
||||
23, // 5: AddGroupMemberRequest.group:type_name -> GroupMember
|
||||
23, // 6: AddGroupMemberResponse.group:type_name -> GroupMember
|
||||
23, // 7: GetGroupMemberResponse.group:type_name -> GroupMember
|
||||
23, // 8: GetGroupsMemberResponse.groups:type_name -> GroupMember
|
||||
23, // 9: GetGroupsBatchMemberResponse.groups:type_name -> GroupMember
|
||||
23, // 10: SubscribeMemberRequest.group:type_name -> GroupMember
|
||||
23, // 11: SubscribeMemberResponse.group:type_name -> GroupMember
|
||||
24, // 0: AddGroupRequest.group:type_name -> Group
|
||||
24, // 1: AddGroupResponse.group:type_name -> Group
|
||||
24, // 2: GetGroupResponse.group:type_name -> Group
|
||||
24, // 3: GetGroupsResponse.groups:type_name -> Group
|
||||
24, // 4: GetGroupsBatchResponse.groups:type_name -> Group
|
||||
25, // 5: AddGroupMemberRequest.group:type_name -> GroupMember
|
||||
25, // 6: AddGroupMemberResponse.group:type_name -> GroupMember
|
||||
25, // 7: GetGroupMemberResponse.group:type_name -> GroupMember
|
||||
25, // 8: GetGroupsMemberResponse.groups:type_name -> GroupMember
|
||||
25, // 9: GetGroupsBatchMemberResponse.groups:type_name -> GroupMember
|
||||
25, // 10: SubscribeMemberRequest.group:type_name -> GroupMember
|
||||
25, // 11: SubscribeMemberResponse.group:type_name -> GroupMember
|
||||
0, // 12: GroupsManagement.AddGroup:input_type -> AddGroupRequest
|
||||
2, // 13: GroupsManagement.GetGroup:input_type -> GetGroupRequest
|
||||
4, // 14: GroupsManagement.GetGroups:input_type -> GetGroupsRequest
|
||||
|
@ -1300,19 +1406,21 @@ var file_groupsmanagement_proto_depIdxs = []int32{
|
|||
16, // 20: GroupsManagement.GetGroupsMember:input_type -> GetGroupsMemberRequest
|
||||
18, // 21: GroupsManagement.GetGroupsBatchMember:input_type -> GetGroupsBatchMemberRequest
|
||||
20, // 22: GroupsManagement.SubscribeMember:input_type -> SubscribeMemberRequest
|
||||
1, // 23: GroupsManagement.AddGroup:output_type -> AddGroupResponse
|
||||
3, // 24: GroupsManagement.GetGroup:output_type -> GetGroupResponse
|
||||
5, // 25: GroupsManagement.GetGroups:output_type -> GetGroupsResponse
|
||||
7, // 26: GroupsManagement.GetGroupsBatch:output_type -> GetGroupsBatchResponse
|
||||
9, // 27: GroupsManagement.Subscribe:output_type -> SubscribeResponse
|
||||
11, // 28: GroupsManagement.Unsubscribe:output_type -> UnsubscribeResponse
|
||||
13, // 29: GroupsManagement.AddGroupMember:output_type -> AddGroupMemberResponse
|
||||
15, // 30: GroupsManagement.GetGroupMember:output_type -> GetGroupMemberResponse
|
||||
17, // 31: GroupsManagement.GetGroupsMember:output_type -> GetGroupsMemberResponse
|
||||
19, // 32: GroupsManagement.GetGroupsBatchMember:output_type -> GetGroupsBatchMemberResponse
|
||||
21, // 33: GroupsManagement.SubscribeMember:output_type -> SubscribeMemberResponse
|
||||
23, // [23:34] is the sub-list for method output_type
|
||||
12, // [12:23] is the sub-list for method input_type
|
||||
22, // 23: GroupsManagement.UnsubscribeMember:input_type -> UnsubscribeMemberRequest
|
||||
1, // 24: GroupsManagement.AddGroup:output_type -> AddGroupResponse
|
||||
3, // 25: GroupsManagement.GetGroup:output_type -> GetGroupResponse
|
||||
5, // 26: GroupsManagement.GetGroups:output_type -> GetGroupsResponse
|
||||
7, // 27: GroupsManagement.GetGroupsBatch:output_type -> GetGroupsBatchResponse
|
||||
9, // 28: GroupsManagement.Subscribe:output_type -> SubscribeResponse
|
||||
11, // 29: GroupsManagement.Unsubscribe:output_type -> UnsubscribeResponse
|
||||
13, // 30: GroupsManagement.AddGroupMember:output_type -> AddGroupMemberResponse
|
||||
15, // 31: GroupsManagement.GetGroupMember:output_type -> GetGroupMemberResponse
|
||||
17, // 32: GroupsManagement.GetGroupsMember:output_type -> GetGroupsMemberResponse
|
||||
19, // 33: GroupsManagement.GetGroupsBatchMember:output_type -> GetGroupsBatchMemberResponse
|
||||
21, // 34: GroupsManagement.SubscribeMember:output_type -> SubscribeMemberResponse
|
||||
23, // 35: GroupsManagement.UnsubscribeMember:output_type -> UnsubscribeMemberResponse
|
||||
24, // [24:36] is the sub-list for method output_type
|
||||
12, // [12:24] is the sub-list for method input_type
|
||||
12, // [12:12] is the sub-list for extension type_name
|
||||
12, // [12:12] is the sub-list for extension extendee
|
||||
0, // [0:12] is the sub-list for field type_name
|
||||
|
@ -1590,6 +1698,30 @@ func file_groupsmanagement_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_groupsmanagement_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UnsubscribeMemberRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_groupsmanagement_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UnsubscribeMemberResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
|
@ -1597,7 +1729,7 @@ func file_groupsmanagement_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_groupsmanagement_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 22,
|
||||
NumMessages: 24,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
|
|
@ -20,6 +20,7 @@ service GroupsManagement {
|
|||
rpc GetGroupsMember(GetGroupsMemberRequest) returns (GetGroupsMemberResponse) {}
|
||||
rpc GetGroupsBatchMember(GetGroupsBatchMemberRequest) returns (GetGroupsBatchMemberResponse) {}
|
||||
rpc SubscribeMember(SubscribeMemberRequest) returns (SubscribeMemberResponse) {}
|
||||
rpc UnsubscribeMember(UnsubscribeMemberRequest) returns (UnsubscribeMemberResponse) {}
|
||||
}
|
||||
|
||||
message AddGroupRequest {
|
||||
|
@ -103,3 +104,10 @@ message SubscribeMemberRequest {
|
|||
message SubscribeMemberResponse {
|
||||
GroupMember group = 43;
|
||||
}
|
||||
message UnsubscribeMemberRequest {
|
||||
string id = 44;
|
||||
}
|
||||
|
||||
message UnsubscribeMemberResponse {
|
||||
string id = 45;
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ type GroupsManagementClient interface {
|
|||
GetGroupsMember(ctx context.Context, in *GetGroupsMemberRequest, opts ...grpc.CallOption) (*GetGroupsMemberResponse, error)
|
||||
GetGroupsBatchMember(ctx context.Context, in *GetGroupsBatchMemberRequest, opts ...grpc.CallOption) (*GetGroupsBatchMemberResponse, error)
|
||||
SubscribeMember(ctx context.Context, in *SubscribeMemberRequest, opts ...grpc.CallOption) (*SubscribeMemberResponse, error)
|
||||
UnsubscribeMember(ctx context.Context, in *UnsubscribeMemberRequest, opts ...grpc.CallOption) (*UnsubscribeMemberResponse, error)
|
||||
}
|
||||
|
||||
type groupsManagementClient struct {
|
||||
|
@ -143,6 +144,15 @@ func (c *groupsManagementClient) SubscribeMember(ctx context.Context, in *Subscr
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *groupsManagementClient) UnsubscribeMember(ctx context.Context, in *UnsubscribeMemberRequest, opts ...grpc.CallOption) (*UnsubscribeMemberResponse, error) {
|
||||
out := new(UnsubscribeMemberResponse)
|
||||
err := c.cc.Invoke(ctx, "/GroupsManagement/UnsubscribeMember", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// GroupsManagementServer is the server API for GroupsManagement service.
|
||||
// All implementations must embed UnimplementedGroupsManagementServer
|
||||
// for forward compatibility
|
||||
|
@ -159,6 +169,7 @@ type GroupsManagementServer interface {
|
|||
GetGroupsMember(context.Context, *GetGroupsMemberRequest) (*GetGroupsMemberResponse, error)
|
||||
GetGroupsBatchMember(context.Context, *GetGroupsBatchMemberRequest) (*GetGroupsBatchMemberResponse, error)
|
||||
SubscribeMember(context.Context, *SubscribeMemberRequest) (*SubscribeMemberResponse, error)
|
||||
UnsubscribeMember(context.Context, *UnsubscribeMemberRequest) (*UnsubscribeMemberResponse, error)
|
||||
mustEmbedUnimplementedGroupsManagementServer()
|
||||
}
|
||||
|
||||
|
@ -199,6 +210,9 @@ func (UnimplementedGroupsManagementServer) GetGroupsBatchMember(context.Context,
|
|||
func (UnimplementedGroupsManagementServer) SubscribeMember(context.Context, *SubscribeMemberRequest) (*SubscribeMemberResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SubscribeMember not implemented")
|
||||
}
|
||||
func (UnimplementedGroupsManagementServer) UnsubscribeMember(context.Context, *UnsubscribeMemberRequest) (*UnsubscribeMemberResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UnsubscribeMember not implemented")
|
||||
}
|
||||
func (UnimplementedGroupsManagementServer) mustEmbedUnimplementedGroupsManagementServer() {}
|
||||
|
||||
// UnsafeGroupsManagementServer may be embedded to opt out of forward compatibility for this service.
|
||||
|
@ -410,6 +424,24 @@ func _GroupsManagement_SubscribeMember_Handler(srv interface{}, ctx context.Cont
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _GroupsManagement_UnsubscribeMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UnsubscribeMemberRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(GroupsManagementServer).UnsubscribeMember(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/GroupsManagement/UnsubscribeMember",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(GroupsManagementServer).UnsubscribeMember(ctx, req.(*UnsubscribeMemberRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// GroupsManagement_ServiceDesc is the grpc.ServiceDesc for GroupsManagement service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
|
@ -461,6 +493,10 @@ var GroupsManagement_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "SubscribeMember",
|
||||
Handler: _GroupsManagement_SubscribeMember_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnsubscribeMember",
|
||||
Handler: _GroupsManagement_UnsubscribeMember_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "groupsmanagement.proto",
|
||||
|
|
|
@ -11,9 +11,10 @@ import (
|
|||
|
||||
func (g GroupMember) ToStorageType() storage.GroupMember {
|
||||
group := storage.GroupMember{
|
||||
ID: g.Memberid,
|
||||
Groupid: g.Groupid,
|
||||
Data: map[string]any{},
|
||||
ID: g.Id,
|
||||
Memberid: g.Memberid,
|
||||
Groupid: g.Groupid,
|
||||
Data: map[string]any{},
|
||||
}
|
||||
|
||||
for k, d := range g.Data.GetFields() {
|
||||
|
@ -44,7 +45,8 @@ func GroupFromStorageTypeMember(group *storage.GroupMember) (*GroupMember, error
|
|||
}
|
||||
|
||||
return &GroupMember{
|
||||
Memberid: group.ID,
|
||||
Id: group.ID,
|
||||
Memberid: group.Memberid,
|
||||
Groupid: group.Groupid,
|
||||
Data: data,
|
||||
}, nil
|
||||
|
|
|
@ -26,9 +26,10 @@ type GroupMember struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Memberid string `protobuf:"bytes,1,opt,name=memberid,proto3" json:"memberid,omitempty"`
|
||||
Groupid string `protobuf:"bytes,2,opt,name=groupid,proto3" json:"groupid,omitempty"`
|
||||
Data *_struct.Struct `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Memberid string `protobuf:"bytes,2,opt,name=memberid,proto3" json:"memberid,omitempty"`
|
||||
Groupid string `protobuf:"bytes,3,opt,name=groupid,proto3" json:"groupid,omitempty"`
|
||||
Data *_struct.Struct `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GroupMember) Reset() {
|
||||
|
@ -63,6 +64,13 @@ func (*GroupMember) Descriptor() ([]byte, []int) {
|
|||
return file_groupsmember_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GroupMember) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GroupMember) GetMemberid() string {
|
||||
if x != nil {
|
||||
return x.Memberid
|
||||
|
@ -90,18 +98,19 @@ var file_groupsmember_proto_rawDesc = []byte{
|
|||
0x0a, 0x12, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x22, 0x70, 0x0a, 0x0b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65,
|
||||
0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x69, 0x64, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||
0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04,
|
||||
0x64, 0x61, 0x74, 0x61, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70,
|
||||
0x67, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61,
|
||||
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2d, 0x6d, 0x61, 0x6e,
|
||||
0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x61, 0x70, 0x69, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x0b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62,
|
||||
0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
|
||||
0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x69, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x69, 0x64, 0x12, 0x18,
|
||||
0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f,
|
||||
0x70, 0x67, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c,
|
||||
0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2d, 0x6d, 0x61,
|
||||
0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x61, 0x70, 0x69,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -5,7 +5,8 @@ option go_package = "git.coopgo.io/coopgo-platform/groups-management/grpcapi";
|
|||
import "google/protobuf/struct.proto";
|
||||
|
||||
message GroupMember {
|
||||
string memberid = 1;
|
||||
string groupid = 2;
|
||||
google.protobuf.Struct data = 3;
|
||||
string id = 1;
|
||||
string memberid = 2;
|
||||
string groupid = 3;
|
||||
google.protobuf.Struct data = 4;
|
||||
}
|
||||
|
|
|
@ -94,8 +94,14 @@ func (s GroupsManagementServerImpl) Subscribe(ctx context.Context, req *Subscrib
|
|||
}, nil
|
||||
|
||||
}
|
||||
func (s GroupsManagementServerImpl) Unsubscribe(context.Context, *UnsubscribeRequest) (*UnsubscribeResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Unsubscribe not implemented")
|
||||
func (s GroupsManagementServerImpl) Unsubscribe(ctx context.Context, req *UnsubscribeRequest) (*UnsubscribeResponse, error) {
|
||||
err := s.handler.Unsubscribe(req.Groupid, req.Memberid)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.AlreadyExists, "could not subscribe : %v", err)
|
||||
}
|
||||
return &UnsubscribeResponse{
|
||||
Ok: true,
|
||||
}, nil
|
||||
}
|
||||
func (s GroupsManagementServerImpl) mustEmbedUnimplementedGroupsManagementServer() {}
|
||||
|
||||
|
@ -123,9 +129,7 @@ func Run(done chan error, cfg *viper.Viper, handler handlers.GroupsManagementHan
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////Code for the new DB groupMember//////////////////////////////////////
|
||||
func (s GroupsManagementServerImpl) AddGroupMember(ctx context.Context, req *AddGroupMemberRequest) (*AddGroupMemberResponse, error) {
|
||||
|
||||
g := req.Group.ToStorageType()
|
||||
|
@ -189,13 +193,6 @@ func (s GroupsManagementServerImpl) GetGroupsBatchMember(ctx context.Context, re
|
|||
|
||||
func (s GroupsManagementServerImpl) SubscribeMember(ctx context.Context, req *SubscribeMemberRequest) (*SubscribeMemberResponse, error) {
|
||||
g := req.Group.ToStorageType()
|
||||
// err := s.handler.SubscribeMember(g)
|
||||
// if err != nil {
|
||||
// return nil, status.Errorf(codes.AlreadyExists, "could not subscribe : %v", err)
|
||||
// }
|
||||
// return &SubscribeMemberResponse{
|
||||
// Ok: true,
|
||||
// }, nil
|
||||
|
||||
group, err := s.handler.SubscribeMember(g)
|
||||
if err != nil {
|
||||
|
@ -210,3 +207,11 @@ func (s GroupsManagementServerImpl) SubscribeMember(ctx context.Context, req *Su
|
|||
return &SubscribeMemberResponse{Group: response}, nil
|
||||
|
||||
}
|
||||
|
||||
func (s GroupsManagementServerImpl) UnsubscribeMember(ctx context.Context, req *UnsubscribeMemberRequest) (*UnsubscribeMemberResponse, error) {
|
||||
err := s.handler.UnsubscribeMember(req.Id)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.AlreadyExists, "could not unsubscribe : %v", err)
|
||||
}
|
||||
return &UnsubscribeMemberResponse{}, nil
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ func (h GroupsManagementHandler) SubscribeMember(group storage.GroupMember) (*st
|
|||
|
||||
groupp, err := h.storage.GetGroupMember(group.ID)
|
||||
if err != nil {
|
||||
//return err
|
||||
|
||||
groups := h.storage.CreateGroupMember(group)
|
||||
if groups != nil {
|
||||
return nil, err
|
||||
|
@ -47,34 +47,25 @@ func (h GroupsManagementHandler) SubscribeMember(group storage.GroupMember) (*st
|
|||
}
|
||||
}
|
||||
|
||||
groupp.Memberid = group.Memberid
|
||||
groupp.Groupid = group.Groupid
|
||||
groupp.Data = group.Data
|
||||
h.storage.UpdateGroupMember(*groupp)
|
||||
// // return nil
|
||||
// // if group.Memberid == "" {
|
||||
// // group.Memberid = uuid.NewString()
|
||||
// // }
|
||||
|
||||
// Store the account
|
||||
// if err := h.storage.CreateGroupMember(group); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
h.storage.UpdateGroupMember(*groupp)
|
||||
|
||||
return &group, nil
|
||||
}
|
||||
|
||||
// func (h GroupsManagementHandler) UnsubscribeMember(groupid string, subscriber string) error {
|
||||
// group, err := h.storage.GetGroupMember(groupid)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// members := []string{}
|
||||
// for _, m := range group.Members {
|
||||
// if m != subscriber {
|
||||
// members = append(members, m)
|
||||
// }
|
||||
// }
|
||||
// group.Members = members
|
||||
// h.storage.UpdateGroupMember(*group)
|
||||
// return nil
|
||||
// }
|
||||
func (h GroupsManagementHandler) UnsubscribeMember(groupid string) error {
|
||||
_, err := h.storage.GetGroupMember(groupid)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
erreur := h.storage.DeleteGroupMember(groupid)
|
||||
if erreur != nil {
|
||||
return erreur
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@ type Group struct {
|
|||
|
||||
///////////////////code
|
||||
type GroupMember struct {
|
||||
ID string `json:"id" bson:"_id"`
|
||||
Groupid string `json:"grouid" bson:"_groupid"`
|
||||
Data map[string]any `json:"data"`
|
||||
ID string `json:"id" bson:"_id"`
|
||||
Memberid string `json:"memberid"`
|
||||
Groupid string `json:"grouid"`
|
||||
Data map[string]any `json:"data"`
|
||||
}
|
||||
|
|
|
@ -166,6 +166,16 @@ func (s MongoDBStorage) CreateGroupMember(groupMember GroupMember) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) DeleteGroupMember(id string) error {
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["groups_member"])
|
||||
|
||||
if _, err := collection.DeleteOne(context.TODO(), bson.M{"_id": id}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) GetGroupMember(id string) (*GroupMember, error) {
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["groups_member"])
|
||||
|
||||
|
@ -188,17 +198,17 @@ func (s MongoDBStorage) GetGroupsMember(namespaces []string) (groupsMember []Gro
|
|||
if err != nil {
|
||||
return groupsMember, err
|
||||
}
|
||||
// if len(namespaces) == 0 {
|
||||
// cur, err = collection.Find(context.TODO(), bson.D{}, findOptions)
|
||||
// if err != nil {
|
||||
// return groupsMember, err
|
||||
// }
|
||||
// } else {
|
||||
// cur, err = collection.Find(context.TODO(), bson.M{"namespace": bson.M{"$in": namespaces}}, findOptions)
|
||||
// if err != nil {
|
||||
// return groupsMember, err
|
||||
// }
|
||||
// }
|
||||
if len(namespaces) == 0 {
|
||||
cur, err = collection.Find(context.TODO(), bson.D{}, findOptions)
|
||||
if err != nil {
|
||||
return groupsMember, err
|
||||
}
|
||||
} else {
|
||||
cur, err = collection.Find(context.TODO(), bson.M{"groupid": bson.M{"$in": namespaces}}, findOptions)
|
||||
if err != nil {
|
||||
return groupsMember, err
|
||||
}
|
||||
}
|
||||
|
||||
for cur.Next(context.TODO()) {
|
||||
var group GroupMember
|
||||
|
@ -228,7 +238,7 @@ func (s MongoDBStorage) GetGroupsMemberByIds(groupids []string) (groupsMember []
|
|||
if len(groupids) == 0 {
|
||||
return groupsMember, errors.New("no group id provided")
|
||||
} else {
|
||||
cur, err = collection.Find(context.TODO(), bson.M{"_id": bson.M{"$in": groupids}}, findOptions)
|
||||
cur, err = collection.Find(context.TODO(), bson.M{"groupid": bson.M{"$in": groupids}}, findOptions)
|
||||
if err != nil {
|
||||
return groupsMember, err
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ type Storage interface {
|
|||
GetGroupsMember([]string) ([]GroupMember, error)
|
||||
GetGroupsMemberByIds([]string) ([]GroupMember, error)
|
||||
UpdateGroupMember(GroupMember) error
|
||||
DeleteGroupMember(string) error
|
||||
}
|
||||
|
||||
func NewStorage(cfg *viper.Viper) (Storage, error) {
|
||||
|
|
Loading…
Reference in New Issue