From 2197cf91e7a3bd5941327ba630a42946b88f069e Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 09 四月 2021 14:15:41 +0800
Subject: [PATCH] join pub/sub to node; refactor.

---
 proto/source/bhome_msg.proto |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/proto/source/bhome_msg.proto b/proto/source/bhome_msg.proto
index b06b692..5056a26 100644
--- a/proto/source/bhome_msg.proto
+++ b/proto/source/bhome_msg.proto
@@ -3,6 +3,7 @@
 
 // import "google/protobuf/descriptor.proto";
 import "bhome_msg_api.proto";
+import "error_msg.proto";
 
 package bhome.msg;
 
@@ -18,12 +19,21 @@
 	bytes topic = 6; // for request route
 }
 
-message BHMsg { // deprecated
-	bytes msg_id = 1;
-	int64 timestamp = 2;
-	int32 type = 3;
-	repeated BHAddress route = 4; // for reply and proxy.
-	bytes body = 5;
+message MsgRequest {
+	MsgType type = 1;
+	// oneof body;
+}
+
+message MsgReply {
+	ErrorMsg err_msg = 1;
+	// oneof reply
+}
+
+message BHMsgBody {
+	oneof reqrep {
+		MsgRequest request = 1;
+		MsgReply reply = 2;
+	}
 }
 
 enum MsgType {

--
Gitblit v1.8.0