소스 검색

信息过滤

WH01243 3 년 전
부모
커밋
0c3c92e503

+ 7 - 3
rpc/messagecenter/internal/logic/savemessagelogic.go

@@ -25,15 +25,19 @@ func NewSaveMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveM
 }
 
 //  聊天保存
-func (l *SaveMessageLogic) SaveMessage(in *messagecenter.MessageEntity) (*messagecenter.MessageResp, error) {
+func (l *SaveMessageLogic) SaveMessage(in *messagecenter.MessageEntity) (*messagecenter.SaveMessageResp, error) {
 	// todo: add your logic here and delete this line
 	m := service.MessaggeService{}
-	error_code, error_message := m.SaveMessage(in)
+	error_code, error_message, content, messageId := m.SaveMessage(in)
 	if error_code == 0 {
 		error_message = ""
 	}
-	return &messagecenter.MessageResp{
+	return &messagecenter.SaveMessageResp{
 		ErrorCode: error_code,
 		ErrorMsg:  error_message,
+		Data: &messagecenter.MessageEntity{
+			Content:   content,
+			MessageId: messageId,
+		},
 	}, nil
 }

+ 1 - 1
rpc/messagecenter/internal/server/messagecenterserver.go

@@ -41,7 +41,7 @@ func (s *MessageCenterServer) FindMessage(ctx context.Context, in *messagecenter
 }
 
 //  聊天保存
-func (s *MessageCenterServer) SaveMessage(ctx context.Context, in *messagecenter.MessageEntity) (*messagecenter.MessageResp, error) {
+func (s *MessageCenterServer) SaveMessage(ctx context.Context, in *messagecenter.MessageEntity) (*messagecenter.SaveMessageResp, error) {
 	l := logic.NewSaveMessageLogic(ctx, s.svcCtx)
 	return l.SaveMessage(in)
 }

+ 7 - 1
rpc/messagecenter/messagecenter.proto

@@ -56,6 +56,12 @@ message MessageResp {
   int64         error_code = 4; //响应代码
   string        error_msg = 3; //响应消息
 }
+message SaveMessageResp {
+  int64         count = 1;
+  MessageEntity data= 2;
+  int64         error_code = 4; //响应代码
+  string        error_msg = 3; //响应消息
+}
 message MessageEntity {
   string        title = 1;
   string        content = 2;
@@ -111,7 +117,7 @@ service messageCenter {
   // 聊天内容查询
   rpc FindMessage(MessageReq) returns(MessageResp);
    // 聊天保存
-  rpc SaveMessage(MessageEntity) returns(MessageResp);
+  rpc SaveMessage(MessageEntity) returns(SaveMessageResp);
   // 会话创建
   rpc CreateChatSession(ChatSessionReq) returns(ChatSessionResp);
   // 会话关闭

+ 2 - 2
rpc/messagecenter/messagecenter/messagecenter.go

@@ -19,7 +19,7 @@ type (
 		//  聊天内容查询
 		FindMessage(ctx context.Context, in *MessageReq, opts ...grpc.CallOption) (*MessageResp, error)
 		//  聊天保存
-		SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*MessageResp, error)
+		SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*SaveMessageResp, error)
 		//  会话创建
 		CreateChatSession(ctx context.Context, in *ChatSessionReq, opts ...grpc.CallOption) (*ChatSessionResp, error)
 		//  会话关闭
@@ -58,7 +58,7 @@ func (m *defaultMessageCenter) FindMessage(ctx context.Context, in *MessageReq,
 }
 
 //  聊天保存
-func (m *defaultMessageCenter) SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*MessageResp, error) {
+func (m *defaultMessageCenter) SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*SaveMessageResp, error) {
 	client := NewMessageCenterClient(m.cli.Conn())
 	return client.SaveMessage(ctx, in, opts...)
 }

+ 240 - 145
rpc/messagecenter/messagecenter/messagecenter.pb.go

@@ -605,6 +605,77 @@ func (x *MessageResp) GetErrorMsg() string {
 	return ""
 }
 
+type SaveMessageResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Count     int64          `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
+	Data      *MessageEntity `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
+	ErrorCode int64          `protobuf:"varint,4,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` //响应代码
+	ErrorMsg  string         `protobuf:"bytes,3,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`     //响应消息
+}
+
+func (x *SaveMessageResp) Reset() {
+	*x = SaveMessageResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_messageCenter_proto_msgTypes[7]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *SaveMessageResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SaveMessageResp) ProtoMessage() {}
+
+func (x *SaveMessageResp) ProtoReflect() protoreflect.Message {
+	mi := &file_messageCenter_proto_msgTypes[7]
+	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 SaveMessageResp.ProtoReflect.Descriptor instead.
+func (*SaveMessageResp) Descriptor() ([]byte, []int) {
+	return file_messageCenter_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *SaveMessageResp) GetCount() int64 {
+	if x != nil {
+		return x.Count
+	}
+	return 0
+}
+
+func (x *SaveMessageResp) GetData() *MessageEntity {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
+func (x *SaveMessageResp) GetErrorCode() int64 {
+	if x != nil {
+		return x.ErrorCode
+	}
+	return 0
+}
+
+func (x *SaveMessageResp) GetErrorMsg() string {
+	if x != nil {
+		return x.ErrorMsg
+	}
+	return ""
+}
+
 type MessageEntity struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -634,7 +705,7 @@ type MessageEntity struct {
 func (x *MessageEntity) Reset() {
 	*x = MessageEntity{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_messageCenter_proto_msgTypes[7]
+		mi := &file_messageCenter_proto_msgTypes[8]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -647,7 +718,7 @@ func (x *MessageEntity) String() string {
 func (*MessageEntity) ProtoMessage() {}
 
 func (x *MessageEntity) ProtoReflect() protoreflect.Message {
-	mi := &file_messageCenter_proto_msgTypes[7]
+	mi := &file_messageCenter_proto_msgTypes[8]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -660,7 +731,7 @@ func (x *MessageEntity) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use MessageEntity.ProtoReflect.Descriptor instead.
 func (*MessageEntity) Descriptor() ([]byte, []int) {
-	return file_messageCenter_proto_rawDescGZIP(), []int{7}
+	return file_messageCenter_proto_rawDescGZIP(), []int{8}
 }
 
 func (x *MessageEntity) GetTitle() string {
@@ -811,7 +882,7 @@ type ChatSessionReq struct {
 func (x *ChatSessionReq) Reset() {
 	*x = ChatSessionReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_messageCenter_proto_msgTypes[8]
+		mi := &file_messageCenter_proto_msgTypes[9]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -824,7 +895,7 @@ func (x *ChatSessionReq) String() string {
 func (*ChatSessionReq) ProtoMessage() {}
 
 func (x *ChatSessionReq) ProtoReflect() protoreflect.Message {
-	mi := &file_messageCenter_proto_msgTypes[8]
+	mi := &file_messageCenter_proto_msgTypes[9]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -837,7 +908,7 @@ func (x *ChatSessionReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use ChatSessionReq.ProtoReflect.Descriptor instead.
 func (*ChatSessionReq) Descriptor() ([]byte, []int) {
-	return file_messageCenter_proto_rawDescGZIP(), []int{8}
+	return file_messageCenter_proto_rawDescGZIP(), []int{9}
 }
 
 func (x *ChatSessionReq) GetEntId() int64 {
@@ -886,7 +957,7 @@ type CloseSessionReq struct {
 func (x *CloseSessionReq) Reset() {
 	*x = CloseSessionReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_messageCenter_proto_msgTypes[9]
+		mi := &file_messageCenter_proto_msgTypes[10]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -899,7 +970,7 @@ func (x *CloseSessionReq) String() string {
 func (*CloseSessionReq) ProtoMessage() {}
 
 func (x *CloseSessionReq) ProtoReflect() protoreflect.Message {
-	mi := &file_messageCenter_proto_msgTypes[9]
+	mi := &file_messageCenter_proto_msgTypes[10]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -912,7 +983,7 @@ func (x *CloseSessionReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use CloseSessionReq.ProtoReflect.Descriptor instead.
 func (*CloseSessionReq) Descriptor() ([]byte, []int) {
-	return file_messageCenter_proto_rawDescGZIP(), []int{9}
+	return file_messageCenter_proto_rawDescGZIP(), []int{10}
 }
 
 func (x *CloseSessionReq) GetSessionId() int64 {
@@ -935,7 +1006,7 @@ type ChatSessionResp struct {
 func (x *ChatSessionResp) Reset() {
 	*x = ChatSessionResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_messageCenter_proto_msgTypes[10]
+		mi := &file_messageCenter_proto_msgTypes[11]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -948,7 +1019,7 @@ func (x *ChatSessionResp) String() string {
 func (*ChatSessionResp) ProtoMessage() {}
 
 func (x *ChatSessionResp) ProtoReflect() protoreflect.Message {
-	mi := &file_messageCenter_proto_msgTypes[10]
+	mi := &file_messageCenter_proto_msgTypes[11]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -961,7 +1032,7 @@ func (x *ChatSessionResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use ChatSessionResp.ProtoReflect.Descriptor instead.
 func (*ChatSessionResp) Descriptor() ([]byte, []int) {
-	return file_messageCenter_proto_rawDescGZIP(), []int{10}
+	return file_messageCenter_proto_rawDescGZIP(), []int{11}
 }
 
 func (x *ChatSessionResp) GetErrorCode() int64 {
@@ -1002,7 +1073,7 @@ type SaveAutoReplyReq struct {
 func (x *SaveAutoReplyReq) Reset() {
 	*x = SaveAutoReplyReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_messageCenter_proto_msgTypes[11]
+		mi := &file_messageCenter_proto_msgTypes[12]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -1015,7 +1086,7 @@ func (x *SaveAutoReplyReq) String() string {
 func (*SaveAutoReplyReq) ProtoMessage() {}
 
 func (x *SaveAutoReplyReq) ProtoReflect() protoreflect.Message {
-	mi := &file_messageCenter_proto_msgTypes[11]
+	mi := &file_messageCenter_proto_msgTypes[12]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -1028,7 +1099,7 @@ func (x *SaveAutoReplyReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use SaveAutoReplyReq.ProtoReflect.Descriptor instead.
 func (*SaveAutoReplyReq) Descriptor() ([]byte, []int) {
-	return file_messageCenter_proto_rawDescGZIP(), []int{11}
+	return file_messageCenter_proto_rawDescGZIP(), []int{12}
 }
 
 func (x *SaveAutoReplyReq) GetEntId() int64 {
@@ -1162,107 +1233,117 @@ var file_messageCenter_proto_rawDesc = []byte{
 	0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43,
 	0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67,
 	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67,
-	0x22, 0xf9, 0x03, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69,
-	0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74,
-	0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
-	0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69,
-	0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x1f,
-	0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12,
-	0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
-	0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70,
-	0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70,
-	0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74,
-	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e,
-	0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73,
-	0x65, 0x72, 0x49, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55,
-	0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70,
-	0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65,
-	0x12, 0x12, 0x0a, 0x04, 0x66, 0x6f, 0x6f, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04,
-	0x66, 0x6f, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x4e, 0x61, 0x6d,
-	0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x4e, 0x61,
-	0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x49, 0x6d, 0x67, 0x18, 0x0e,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x49, 0x6d, 0x67, 0x12, 0x18,
-	0x0a, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x65,
-	0x69, 0x76, 0x65, 0x49, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x63,
-	0x65, 0x69, 0x76, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x67,
-	0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x1c,
-	0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x22, 0xb4, 0x01, 0x0a,
-	0x0e, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12,
-	0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
-	0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65,
-	0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
-	0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61,
-	0x70, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49,
-	0x64, 0x12, 0x30, 0x0a, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x73, 0x65, 0x72,
-	0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13,
-	0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e,
-	0x61, 0x6d, 0x65, 0x22, 0x2f, 0x0a, 0x0f, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73,
-	0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f,
-	0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69,
-	0x6f, 0x6e, 0x49, 0x64, 0x22, 0x6b, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x73, 0x73,
-	0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72,
-	0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72,
-	0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f,
-	0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72,
-	0x4d, 0x73, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49,
-	0x64, 0x22, 0xc8, 0x01, 0x0a, 0x10, 0x53, 0x61, 0x76, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65,
-	0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09,
-	0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73,
-	0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72,
-	0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18,
-	0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49,
-	0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1c,
-	0x0a, 0x09, 0x6e, 0x6f, 0x77, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x09, 0x6e, 0x6f, 0x77, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x32, 0x90, 0x04, 0x0a,
-	0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x3a,
-	0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x17, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
-	0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71,
-	0x1a, 0x18, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
-	0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3b, 0x0a, 0x08, 0x55, 0x73,
-	0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
-	0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x17,
+	0x22, 0x95, 0x01, 0x0a, 0x0f, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x64, 0x61,
+	0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a,
+	0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65,
+	0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
+	0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x22, 0xf9, 0x03, 0x0a, 0x0d, 0x4d, 0x65, 0x73,
+	0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69,
+	0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
+	0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74,
+	0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x12,
+	0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79,
+	0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+	0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65,
+	0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
+	0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x1a, 0x0a,
+	0x08, 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x08, 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e,
+	0x64, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49,
+	0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0a,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12,
+	0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x10, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a,
+	0x08, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x07, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6f, 0x6f, 0x6c,
+	0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66, 0x6f, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x09,
+	0x72, 0x6f, 0x62, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x09, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f,
+	0x62, 0x6f, 0x74, 0x49, 0x6d, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f,
+	0x62, 0x6f, 0x74, 0x49, 0x6d, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d,
+	0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65,
+	0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49, 0x64, 0x18, 0x11, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49, 0x64, 0x12, 0x16,
+	0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x67, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
+	0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x49, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x49, 0x64, 0x22, 0xb4, 0x01, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x73,
+	0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2c, 0x0a,
+	0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
+	0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d,
+	0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75,
+	0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65,
+	0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x63, 0x75, 0x73,
+	0x74, 0x6f, 0x6d, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65,
+	0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
+	0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x2f, 0x0a, 0x0f, 0x43,
+	0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1c,
+	0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x6b, 0x0a, 0x0f,
+	0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b,
+	0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x73,
+	0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
+	0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xc8, 0x01, 0x0a, 0x10, 0x53, 0x61,
+	0x76, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14,
+	0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65,
+	0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49,
+	0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72,
+	0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73,
+	0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73,
+	0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
+	0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
+	0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x6f, 0x77, 0x46, 0x6f, 0x72,
+	0x6d, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x77, 0x46, 0x6f,
+	0x72, 0x6d, 0x61, 0x74, 0x32, 0x94, 0x04, 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12,
+	0x17, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e,
+	0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65,
+	0x73, 0x70, 0x12, 0x3b, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16,
 	0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x55,
-	0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x0b, 0x46, 0x69, 0x6e, 0x64, 0x4d,
-	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x19, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
-	0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65,
-	0x71, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65,
-	0x72, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x47, 0x0a,
-	0x0b, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x2e, 0x6d,
-	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61,
-	0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x52, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
-	0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x6d, 0x65,
-	0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x74,
+	0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x44, 0x0a, 0x0b, 0x46, 0x69, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x19,
+	0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x4d,
+	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73,
+	0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4b, 0x0a, 0x0b, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x65, 0x73,
+	0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65,
+	0x6e, 0x74, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69,
+	0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74,
+	0x65, 0x72, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65,
+	0x73, 0x70, 0x12, 0x52, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x74,
+	0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x73, 0x73,
+	0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69,
+	0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x52, 0x0a, 0x10, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x43,
+	0x68, 0x61, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x73,
+	0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65,
 	0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x73,
 	0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x53,
-	0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x52, 0x0a, 0x10, 0x43, 0x6c,
-	0x6f, 0x73, 0x65, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e,
-	0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43,
-	0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1e,
-	0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43,
-	0x68, 0x61, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4f,
-	0x0a, 0x10, 0x53, 0x61, 0x76, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x4d,
-	0x73, 0x67, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74,
-	0x65, 0x72, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79,
-	0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e,
-	0x74, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42,
-	0x11, 0x5a, 0x0f, 0x2e, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74,
-	0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4f, 0x0a, 0x10, 0x53, 0x61,
+	0x76, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x4d, 0x73, 0x67, 0x12, 0x1f,
+	0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x53,
+	0x61, 0x76, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x1a,
+	0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e,
+	0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x11, 0x5a, 0x0f, 0x2e,
+	0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x62, 0x06,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -1277,7 +1358,7 @@ func file_messageCenter_proto_rawDescGZIP() []byte {
 	return file_messageCenter_proto_rawDescData
 }
 
-var file_messageCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
+var file_messageCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
 var file_messageCenter_proto_goTypes = []interface{}{
 	(*CountReq)(nil),         // 0: messagecenter.CountReq
 	(*CountResp)(nil),        // 1: messagecenter.CountResp
@@ -1286,35 +1367,37 @@ var file_messageCenter_proto_goTypes = []interface{}{
 	(*UserEntity)(nil),       // 4: messagecenter.UserEntity
 	(*MessageReq)(nil),       // 5: messagecenter.MessageReq
 	(*MessageResp)(nil),      // 6: messagecenter.MessageResp
-	(*MessageEntity)(nil),    // 7: messagecenter.MessageEntity
-	(*ChatSessionReq)(nil),   // 8: messagecenter.ChatSessionReq
-	(*CloseSessionReq)(nil),  // 9: messagecenter.CloseSessionReq
-	(*ChatSessionResp)(nil),  // 10: messagecenter.ChatSessionResp
-	(*SaveAutoReplyReq)(nil), // 11: messagecenter.SaveAutoReplyReq
+	(*SaveMessageResp)(nil),  // 7: messagecenter.SaveMessageResp
+	(*MessageEntity)(nil),    // 8: messagecenter.MessageEntity
+	(*ChatSessionReq)(nil),   // 9: messagecenter.ChatSessionReq
+	(*CloseSessionReq)(nil),  // 10: messagecenter.CloseSessionReq
+	(*ChatSessionResp)(nil),  // 11: messagecenter.ChatSessionResp
+	(*SaveAutoReplyReq)(nil), // 12: messagecenter.SaveAutoReplyReq
 }
 var file_messageCenter_proto_depIdxs = []int32{
-	7,  // 0: messagecenter.CountResp.lastMessage:type_name -> messagecenter.MessageEntity
+	8,  // 0: messagecenter.CountResp.lastMessage:type_name -> messagecenter.MessageEntity
 	4,  // 1: messagecenter.UserResp.data:type_name -> messagecenter.UserEntity
-	7,  // 2: messagecenter.MessageResp.data:type_name -> messagecenter.MessageEntity
-	0,  // 3: messagecenter.messageCenter.Count:input_type -> messagecenter.CountReq
-	2,  // 4: messagecenter.messageCenter.UserList:input_type -> messagecenter.UserReq
-	5,  // 5: messagecenter.messageCenter.FindMessage:input_type -> messagecenter.MessageReq
-	7,  // 6: messagecenter.messageCenter.SaveMessage:input_type -> messagecenter.MessageEntity
-	8,  // 7: messagecenter.messageCenter.CreateChatSession:input_type -> messagecenter.ChatSessionReq
-	9,  // 8: messagecenter.messageCenter.CloseChatSession:input_type -> messagecenter.CloseSessionReq
-	11, // 9: messagecenter.messageCenter.SaveAutoReplyMsg:input_type -> messagecenter.SaveAutoReplyReq
-	1,  // 10: messagecenter.messageCenter.Count:output_type -> messagecenter.CountResp
-	3,  // 11: messagecenter.messageCenter.UserList:output_type -> messagecenter.UserResp
-	6,  // 12: messagecenter.messageCenter.FindMessage:output_type -> messagecenter.MessageResp
-	6,  // 13: messagecenter.messageCenter.SaveMessage:output_type -> messagecenter.MessageResp
-	10, // 14: messagecenter.messageCenter.CreateChatSession:output_type -> messagecenter.ChatSessionResp
-	10, // 15: messagecenter.messageCenter.CloseChatSession:output_type -> messagecenter.ChatSessionResp
-	6,  // 16: messagecenter.messageCenter.SaveAutoReplyMsg:output_type -> messagecenter.MessageResp
-	10, // [10:17] is the sub-list for method output_type
-	3,  // [3:10] is the sub-list for method input_type
-	3,  // [3:3] is the sub-list for extension type_name
-	3,  // [3:3] is the sub-list for extension extendee
-	0,  // [0:3] is the sub-list for field type_name
+	8,  // 2: messagecenter.MessageResp.data:type_name -> messagecenter.MessageEntity
+	8,  // 3: messagecenter.SaveMessageResp.data:type_name -> messagecenter.MessageEntity
+	0,  // 4: messagecenter.messageCenter.Count:input_type -> messagecenter.CountReq
+	2,  // 5: messagecenter.messageCenter.UserList:input_type -> messagecenter.UserReq
+	5,  // 6: messagecenter.messageCenter.FindMessage:input_type -> messagecenter.MessageReq
+	8,  // 7: messagecenter.messageCenter.SaveMessage:input_type -> messagecenter.MessageEntity
+	9,  // 8: messagecenter.messageCenter.CreateChatSession:input_type -> messagecenter.ChatSessionReq
+	10, // 9: messagecenter.messageCenter.CloseChatSession:input_type -> messagecenter.CloseSessionReq
+	12, // 10: messagecenter.messageCenter.SaveAutoReplyMsg:input_type -> messagecenter.SaveAutoReplyReq
+	1,  // 11: messagecenter.messageCenter.Count:output_type -> messagecenter.CountResp
+	3,  // 12: messagecenter.messageCenter.UserList:output_type -> messagecenter.UserResp
+	6,  // 13: messagecenter.messageCenter.FindMessage:output_type -> messagecenter.MessageResp
+	7,  // 14: messagecenter.messageCenter.SaveMessage:output_type -> messagecenter.SaveMessageResp
+	11, // 15: messagecenter.messageCenter.CreateChatSession:output_type -> messagecenter.ChatSessionResp
+	11, // 16: messagecenter.messageCenter.CloseChatSession:output_type -> messagecenter.ChatSessionResp
+	6,  // 17: messagecenter.messageCenter.SaveAutoReplyMsg:output_type -> messagecenter.MessageResp
+	11, // [11:18] is the sub-list for method output_type
+	4,  // [4:11] is the sub-list for method input_type
+	4,  // [4:4] is the sub-list for extension type_name
+	4,  // [4:4] is the sub-list for extension extendee
+	0,  // [0:4] is the sub-list for field type_name
 }
 
 func init() { file_messageCenter_proto_init() }
@@ -1408,7 +1491,7 @@ func file_messageCenter_proto_init() {
 			}
 		}
 		file_messageCenter_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*MessageEntity); i {
+			switch v := v.(*SaveMessageResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1420,7 +1503,7 @@ func file_messageCenter_proto_init() {
 			}
 		}
 		file_messageCenter_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*ChatSessionReq); i {
+			switch v := v.(*MessageEntity); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1432,7 +1515,7 @@ func file_messageCenter_proto_init() {
 			}
 		}
 		file_messageCenter_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*CloseSessionReq); i {
+			switch v := v.(*ChatSessionReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1444,7 +1527,7 @@ func file_messageCenter_proto_init() {
 			}
 		}
 		file_messageCenter_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*ChatSessionResp); i {
+			switch v := v.(*CloseSessionReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1456,6 +1539,18 @@ func file_messageCenter_proto_init() {
 			}
 		}
 		file_messageCenter_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ChatSessionResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_messageCenter_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*SaveAutoReplyReq); i {
 			case 0:
 				return &v.state
@@ -1474,7 +1569,7 @@ func file_messageCenter_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_messageCenter_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   12,
+			NumMessages:   13,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 5 - 5
rpc/messagecenter/messagecenter/messagecenter_grpc.pb.go

@@ -29,7 +29,7 @@ type MessageCenterClient interface {
 	// 聊天内容查询
 	FindMessage(ctx context.Context, in *MessageReq, opts ...grpc.CallOption) (*MessageResp, error)
 	// 聊天保存
-	SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*MessageResp, error)
+	SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*SaveMessageResp, error)
 	// 会话创建
 	CreateChatSession(ctx context.Context, in *ChatSessionReq, opts ...grpc.CallOption) (*ChatSessionResp, error)
 	// 会话关闭
@@ -73,8 +73,8 @@ func (c *messageCenterClient) FindMessage(ctx context.Context, in *MessageReq, o
 	return out, nil
 }
 
-func (c *messageCenterClient) SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*MessageResp, error) {
-	out := new(MessageResp)
+func (c *messageCenterClient) SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*SaveMessageResp, error) {
+	out := new(SaveMessageResp)
 	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/SaveMessage", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -120,7 +120,7 @@ type MessageCenterServer interface {
 	// 聊天内容查询
 	FindMessage(context.Context, *MessageReq) (*MessageResp, error)
 	// 聊天保存
-	SaveMessage(context.Context, *MessageEntity) (*MessageResp, error)
+	SaveMessage(context.Context, *MessageEntity) (*SaveMessageResp, error)
 	// 会话创建
 	CreateChatSession(context.Context, *ChatSessionReq) (*ChatSessionResp, error)
 	// 会话关闭
@@ -143,7 +143,7 @@ func (UnimplementedMessageCenterServer) UserList(context.Context, *UserReq) (*Us
 func (UnimplementedMessageCenterServer) FindMessage(context.Context, *MessageReq) (*MessageResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method FindMessage not implemented")
 }
-func (UnimplementedMessageCenterServer) SaveMessage(context.Context, *MessageEntity) (*MessageResp, error) {
+func (UnimplementedMessageCenterServer) SaveMessage(context.Context, *MessageEntity) (*SaveMessageResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method SaveMessage not implemented")
 }
 func (UnimplementedMessageCenterServer) CreateChatSession(context.Context, *ChatSessionReq) (*ChatSessionResp, error) {

+ 8 - 17
service/message_mail_box.go

@@ -86,7 +86,7 @@ func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string
 	}
 	return
 }
-func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (errorCode int64, errorMsg string) {
+func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (errorCode int64, errorMsg string, content string, messageId int64) {
 	//先插入信息表
 	//判断会话标识是否属于本人
 	if in.ItemType != 2 {
@@ -118,14 +118,13 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (errorCode
 		//查找会话信息
 		chatJson := Mysql.FindOne("socialize_chat_session", map[string]interface{}{"id": sessionId}, "user_id", "")
 		if chatJson == nil {
-			return 1, "会话标识不存在"
+			return 1, "会话标识不存在", "", 0
 		} else {
 			if userId != quitl.Int64All((*chatJson)["user_id"]) {
-				return 1, "会话标识不属于此用户"
+				return 1, "会话标识不属于此用户", "", 0
 			}
 		}
 	}
-
 	fool := Mysql.ExecTx("聊天信息保存", func(tx *sql.Tx) bool {
 		//先插入信息表
 		message := map[string]interface{}{
@@ -142,6 +141,7 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (errorCode
 		if ok <= 0 {
 			return false
 		}
+		messageId = ok
 		//在插入邮箱表socialize_message_mailbox
 		messageMailBox := map[string]interface{}{
 			"appid":         in.Appid,
@@ -275,13 +275,12 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (errorCode
 		return true
 	})
 	if fool {
-		return 0, ""
+		return 0, "", in.Content, messageId
 	} else {
-		return 1, "保存失败"
+		return 1, "保存失败", "", 0
 	}
 }
 func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) (*[]map[string]interface{}, int64) {
-	strat := time.Now().Unix()
 	sqlStr := ""
 	countSql := ""
 	lastStr := "  "
@@ -305,14 +304,10 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) (*[]map[strin
 		}
 		break
 	}
-	fmt.Println(sqlStr)
-	fmt.Println(countSql)
+	log.Println(sqlStr)
+	log.Println(countSql)
 	data := Mysql.SelectBySql(sqlStr)
-	stop1 := time.Now().Unix()
-	log.Println("sqlStr耗时", stop1-strat)
 	count := Mysql.CountBySql(countSql)
-	stop2 := time.Now().Unix()
-	log.Println("countSql耗时", stop2-stop1)
 	//自己头像处理
 	if in.UserType == 2 && count > 0 {
 		userData := Mysql.FindOne("base_user", map[string]interface{}{"id": in.NewUserId}, "headimg", "")
@@ -347,10 +342,6 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) (*[]map[strin
 			}
 		}
 	}()
-
-	stop := time.Now().Unix()
-	log.Println("耗时", stop-strat)
-	log.Println("耗时", stop-stop2)
 	return data, count
 }
 func (b MessaggeService) CreateChatSession(in *messagecenter.ChatSessionReq) (errorCode, sessionId int64) {