Browse Source

接口添加

WH01243 3 năm trước cách đây
mục cha
commit
73d7cc7b4c

+ 115 - 15
entity/message_mail_box.go

@@ -2,7 +2,10 @@ package entity
 
 import (
 	"app.yhyue.com/moapp/jybase/common"
+	"database/sql"
 	"log"
+	"messagecenter/rpc/messagecenter/messagecenter"
+	"time"
 )
 
 type MessageMailBoxService interface {
@@ -63,27 +66,124 @@ func (b MessageMailBox) GetLast(receiveId, sendId string, msgType int) (messageB
 	}
 	return map[string]interface{}{}, nil
 }
-func (b MessageMailBox) Count(receiveId, sendId string, msgType, isRead int) (count int, err error) {
-	q := "select count(id) from socialize_message_mailbox where own_id=? "
+func (b MessageMailBox) Count(receiveId, sendId string, msgType, userType, entId int) (count int, err error) {
 	v := []interface{}{
 		receiveId,
 	}
-	if sendId != "" {
-		q += "and  (send_user_id=? and receive_user_id=?) or (receive_user_id=? and send_user_id=?)"
-		v = append(v, sendId, receiveId, sendId, receiveId)
-	} else {
-		q += " receive_user_id=?"
+	sql := "select count(id) from socialize_message_mailbox where own_id=? and  isread=0"
+	switch msgType {
+	case 1: //站内信消息
+		//只查询属于自己的
+		sql = "select count(id) from socialize_message_mailbox where own_id=?  and type=1  and  isread=0"
 		v = append(v, receiveId)
+		break
+	case 2: //点对点消息
+		//只查询属于自己的和某个人的信息
+		sql = "select count(id) from socialize_message_mailbox where own_id=?  and type=2 and (receive_user_id=? or   send_user_id=? or receive_user_id=? or   send_user_id=? )  and  isread=0  order by create_time"
+		v = append(v, receiveId, receiveId, sendId, sendId, receiveId)
+		break
+	case 3: //群消息
+		//只查询属于自己的和某个人的信息
+		sql = "select count(id) from socialize_message_mailbox where own_id=?  and type=3  and (receive_user_id=? or send_user_id=?)  and  isread=0 order by create_time "
+		v = append(v, receiveId, receiveId, receiveId)
+		break
+	case 4: //机器人消息
+		//只查询属于自己和某个企业的会话信息
+		sql = "select  count(b.id) from   socialize_chat_session a  left  join  socialize_message_mailbox  b on a.id=b.receive_user_id where b.type=4 and  b.own_id=?  and   (b.receive_user_id=? or b.send_user_id=?)  and a.ent_id=?  and  b.isread=0 order by create_time "
+		v = append(v, receiveId, receiveId, receiveId, entId)
+		break
+	case 5: //客服消息
+		//只查询属于自己和某个企业的会话信息
+		if userType == 0 {
+			sql = "select  count(b.id) from   socialize_chat_session a  left  join  socialize_message_mailbox  b on a.id=b.receive_user_id where  b.type=4 and  b.own_id=?  and   (b.receive_user_id=? or b.send_user_id=?) and a.ent_id=?  and  b.isread=0 order by create_time"
+		} else {
+			sql = "select  count(b.id) from   socialize_chat_session a  left  join  socialize_message_mailbox  b on a.id=b.receive_user_id where (b.type=4 or b.type=5) and  b.own_id=?  and   (b.receive_user_id=? or b.send_user_id=?) and a.ent_id=?  and  b.isread=0 order by create_time"
+		}
+		v = append(v, receiveId, receiveId, receiveId, entId)
+		break
 	}
-	if msgType != -1 {
-		q += " and type = ?"
-		v = append(v, msgType)
-	}
-	if isRead == 0 {
-		q += " and isread = 0"
-	}
-	rs := Mysql.CountBySql(q, v...)
+	rs := Mysql.CountBySql(sql, v...)
 	log.Println(rs)
 	count = int(rs)
 	return
 }
+func (b MessageMailBox) UserList(receiveId string, userType int, phone, startTime, endTime string) (data *[]map[string]interface{}, err error) {
+	v := []interface{}{
+		receiveId,
+	}
+	sql := ""
+	if userType == 0 {
+		//用户的客户列表
+		sql = "SELECT   a.*  FROM   socialize_message_mailbox b   LEFT JOIN base_user a ON a.id = b.receive_user_id  OR a.id = b.send_user_id  WHERE   b.type = 2  AND b.own_id = ?  AND (  b.receive_user_id = ? OR b.send_user_id = ? )  AND a.id != ?  GROUP BY   a.id  "
+		v = append(v, receiveId, receiveId, receiveId)
+	} else {
+		//客服的用户列表
+		sql = "SELECT  d.*  FROM  socialize_chat_session a  LEFT JOIN socialize_message_mailbox b ON a.id = b.receive_user_id   LEFT JOIN socialize_tenant_seat c on c.id=a.customer_service_id  left join base_user d on  d.id=c.customer_service_id  WHERE  b.type = 5   AND a.customer_service_id = ?   GROUP BY  a.user_id"
+		v = append(v, receiveId)
+	}
+	data = Mysql.SelectBySql(sql, v...)
+	return
+}
+func (b MessageMailBox) SaveMessage(in *messagecenter.MessageEntity) (error_code int64) {
+	//先插入信息表
+	fool := Mysql.ExecTx("聊天信息保存", func(tx *sql.Tx) bool {
+		//先插入信息表
+		message := map[string]interface{}{
+			"appid":         in.Appid,
+			"title":         in.Title,
+			"content":       in.Content,
+			"item":          in.ItemType,
+			"type":          in.Type,
+			"link":          in.Link,
+			"create_time":   time.Now(),
+			"create_person": in.SendUserId,
+		}
+		ok := Mysql.InsertByTx(tx, "socialize_message", message)
+		if ok > 0 {
+			return false
+		}
+		//在插入邮箱表socialize_message_mailbox
+		messageMailBox := map[string]interface{}{
+			"appid":           in.Appid,
+			"messag_id":       ok,
+			"type":            in.ItemType,
+			"send_user_id":    in.SendUserId,
+			"receive_user_id": in.ReceiveUserId,
+			"own_id":          in.SendUserId,
+			"read_time":       time.Now(),
+			"create_time":     time.Now(),
+			"isread":          1,
+			"send_isdel":      0,
+			"receive_isdel":   0,
+			"iswithdraw":      0,
+		}
+		sendOk := Mysql.InsertByTx(tx, "socialize_message", messageMailBox)
+		if sendOk > 0 {
+			return false
+		}
+		messageMailBox = map[string]interface{}{
+			"appid":           in.Appid,
+			"messag_id":       ok,
+			"type":            in.ItemType,
+			"send_user_id":    in.SendUserId,
+			"receive_user_id": in.ReceiveUserId,
+			"own_id":          in.ReceiveUserId,
+			"create_time":     time.Now(),
+			"isread":          0,
+			"send_isdel":      0,
+			"receive_isdel":   0,
+			"iswithdraw":      0,
+		}
+		receiveOk := Mysql.InsertByTx(tx, "socialize_message", messageMailBox)
+		if receiveOk > 0 {
+			return false
+		}
+		return true
+	})
+	if fool {
+		return 1
+	} else {
+		return 0
+	}
+
+}

+ 6 - 0
rpc/messagecenter/internal/server/messagecenterserver.go

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

+ 20 - 5
rpc/messagecenter/messagecenter.proto

@@ -4,10 +4,11 @@ package messagecenter;
 option go_package="./messagecenter";
 
 message CountReq {
-  int64 readType = 1;    // 已读类型
-  int64 msgType = 2;     // 消息类型
+  int64 msgType = 1;     // 消息类型 ;1:站内信消息 2:点对点消息 3:群消息 4:机器人消息 5:客服消息
+  int64 userType=2;      //用户类型:0用户1客服
   string sendId = 3;     // 发送方id
-  string receiveId = 4;  // 接收方id
+  int64 entId=4;        //企业标识
+  string receiveId = 5;  // 接收方id
 }
 
 message CountResp {
@@ -29,13 +30,18 @@ message UserReq {
   string startTime = 2;
   string endTime = 3;
   string customer_service_id = 4;
+  int64 userType=5;      //用户类型:0用户1客服
 }
 message UserResp {
+   repeated UserEntity data=1;
+}
+message UserEntity {
   string userId = 1;
   string nickName= 2;
 }
 message MessageReq {
-  string type = 1;
+  int64 msgType = 1;     // 消息类型 ;1:站内信消息 2:点对点消息 3:群消息 4:机器人消息 5:客服消息
+  int64 userType=6;      //用户类型:0用户1客服
   int64 pageIndex = 2;
   int64 pageSize = 3;
   string send_user_id = 4;
@@ -43,7 +49,9 @@ message MessageReq {
 }
 message MessageResp {
   int64 count = 1;
-  MessageEntity data= 2;
+  repeated MessageEntity data= 2;
+  int64 error_code = 4; //响应代码
+  string error_msg = 3; //响应消息
 }
 message MessageEntity {
   string title = 1;
@@ -52,7 +60,12 @@ message MessageEntity {
   string type = 4;
   string link = 5;
   string create_time = 6;
+  string appid=7;
+  int64 itemType=8;
+  string send_user_id=9;
+  string receive_user_id=10;
 }
+
 service messageCenter {
   // 查询数量
   rpc Count(CountReq) returns (CountResp);
@@ -62,6 +75,8 @@ service messageCenter {
   rpc UserList(UserReq) returns(UserResp);
   // 聊天内容查询
   rpc FindMessage(MessageReq) returns(MessageResp);
+   // 聊天保存
+  rpc SaveMessage(MessageEntity) returns(MessageResp);
 
 
 

+ 8 - 0
rpc/messagecenter/messagecenter/messagecenter.go

@@ -20,6 +20,8 @@ type (
 		UserList(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResp, error)
 		//  聊天内容查询
 		FindMessage(ctx context.Context, in *MessageReq, opts ...grpc.CallOption) (*MessageResp, error)
+		//  聊天保存
+		SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*MessageResp, error)
 	}
 
 	defaultMessageCenter struct {
@@ -56,3 +58,9 @@ func (m *defaultMessageCenter) FindMessage(ctx context.Context, in *MessageReq,
 	client := NewMessageCenterClient(m.cli.Conn())
 	return client.FindMessage(ctx, in, opts...)
 }
+
+//  聊天保存
+func (m *defaultMessageCenter) SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*MessageResp, error) {
+	client := NewMessageCenterClient(m.cli.Conn())
+	return client.SaveMessage(ctx, in, opts...)
+}

+ 288 - 128
rpc/messagecenter/messagecenter/messagecenter.pb.go

@@ -25,10 +25,11 @@ type CountReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	ReadType  int64  `protobuf:"varint,1,opt,name=readType,proto3" json:"readType,omitempty"`  // 已读类型
-	MsgType   int64  `protobuf:"varint,2,opt,name=msgType,proto3" json:"msgType,omitempty"`    // 消息类型
+	MsgType   int64  `protobuf:"varint,1,opt,name=msgType,proto3" json:"msgType,omitempty"`    // 消息类型 ;1:站内信消息 2:点对点消息 3:群消息 4:机器人消息 5:客服消息
+	UserType  int64  `protobuf:"varint,2,opt,name=userType,proto3" json:"userType,omitempty"`  //用户类型:0用户1客服
 	SendId    string `protobuf:"bytes,3,opt,name=sendId,proto3" json:"sendId,omitempty"`       // 发送方id
-	ReceiveId string `protobuf:"bytes,4,opt,name=receiveId,proto3" json:"receiveId,omitempty"` // 接收方id
+	EntId     int64  `protobuf:"varint,4,opt,name=entId,proto3" json:"entId,omitempty"`        //企业标识
+	ReceiveId string `protobuf:"bytes,5,opt,name=receiveId,proto3" json:"receiveId,omitempty"` // 接收方id
 }
 
 func (x *CountReq) Reset() {
@@ -63,16 +64,16 @@ func (*CountReq) Descriptor() ([]byte, []int) {
 	return file_messageCenter_proto_rawDescGZIP(), []int{0}
 }
 
-func (x *CountReq) GetReadType() int64 {
+func (x *CountReq) GetMsgType() int64 {
 	if x != nil {
-		return x.ReadType
+		return x.MsgType
 	}
 	return 0
 }
 
-func (x *CountReq) GetMsgType() int64 {
+func (x *CountReq) GetUserType() int64 {
 	if x != nil {
-		return x.MsgType
+		return x.UserType
 	}
 	return 0
 }
@@ -84,6 +85,13 @@ func (x *CountReq) GetSendId() string {
 	return ""
 }
 
+func (x *CountReq) GetEntId() int64 {
+	if x != nil {
+		return x.EntId
+	}
+	return 0
+}
+
 func (x *CountReq) GetReceiveId() string {
 	if x != nil {
 		return x.ReceiveId
@@ -265,6 +273,7 @@ type UserReq struct {
 	StartTime         string `protobuf:"bytes,2,opt,name=startTime,proto3" json:"startTime,omitempty"`
 	EndTime           string `protobuf:"bytes,3,opt,name=endTime,proto3" json:"endTime,omitempty"`
 	CustomerServiceId string `protobuf:"bytes,4,opt,name=customer_service_id,json=customerServiceId,proto3" json:"customer_service_id,omitempty"`
+	UserType          int64  `protobuf:"varint,5,opt,name=userType,proto3" json:"userType,omitempty"` //用户类型:0用户1客服
 }
 
 func (x *UserReq) Reset() {
@@ -327,13 +336,19 @@ func (x *UserReq) GetCustomerServiceId() string {
 	return ""
 }
 
+func (x *UserReq) GetUserType() int64 {
+	if x != nil {
+		return x.UserType
+	}
+	return 0
+}
+
 type UserResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	UserId   string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
-	NickName string `protobuf:"bytes,2,opt,name=nickName,proto3" json:"nickName,omitempty"`
+	Data []*UserEntity `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
 }
 
 func (x *UserResp) Reset() {
@@ -368,14 +383,62 @@ func (*UserResp) Descriptor() ([]byte, []int) {
 	return file_messageCenter_proto_rawDescGZIP(), []int{5}
 }
 
-func (x *UserResp) GetUserId() string {
+func (x *UserResp) GetData() []*UserEntity {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
+type UserEntity struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	UserId   string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
+	NickName string `protobuf:"bytes,2,opt,name=nickName,proto3" json:"nickName,omitempty"`
+}
+
+func (x *UserEntity) Reset() {
+	*x = UserEntity{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_messageCenter_proto_msgTypes[6]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *UserEntity) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UserEntity) ProtoMessage() {}
+
+func (x *UserEntity) ProtoReflect() protoreflect.Message {
+	mi := &file_messageCenter_proto_msgTypes[6]
+	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 UserEntity.ProtoReflect.Descriptor instead.
+func (*UserEntity) Descriptor() ([]byte, []int) {
+	return file_messageCenter_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *UserEntity) GetUserId() string {
 	if x != nil {
 		return x.UserId
 	}
 	return ""
 }
 
-func (x *UserResp) GetNickName() string {
+func (x *UserEntity) GetNickName() string {
 	if x != nil {
 		return x.NickName
 	}
@@ -387,7 +450,8 @@ type MessageReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Type       string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
+	MsgType    int64  `protobuf:"varint,1,opt,name=msgType,proto3" json:"msgType,omitempty"`   // 消息类型 ;1:站内信消息 2:点对点消息 3:群消息 4:机器人消息 5:客服消息
+	UserType   int64  `protobuf:"varint,6,opt,name=userType,proto3" json:"userType,omitempty"` //用户类型:0用户1客服
 	PageIndex  int64  `protobuf:"varint,2,opt,name=pageIndex,proto3" json:"pageIndex,omitempty"`
 	PageSize   int64  `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
 	SendUserId string `protobuf:"bytes,4,opt,name=send_user_id,json=sendUserId,proto3" json:"send_user_id,omitempty"`
@@ -397,7 +461,7 @@ type MessageReq struct {
 func (x *MessageReq) Reset() {
 	*x = MessageReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_messageCenter_proto_msgTypes[6]
+		mi := &file_messageCenter_proto_msgTypes[7]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -410,7 +474,7 @@ func (x *MessageReq) String() string {
 func (*MessageReq) ProtoMessage() {}
 
 func (x *MessageReq) ProtoReflect() protoreflect.Message {
-	mi := &file_messageCenter_proto_msgTypes[6]
+	mi := &file_messageCenter_proto_msgTypes[7]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -423,14 +487,21 @@ func (x *MessageReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use MessageReq.ProtoReflect.Descriptor instead.
 func (*MessageReq) Descriptor() ([]byte, []int) {
-	return file_messageCenter_proto_rawDescGZIP(), []int{6}
+	return file_messageCenter_proto_rawDescGZIP(), []int{7}
 }
 
-func (x *MessageReq) GetType() string {
+func (x *MessageReq) GetMsgType() int64 {
 	if x != nil {
-		return x.Type
+		return x.MsgType
 	}
-	return ""
+	return 0
+}
+
+func (x *MessageReq) GetUserType() int64 {
+	if x != nil {
+		return x.UserType
+	}
+	return 0
 }
 
 func (x *MessageReq) GetPageIndex() int64 {
@@ -466,14 +537,16 @@ type MessageResp struct {
 	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"`
+	Count     int64            `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
+	Data      []*MessageEntity `protobuf:"bytes,2,rep,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 *MessageResp) Reset() {
 	*x = MessageResp{}
 	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)
 	}
@@ -486,7 +559,7 @@ func (x *MessageResp) String() string {
 func (*MessageResp) ProtoMessage() {}
 
 func (x *MessageResp) 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 {
@@ -499,7 +572,7 @@ func (x *MessageResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use MessageResp.ProtoReflect.Descriptor instead.
 func (*MessageResp) Descriptor() ([]byte, []int) {
-	return file_messageCenter_proto_rawDescGZIP(), []int{7}
+	return file_messageCenter_proto_rawDescGZIP(), []int{8}
 }
 
 func (x *MessageResp) GetCount() int64 {
@@ -509,30 +582,48 @@ func (x *MessageResp) GetCount() int64 {
 	return 0
 }
 
-func (x *MessageResp) GetData() *MessageEntity {
+func (x *MessageResp) GetData() []*MessageEntity {
 	if x != nil {
 		return x.Data
 	}
 	return nil
 }
 
+func (x *MessageResp) GetErrorCode() int64 {
+	if x != nil {
+		return x.ErrorCode
+	}
+	return 0
+}
+
+func (x *MessageResp) GetErrorMsg() string {
+	if x != nil {
+		return x.ErrorMsg
+	}
+	return ""
+}
+
 type MessageEntity struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Title      string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
-	Content    string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
-	Item       string `protobuf:"bytes,3,opt,name=item,proto3" json:"item,omitempty"`
-	Type       string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
-	Link       string `protobuf:"bytes,5,opt,name=link,proto3" json:"link,omitempty"`
-	CreateTime string `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+	Title         string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
+	Content       string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
+	Item          string `protobuf:"bytes,3,opt,name=item,proto3" json:"item,omitempty"`
+	Type          string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
+	Link          string `protobuf:"bytes,5,opt,name=link,proto3" json:"link,omitempty"`
+	CreateTime    string `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+	Appid         string `protobuf:"bytes,7,opt,name=appid,proto3" json:"appid,omitempty"`
+	ItemType      int64  `protobuf:"varint,8,opt,name=itemType,proto3" json:"itemType,omitempty"`
+	SendUserId    string `protobuf:"bytes,9,opt,name=send_user_id,json=sendUserId,proto3" json:"send_user_id,omitempty"`
+	ReceiveUserId string `protobuf:"bytes,10,opt,name=receive_user_id,json=receiveUserId,proto3" json:"receive_user_id,omitempty"`
 }
 
 func (x *MessageEntity) Reset() {
 	*x = MessageEntity{}
 	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)
 	}
@@ -545,7 +636,7 @@ func (x *MessageEntity) String() string {
 func (*MessageEntity) ProtoMessage() {}
 
 func (x *MessageEntity) 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 {
@@ -558,7 +649,7 @@ func (x *MessageEntity) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use MessageEntity.ProtoReflect.Descriptor instead.
 func (*MessageEntity) Descriptor() ([]byte, []int) {
-	return file_messageCenter_proto_rawDescGZIP(), []int{8}
+	return file_messageCenter_proto_rawDescGZIP(), []int{9}
 }
 
 func (x *MessageEntity) GetTitle() string {
@@ -603,87 +694,140 @@ func (x *MessageEntity) GetCreateTime() string {
 	return ""
 }
 
+func (x *MessageEntity) GetAppid() string {
+	if x != nil {
+		return x.Appid
+	}
+	return ""
+}
+
+func (x *MessageEntity) GetItemType() int64 {
+	if x != nil {
+		return x.ItemType
+	}
+	return 0
+}
+
+func (x *MessageEntity) GetSendUserId() string {
+	if x != nil {
+		return x.SendUserId
+	}
+	return ""
+}
+
+func (x *MessageEntity) GetReceiveUserId() string {
+	if x != nil {
+		return x.ReceiveUserId
+	}
+	return ""
+}
+
 var File_messageCenter_proto protoreflect.FileDescriptor
 
 var file_messageCenter_proto_rawDesc = []byte{
 	0x0a, 0x13, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e,
 	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65,
-	0x6e, 0x74, 0x65, 0x72, 0x22, 0x76, 0x0a, 0x08, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71,
-	0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07,
-	0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d,
-	0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1c,
-	0x0a, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49, 0x64, 0x22, 0x21, 0x0a, 0x09,
-	0x43, 0x6f, 0x75, 0x6e, 0x74, 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, 0x22,
-	0x58, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67,
-	0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54,
-	0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72,
-	0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
-	0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x07, 0x47, 0x65, 0x74,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1e,
-	0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x87,
-	0x01, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68,
-	0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65,
-	0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18,
-	0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x75, 0x73, 0x74,
-	0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18,
-	0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x53,
-	0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01,
+	0x6e, 0x74, 0x65, 0x72, 0x22, 0x8c, 0x01, 0x0a, 0x08, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65,
+	0x71, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75,
+	0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75,
+	0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49,
+	0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12,
+	0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
+	0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
+	0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76,
+	0x65, 0x49, 0x64, 0x22, 0x21, 0x0a, 0x09, 0x43, 0x6f, 0x75, 0x6e, 0x74, 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, 0x22, 0x58, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71,
+	0x12, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65,
+	0x6e, 0x64, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64,
+	0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49, 0x64, 0x18,
+	0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49, 0x64,
+	0x22, 0x43, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x63,
+	0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f,
+	0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54,
+	0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74,
+	0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xa3, 0x01, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65,
+	0x71, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74,
+	0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72,
+	0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
+	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12,
+	0x2e, 0x0a, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76,
+	0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x75,
+	0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12,
+	0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0x39, 0x0a, 0x08, 0x55,
+	0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18,
+	0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63,
+	0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79,
+	0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x40, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x45, 0x6e,
+	0x74, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08,
 	0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
-	0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0a, 0x4d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70,
-	0x61, 0x67, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
-	0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67,
-	0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67,
-	0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x75, 0x73,
-	0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x6e,
-	0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x5f, 0x69,
-	0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x49, 0x64, 0x22, 0x55,
-	0x0a, 0x0b, 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, 0x22, 0x9c, 0x01, 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, 0x09, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x74,
-	0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 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, 0x32, 0x88, 0x02, 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, 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x12, 0x15, 0x2e,
-	0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65,
-	0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65,
-	0x6e, 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65, 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, 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, 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,
+	0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xb5, 0x01, 0x0a, 0x0a, 0x4d, 0x65, 0x73,
+	0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79,
+	0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70,
+	0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a,
+	0x09, 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1a, 0x0a, 0x08, 0x70,
+	0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70,
+	0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f,
+	0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73,
+	0x65, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x77, 0x6e,
+	0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x49, 0x64,
+	0x22, 0x91, 0x01, 0x0a, 0x0b, 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, 0x03, 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, 0x98, 0x02, 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, 0x09, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79,
+	0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 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, 0x20, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x75, 0x73,
+	0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x6e,
+	0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x72, 0x65, 0x63, 0x65, 0x69,
+	0x76, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x32,
+	0xd1, 0x02, 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, 0x38, 0x0a,
+	0x07, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a,
+	0x16, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e,
+	0x47, 0x65, 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, 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, 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 (
@@ -698,7 +842,7 @@ func file_messageCenter_proto_rawDescGZIP() []byte {
 	return file_messageCenter_proto_rawDescData
 }
 
-var file_messageCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
+var file_messageCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
 var file_messageCenter_proto_goTypes = []interface{}{
 	(*CountReq)(nil),      // 0: messagecenter.CountReq
 	(*CountResp)(nil),     // 1: messagecenter.CountResp
@@ -706,25 +850,29 @@ var file_messageCenter_proto_goTypes = []interface{}{
 	(*GetResp)(nil),       // 3: messagecenter.GetResp
 	(*UserReq)(nil),       // 4: messagecenter.UserReq
 	(*UserResp)(nil),      // 5: messagecenter.UserResp
-	(*MessageReq)(nil),    // 6: messagecenter.MessageReq
-	(*MessageResp)(nil),   // 7: messagecenter.MessageResp
-	(*MessageEntity)(nil), // 8: messagecenter.MessageEntity
+	(*UserEntity)(nil),    // 6: messagecenter.UserEntity
+	(*MessageReq)(nil),    // 7: messagecenter.MessageReq
+	(*MessageResp)(nil),   // 8: messagecenter.MessageResp
+	(*MessageEntity)(nil), // 9: messagecenter.MessageEntity
 }
 var file_messageCenter_proto_depIdxs = []int32{
-	8, // 0: messagecenter.MessageResp.data:type_name -> messagecenter.MessageEntity
-	0, // 1: messagecenter.messageCenter.Count:input_type -> messagecenter.CountReq
-	2, // 2: messagecenter.messageCenter.GetLast:input_type -> messagecenter.GetReq
-	4, // 3: messagecenter.messageCenter.UserList:input_type -> messagecenter.UserReq
-	6, // 4: messagecenter.messageCenter.FindMessage:input_type -> messagecenter.MessageReq
-	1, // 5: messagecenter.messageCenter.Count:output_type -> messagecenter.CountResp
-	3, // 6: messagecenter.messageCenter.GetLast:output_type -> messagecenter.GetResp
-	5, // 7: messagecenter.messageCenter.UserList:output_type -> messagecenter.UserResp
-	7, // 8: messagecenter.messageCenter.FindMessage:output_type -> messagecenter.MessageResp
-	5, // [5:9] is the sub-list for method output_type
-	1, // [1:5] is the sub-list for method input_type
-	1, // [1:1] is the sub-list for extension type_name
-	1, // [1:1] is the sub-list for extension extendee
-	0, // [0:1] is the sub-list for field type_name
+	6, // 0: messagecenter.UserResp.data:type_name -> messagecenter.UserEntity
+	9, // 1: messagecenter.MessageResp.data:type_name -> messagecenter.MessageEntity
+	0, // 2: messagecenter.messageCenter.Count:input_type -> messagecenter.CountReq
+	2, // 3: messagecenter.messageCenter.GetLast:input_type -> messagecenter.GetReq
+	4, // 4: messagecenter.messageCenter.UserList:input_type -> messagecenter.UserReq
+	7, // 5: messagecenter.messageCenter.FindMessage:input_type -> messagecenter.MessageReq
+	9, // 6: messagecenter.messageCenter.SaveMessage:input_type -> messagecenter.MessageEntity
+	1, // 7: messagecenter.messageCenter.Count:output_type -> messagecenter.CountResp
+	3, // 8: messagecenter.messageCenter.GetLast:output_type -> messagecenter.GetResp
+	5, // 9: messagecenter.messageCenter.UserList:output_type -> messagecenter.UserResp
+	8, // 10: messagecenter.messageCenter.FindMessage:output_type -> messagecenter.MessageResp
+	8, // 11: messagecenter.messageCenter.SaveMessage:output_type -> messagecenter.MessageResp
+	7, // [7:12] is the sub-list for method output_type
+	2, // [2:7] is the sub-list for method input_type
+	2, // [2:2] is the sub-list for extension type_name
+	2, // [2:2] is the sub-list for extension extendee
+	0, // [0:2] is the sub-list for field type_name
 }
 
 func init() { file_messageCenter_proto_init() }
@@ -806,7 +954,7 @@ func file_messageCenter_proto_init() {
 			}
 		}
 		file_messageCenter_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*MessageReq); i {
+			switch v := v.(*UserEntity); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -818,7 +966,7 @@ func file_messageCenter_proto_init() {
 			}
 		}
 		file_messageCenter_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*MessageResp); i {
+			switch v := v.(*MessageReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -830,6 +978,18 @@ func file_messageCenter_proto_init() {
 			}
 		}
 		file_messageCenter_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*MessageResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_messageCenter_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*MessageEntity); i {
 			case 0:
 				return &v.state
@@ -848,7 +1008,7 @@ func file_messageCenter_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_messageCenter_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   9,
+			NumMessages:   10,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 38 - 0
rpc/messagecenter/messagecenter/messagecenter_grpc.pb.go

@@ -30,6 +30,8 @@ type MessageCenterClient interface {
 	UserList(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResp, error)
 	// 聊天内容查询
 	FindMessage(ctx context.Context, in *MessageReq, opts ...grpc.CallOption) (*MessageResp, error)
+	// 聊天保存
+	SaveMessage(ctx context.Context, in *MessageEntity, opts ...grpc.CallOption) (*MessageResp, error)
 }
 
 type messageCenterClient struct {
@@ -76,6 +78,15 @@ 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)
+	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/SaveMessage", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // MessageCenterServer is the server API for MessageCenter service.
 // All implementations must embed UnimplementedMessageCenterServer
 // for forward compatibility
@@ -88,6 +99,8 @@ type MessageCenterServer interface {
 	UserList(context.Context, *UserReq) (*UserResp, error)
 	// 聊天内容查询
 	FindMessage(context.Context, *MessageReq) (*MessageResp, error)
+	// 聊天保存
+	SaveMessage(context.Context, *MessageEntity) (*MessageResp, error)
 	mustEmbedUnimplementedMessageCenterServer()
 }
 
@@ -107,6 +120,9 @@ 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) {
+	return nil, status.Errorf(codes.Unimplemented, "method SaveMessage not implemented")
+}
 func (UnimplementedMessageCenterServer) mustEmbedUnimplementedMessageCenterServer() {}
 
 // UnsafeMessageCenterServer may be embedded to opt out of forward compatibility for this service.
@@ -192,6 +208,24 @@ func _MessageCenter_FindMessage_Handler(srv interface{}, ctx context.Context, de
 	return interceptor(ctx, in, info, handler)
 }
 
+func _MessageCenter_SaveMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(MessageEntity)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(MessageCenterServer).SaveMessage(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/messagecenter.messageCenter/SaveMessage",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(MessageCenterServer).SaveMessage(ctx, req.(*MessageEntity))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // MessageCenter_ServiceDesc is the grpc.ServiceDesc for MessageCenter service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -215,6 +249,10 @@ var MessageCenter_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "FindMessage",
 			Handler:    _MessageCenter_FindMessage_Handler,
 		},
+		{
+			MethodName: "SaveMessage",
+			Handler:    _MessageCenter_SaveMessage_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "messageCenter.proto",