Pārlūkot izejas kodu

wip:添加知识库回答是否可用

wangkaiyue 2 gadi atpakaļ
vecāks
revīzija
eac37609d9

+ 28 - 0
api/messagecenter/internal/handler/appraisemessagehandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/logic"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func AppraiseMessageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.AppraiseMessageReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewAppraiseMessageLogic(r.Context(), svcCtx)
+		resp, err := l.AppraiseMessage(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 5 - 0
api/messagecenter/internal/handler/routes.go

@@ -57,6 +57,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/message/withdrawMessage",
 				Handler: withdrawMessageHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/message/appraiseMessage",
+				Handler: AppraiseMessageHandler(serverCtx),
+			},
 		},
 	)
 }

+ 41 - 0
api/messagecenter/internal/logic/appraisemessagelogic.go

@@ -0,0 +1,41 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/types"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
+	"context"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type AppraiseMessageLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewAppraiseMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AppraiseMessageLogic {
+	return &AppraiseMessageLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *AppraiseMessageLogic) AppraiseMessage(req *types.AppraiseMessageReq) (resp *types.CommonRes, err error) {
+	r, err := l.svcCtx.Message.AppraiseMessage(l.ctx, &messagecenter.AppraiseReq{
+		Appid:     req.AppId,
+		MessageId: req.MessageId,
+		NewUserId: req.NewUserId,
+		Appraise:  req.Appraise,
+	})
+
+	return &types.CommonRes{
+		Data:       common.If(r.ErrorCode == 0, true, false),
+		Error_msg:  r.ErrorMsg,
+		Error_code: int(r.ErrorCode),
+	}, nil
+
+}

+ 8 - 0
api/messagecenter/internal/types/types.go

@@ -94,3 +94,11 @@ type ReadWithdrawReq struct {
 	SendId    int64  `json:"sendId,optional"`
 	Type      int64  `json:"type"`
 }
+
+type AppraiseMessageReq struct {
+	EntId     int64  `header:"entId,optional"`
+	AppId     string `header:"appId"`
+	NewUserId int64  `header:"newUserId"`
+	MessageId string `json:"messageId"`
+	Appraise  int64  `json:"appraise,options=-1|1"`
+}

+ 11 - 4
api/messagecenter/messagecenter.api

@@ -84,6 +84,15 @@ type ReadWithdrawReq {
 	SendId    int64  `json:"sendId,optional"`
 	Type      int64  `json:"type"`
 }
+
+type AppraiseMessageReq {
+	EntId     int64  `header:"entId,optional"`
+	AppId     string `header:"appId"`
+	NewUserId int64  `header:"newUserId"`
+	MessageId string `json:"messageId"`
+	Appraise  int64  `json:"appraise,options=-1|1"`
+}
+
 service messagecenter-api {
 	@handler messageCount
 	post /message/messageCount (CountReq) returns (CommonRes);
@@ -103,8 +112,6 @@ service messagecenter-api {
 	post /message/updateReadById (ReadStateReq) returns (CommonRes);
 	@handler withdrawMessage //撤回消息
 	post /message/withdrawMessage (ReadWithdrawReq) returns (CommonRes);
-	@handler TransferCustomer //获取转让在线客服
-	post /message/transferCustomer (UserReq) returns (CommonRes);
-	@handler TransferMessage //消息转让
-	post /message/transferMessage (ReadWithdrawReq) returns (CommonRes);
+	@handler AppraiseMessage // 消息评价
+	post /message/appraiseMessage (AppraiseMessageReq) returns (CommonRes);
 }

+ 2 - 1
entity/util.go

@@ -14,6 +14,7 @@ const (
 	SOCIALIZE_MESSAGE_MAILBOX = "socialize_message_mailbox"
 	SOCIALIZE_TENANT_ROBOT    = "socialize_tenant_robot"
 	BASE_USER                 = "base_user"
+	SOCIALIZE_APPRAISE        = "socialize_message_appraise"
 )
 const (
 	SUCCESS_CODE = int64(0)
@@ -28,7 +29,7 @@ func SafeConvert2String(obj interface{}) string {
 	return ""
 }
 
-//in数据处理
+// in数据处理
 func Inhandle(data *[]map[string]interface{}) (messId string) {
 	if len(*data) == 0 {
 		messId = "''"

+ 39 - 0
rpc/messagecenter/internal/logic/appraisemessagelogic.go

@@ -0,0 +1,39 @@
+package logic
+
+import (
+	util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service"
+	"context"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type AppraiseMessageLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewAppraiseMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AppraiseMessageLogic {
+	return &AppraiseMessageLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// AppraiseMessage 用户评价回复
+func (l *AppraiseMessageLogic) AppraiseMessage(in *messagecenter.AppraiseReq) (*messagecenter.CurrencyResp, error) {
+	// todo: add your logic here and delete this line
+	m := service.MessaggeService{}
+	if err := m.AppraiseMessage(in); err != nil {
+		return &messagecenter.CurrencyResp{
+			ErrorCode: util.ERROR_CODE,
+			ErrorMsg:  err.Error(),
+		}, nil
+	}
+	return &messagecenter.CurrencyResp{}, nil
+}

+ 1 - 0
rpc/messagecenter/internal/logic/findmessagelogic.go

@@ -49,6 +49,7 @@ func (l *FindMessageLogic) FindMessage(in *messagecenter.MessageReq) (*messagece
 			SetName:    quitl.ObjToString(v["setName"]),
 			OwnImg:     quitl.ObjToString(v["ownImg"]),
 			MessageId:  encrypt.SE.Encode2Hex(quitl.InterfaceToStr(v["messageId"])),
+			Appraise:   quitl.Int64All(v["appraise"]),
 		}
 		list = append(list, &messageEntity)
 	}

+ 13 - 7
rpc/messagecenter/internal/server/messagecenterserver.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: messagecenter.proto
 
 package server
@@ -22,37 +22,37 @@ func NewMessageCenterServer(svcCtx *svc.ServiceContext) *MessageCenterServer {
 	}
 }
 
-//  查询数量
+// 查询数量
 func (s *MessageCenterServer) Count(ctx context.Context, in *messagecenter.CountReq) (*messagecenter.CountResp, error) {
 	l := logic.NewCountLogic(ctx, s.svcCtx)
 	return l.Count(in)
 }
 
-//  用户列表查询
+// 用户列表查询
 func (s *MessageCenterServer) UserList(ctx context.Context, in *messagecenter.UserReq) (*messagecenter.UserResp, error) {
 	l := logic.NewUserListLogic(ctx, s.svcCtx)
 	return l.UserList(in)
 }
 
-//  聊天内容查询
+// 聊天内容查询
 func (s *MessageCenterServer) FindMessage(ctx context.Context, in *messagecenter.MessageReq) (*messagecenter.MessageResp, error) {
 	l := logic.NewFindMessageLogic(ctx, s.svcCtx)
 	return l.FindMessage(in)
 }
 
-//  聊天保存
+// 聊天保存
 func (s *MessageCenterServer) SaveMessage(ctx context.Context, in *messagecenter.MessageEntity) (*messagecenter.SaveMessageResp, error) {
 	l := logic.NewSaveMessageLogic(ctx, s.svcCtx)
 	return l.SaveMessage(in)
 }
 
-//  会话创建
+// 会话创建
 func (s *MessageCenterServer) CreateChatSession(ctx context.Context, in *messagecenter.ChatSessionReq) (*messagecenter.ChatSessionResp, error) {
 	l := logic.NewCreateChatSessionLogic(ctx, s.svcCtx)
 	return l.CreateChatSession(in)
 }
 
-//  会话关闭
+// 会话关闭
 func (s *MessageCenterServer) CloseChatSession(ctx context.Context, in *messagecenter.CloseSessionReq) (*messagecenter.ChatSessionResp, error) {
 	l := logic.NewCloseChatSessionLogic(ctx, s.svcCtx)
 	return l.CloseChatSession(in)
@@ -75,3 +75,9 @@ func (s *MessageCenterServer) WithdrawMessage(ctx context.Context, in *messagece
 	l := logic.NewWithdrawMessageLogic(ctx, s.svcCtx)
 	return l.WithdrawMessage(in)
 }
+
+// 用户评价回复
+func (s *MessageCenterServer) AppraiseMessage(ctx context.Context, in *messagecenter.AppraiseReq) (*messagecenter.CurrencyResp, error) {
+	l := logic.NewAppraiseMessageLogic(ctx, s.svcCtx)
+	return l.AppraiseMessage(in)
+}

+ 11 - 1
rpc/messagecenter/messagecenter.proto

@@ -84,6 +84,7 @@ message MessageEntity {
   int64         receiveId=17;
   string        ownImg=18;
   string        messageId=19;
+  int64         appraise=20;
 }
 
 message ChatSessionReq {
@@ -128,6 +129,13 @@ message ReadWithdrawReq {
   int64         type = 9;
 }
 
+message AppraiseReq {
+  string        appid=1;
+  string        messageId = 2;
+  int64         newUserId = 3;
+  int64         appraise = 4;
+}
+
 message CurrencyResp {
    int64 error_code = 2; //响应代码
    string error_msg = 1; //响应消息
@@ -151,4 +159,6 @@ service messageCenter {
   rpc UpdateReadById(ReadStateReq)returns(CurrencyResp);
   //用户撤回消息
   rpc WithdrawMessage(ReadWithdrawReq)returns(CurrencyResp);
-}
+  // 用户评价回复
+  rpc AppraiseMessage(AppraiseReq) returns(CurrencyResp);
+}

+ 15 - 7
rpc/messagecenter/messagecenter/messagecenter.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: messagecenter.proto
 
 package messagecenter
@@ -12,17 +12,17 @@ import (
 
 type (
 	MessageCenter interface {
-		//  查询数量
+		// 查询数量
 		Count(ctx context.Context, in *CountReq, opts ...grpc.CallOption) (*CountResp, error)
-		//  用户列表查询
+		// 用户列表查询
 		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) (*SaveMessageResp, error)
-		//  会话创建
+		// 会话创建
 		CreateChatSession(ctx context.Context, in *ChatSessionReq, opts ...grpc.CallOption) (*ChatSessionResp, error)
-		//  会话关闭
+		// 会话关闭
 		CloseChatSession(ctx context.Context, in *CloseSessionReq, opts ...grpc.CallOption) (*ChatSessionResp, error)
 		// 创建会话并且保存信息
 		SaveAutoReplyMsg(ctx context.Context, in *SaveAutoReplyReq, opts ...grpc.CallOption) (*MessageResp, error)
@@ -30,6 +30,8 @@ type (
 		UpdateReadById(ctx context.Context, in *ReadStateReq, opts ...grpc.CallOption) (*CurrencyResp, error)
 		// 用户撤回消息
 		WithdrawMessage(ctx context.Context, in *ReadWithdrawReq, opts ...grpc.CallOption) (*CurrencyResp, error)
+		// 用户评价回复
+		AppraiseMessage(ctx context.Context, in *AppraiseReq, opts ...grpc.CallOption) (*CurrencyResp, error)
 	}
 
 	defaultMessageCenter struct {
@@ -96,3 +98,9 @@ func (m *defaultMessageCenter) WithdrawMessage(ctx context.Context, in *ReadWith
 	client := NewMessageCenterClient(m.cli.Conn())
 	return client.WithdrawMessage(ctx, in, opts...)
 }
+
+// 用户评价回复
+func (m *defaultMessageCenter) AppraiseMessage(ctx context.Context, in *AppraiseReq, opts ...grpc.CallOption) (*CurrencyResp, error) {
+	client := NewMessageCenterClient(m.cli.Conn())
+	return client.AppraiseMessage(ctx, in, opts...)
+}

+ 231 - 122
rpc/messagecenter/messagecenter/messagecenter.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.28.1
-// 	protoc        v3.19.4
+// 	protoc-gen-go v1.30.0
+// 	protoc        v3.21.12
 // source: messagecenter.proto
 
 package messagecenter
@@ -716,6 +716,7 @@ type MessageEntity struct {
 	ReceiveId  int64  `protobuf:"varint,17,opt,name=receiveId,proto3" json:"receiveId,omitempty"`
 	OwnImg     string `protobuf:"bytes,18,opt,name=ownImg,proto3" json:"ownImg,omitempty"`
 	MessageId  string `protobuf:"bytes,19,opt,name=messageId,proto3" json:"messageId,omitempty"`
+	Appraise   int64  `protobuf:"varint,20,opt,name=appraise,proto3" json:"appraise,omitempty"`
 }
 
 func (x *MessageEntity) Reset() {
@@ -883,6 +884,13 @@ func (x *MessageEntity) GetMessageId() string {
 	return ""
 }
 
+func (x *MessageEntity) GetAppraise() int64 {
+	if x != nil {
+		return x.Appraise
+	}
+	return 0
+}
+
 type ChatSessionReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1341,6 +1349,77 @@ func (x *ReadWithdrawReq) GetType() int64 {
 	return 0
 }
 
+type AppraiseReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Appid     string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
+	MessageId string `protobuf:"bytes,2,opt,name=messageId,proto3" json:"messageId,omitempty"`
+	NewUserId int64  `protobuf:"varint,3,opt,name=newUserId,proto3" json:"newUserId,omitempty"`
+	Appraise  int64  `protobuf:"varint,4,opt,name=appraise,proto3" json:"appraise,omitempty"`
+}
+
+func (x *AppraiseReq) Reset() {
+	*x = AppraiseReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_messagecenter_proto_msgTypes[15]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *AppraiseReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AppraiseReq) ProtoMessage() {}
+
+func (x *AppraiseReq) ProtoReflect() protoreflect.Message {
+	mi := &file_messagecenter_proto_msgTypes[15]
+	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 AppraiseReq.ProtoReflect.Descriptor instead.
+func (*AppraiseReq) Descriptor() ([]byte, []int) {
+	return file_messagecenter_proto_rawDescGZIP(), []int{15}
+}
+
+func (x *AppraiseReq) GetAppid() string {
+	if x != nil {
+		return x.Appid
+	}
+	return ""
+}
+
+func (x *AppraiseReq) GetMessageId() string {
+	if x != nil {
+		return x.MessageId
+	}
+	return ""
+}
+
+func (x *AppraiseReq) GetNewUserId() int64 {
+	if x != nil {
+		return x.NewUserId
+	}
+	return 0
+}
+
+func (x *AppraiseReq) GetAppraise() int64 {
+	if x != nil {
+		return x.Appraise
+	}
+	return 0
+}
+
 type CurrencyResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1353,7 +1432,7 @@ type CurrencyResp struct {
 func (x *CurrencyResp) Reset() {
 	*x = CurrencyResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_messagecenter_proto_msgTypes[15]
+		mi := &file_messagecenter_proto_msgTypes[16]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -1366,7 +1445,7 @@ func (x *CurrencyResp) String() string {
 func (*CurrencyResp) ProtoMessage() {}
 
 func (x *CurrencyResp) ProtoReflect() protoreflect.Message {
-	mi := &file_messagecenter_proto_msgTypes[15]
+	mi := &file_messagecenter_proto_msgTypes[16]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -1379,7 +1458,7 @@ func (x *CurrencyResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use CurrencyResp.ProtoReflect.Descriptor instead.
 func (*CurrencyResp) Descriptor() ([]byte, []int) {
-	return file_messagecenter_proto_rawDescGZIP(), []int{15}
+	return file_messagecenter_proto_rawDescGZIP(), []int{16}
 }
 
 func (x *CurrencyResp) GetErrorCode() int64 {
@@ -1490,7 +1569,7 @@ var file_messagecenter_proto_rawDesc = []byte{
 	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,
+	0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x95, 0x04, 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,
@@ -1522,111 +1601,126 @@ var file_messagecenter_proto_rawDesc = []byte{
 	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, 0x09, 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,
+	0x67, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x61, 0x69, 0x73, 0x65,
+	0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x61, 0x69, 0x73, 0x65,
+	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,
+	0x22, 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71,
+	0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 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, 0x1c, 0x0a, 0x09,
+	0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xe5, 0x01, 0x0a, 0x0f, 0x52,
+	0x65, 0x61, 0x64, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, 0x12, 0x1c,
+	0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 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, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18,
+	0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05,
+	0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74,
+	0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 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, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64,
+	0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x12,
+	0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79,
+	0x70, 0x65, 0x22, 0x7b, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x72, 0x61, 0x69, 0x73, 0x65, 0x52, 0x65,
+	0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73,
+	0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72,
+	0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65,
+	0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x61, 0x69, 0x73, 0x65, 0x18,
+	0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x61, 0x69, 0x73, 0x65, 0x22,
+	0x4a, 0x0a, 0x0c, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 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, 0x22, 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74,
-	0x65, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49,
-	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
-	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, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xe5,
-	0x01, 0x0a, 0x0f, 0x52, 0x65, 0x61, 0x64, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52,
-	0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64,
-	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, 0x14, 0x0a, 0x05, 0x61, 0x70,
-	0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
-	0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x05,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 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, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x07,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65,
-	0x6e, 0x64, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64,
-	0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x4a, 0x0a, 0x0c, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e,
-	0x63, 0x79, 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, 0x32, 0xb0, 0x05, 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, 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, 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, 0x12, 0x4a, 0x0a, 0x0e, 0x55, 0x70, 0x64,
-	0x61, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x42, 0x79, 0x49, 0x64, 0x12, 0x1b, 0x2e, 0x6d, 0x65,
-	0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64,
-	0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
-	0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63,
-	0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a, 0x0f, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61,
-	0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
-	0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x57, 0x69, 0x74,
-	0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
-	0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63,
-	0x79, 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,
+	0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x32, 0xfc, 0x05, 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, 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, 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, 0x12, 0x4a, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64,
+	0x42, 0x79, 0x49, 0x64, 0x12, 0x1b, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65,
+	0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65,
+	0x71, 0x1a, 0x1b, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65,
+	0x72, 0x2e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4e,
+	0x0a, 0x0f, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65,
+	0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65,
+	0x71, 0x1a, 0x1b, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65,
+	0x72, 0x2e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a,
+	0x0a, 0x0f, 0x41, 0x70, 0x70, 0x72, 0x61, 0x69, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x12, 0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65,
+	0x72, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x61, 0x69, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e,
+	0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x75,
+	0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 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 (
@@ -1641,7 +1735,7 @@ func file_messagecenter_proto_rawDescGZIP() []byte {
 	return file_messagecenter_proto_rawDescData
 }
 
-var file_messagecenter_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
+var file_messagecenter_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
 var file_messagecenter_proto_goTypes = []interface{}{
 	(*CountReq)(nil),         // 0: messagecenter.CountReq
 	(*CountResp)(nil),        // 1: messagecenter.CountResp
@@ -1658,7 +1752,8 @@ var file_messagecenter_proto_goTypes = []interface{}{
 	(*SaveAutoReplyReq)(nil), // 12: messagecenter.SaveAutoReplyReq
 	(*ReadStateReq)(nil),     // 13: messagecenter.ReadStateReq
 	(*ReadWithdrawReq)(nil),  // 14: messagecenter.ReadWithdrawReq
-	(*CurrencyResp)(nil),     // 15: messagecenter.CurrencyResp
+	(*AppraiseReq)(nil),      // 15: messagecenter.AppraiseReq
+	(*CurrencyResp)(nil),     // 16: messagecenter.CurrencyResp
 }
 var file_messagecenter_proto_depIdxs = []int32{
 	8,  // 0: messagecenter.CountResp.lastMessage:type_name -> messagecenter.MessageEntity
@@ -1674,17 +1769,19 @@ var file_messagecenter_proto_depIdxs = []int32{
 	12, // 10: messagecenter.messageCenter.SaveAutoReplyMsg:input_type -> messagecenter.SaveAutoReplyReq
 	13, // 11: messagecenter.messageCenter.UpdateReadById:input_type -> messagecenter.ReadStateReq
 	14, // 12: messagecenter.messageCenter.WithdrawMessage:input_type -> messagecenter.ReadWithdrawReq
-	1,  // 13: messagecenter.messageCenter.Count:output_type -> messagecenter.CountResp
-	3,  // 14: messagecenter.messageCenter.UserList:output_type -> messagecenter.UserResp
-	6,  // 15: messagecenter.messageCenter.FindMessage:output_type -> messagecenter.MessageResp
-	7,  // 16: messagecenter.messageCenter.SaveMessage:output_type -> messagecenter.SaveMessageResp
-	11, // 17: messagecenter.messageCenter.CreateChatSession:output_type -> messagecenter.ChatSessionResp
-	11, // 18: messagecenter.messageCenter.CloseChatSession:output_type -> messagecenter.ChatSessionResp
-	6,  // 19: messagecenter.messageCenter.SaveAutoReplyMsg:output_type -> messagecenter.MessageResp
-	15, // 20: messagecenter.messageCenter.UpdateReadById:output_type -> messagecenter.CurrencyResp
-	15, // 21: messagecenter.messageCenter.WithdrawMessage:output_type -> messagecenter.CurrencyResp
-	13, // [13:22] is the sub-list for method output_type
-	4,  // [4:13] is the sub-list for method input_type
+	15, // 13: messagecenter.messageCenter.AppraiseMessage:input_type -> messagecenter.AppraiseReq
+	1,  // 14: messagecenter.messageCenter.Count:output_type -> messagecenter.CountResp
+	3,  // 15: messagecenter.messageCenter.UserList:output_type -> messagecenter.UserResp
+	6,  // 16: messagecenter.messageCenter.FindMessage:output_type -> messagecenter.MessageResp
+	7,  // 17: messagecenter.messageCenter.SaveMessage:output_type -> messagecenter.SaveMessageResp
+	11, // 18: messagecenter.messageCenter.CreateChatSession:output_type -> messagecenter.ChatSessionResp
+	11, // 19: messagecenter.messageCenter.CloseChatSession:output_type -> messagecenter.ChatSessionResp
+	6,  // 20: messagecenter.messageCenter.SaveAutoReplyMsg:output_type -> messagecenter.MessageResp
+	16, // 21: messagecenter.messageCenter.UpdateReadById:output_type -> messagecenter.CurrencyResp
+	16, // 22: messagecenter.messageCenter.WithdrawMessage:output_type -> messagecenter.CurrencyResp
+	16, // 23: messagecenter.messageCenter.AppraiseMessage:output_type -> messagecenter.CurrencyResp
+	14, // [14:24] is the sub-list for method output_type
+	4,  // [4:14] 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
@@ -1877,6 +1974,18 @@ func file_messagecenter_proto_init() {
 			}
 		}
 		file_messagecenter_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*AppraiseReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_messagecenter_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*CurrencyResp); i {
 			case 0:
 				return &v.state
@@ -1895,7 +2004,7 @@ func file_messagecenter_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_messagecenter_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   16,
+			NumMessages:   17,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 71 - 20
rpc/messagecenter/messagecenter/messagecenter_grpc.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
-// - protoc-gen-go-grpc v1.2.0
-// - protoc             v3.19.4
+// - protoc-gen-go-grpc v1.3.0
+// - protoc             v3.21.12
 // source: messagecenter.proto
 
 package messagecenter
@@ -18,6 +18,19 @@ import (
 // Requires gRPC-Go v1.32.0 or later.
 const _ = grpc.SupportPackageIsVersion7
 
+const (
+	MessageCenter_Count_FullMethodName             = "/messagecenter.messageCenter/Count"
+	MessageCenter_UserList_FullMethodName          = "/messagecenter.messageCenter/UserList"
+	MessageCenter_FindMessage_FullMethodName       = "/messagecenter.messageCenter/FindMessage"
+	MessageCenter_SaveMessage_FullMethodName       = "/messagecenter.messageCenter/SaveMessage"
+	MessageCenter_CreateChatSession_FullMethodName = "/messagecenter.messageCenter/CreateChatSession"
+	MessageCenter_CloseChatSession_FullMethodName  = "/messagecenter.messageCenter/CloseChatSession"
+	MessageCenter_SaveAutoReplyMsg_FullMethodName  = "/messagecenter.messageCenter/SaveAutoReplyMsg"
+	MessageCenter_UpdateReadById_FullMethodName    = "/messagecenter.messageCenter/UpdateReadById"
+	MessageCenter_WithdrawMessage_FullMethodName   = "/messagecenter.messageCenter/WithdrawMessage"
+	MessageCenter_AppraiseMessage_FullMethodName   = "/messagecenter.messageCenter/AppraiseMessage"
+)
+
 // MessageCenterClient is the client API for MessageCenter service.
 //
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
@@ -40,6 +53,8 @@ type MessageCenterClient interface {
 	UpdateReadById(ctx context.Context, in *ReadStateReq, opts ...grpc.CallOption) (*CurrencyResp, error)
 	// 用户撤回消息
 	WithdrawMessage(ctx context.Context, in *ReadWithdrawReq, opts ...grpc.CallOption) (*CurrencyResp, error)
+	// 用户评价回复
+	AppraiseMessage(ctx context.Context, in *AppraiseReq, opts ...grpc.CallOption) (*CurrencyResp, error)
 }
 
 type messageCenterClient struct {
@@ -52,7 +67,7 @@ func NewMessageCenterClient(cc grpc.ClientConnInterface) MessageCenterClient {
 
 func (c *messageCenterClient) Count(ctx context.Context, in *CountReq, opts ...grpc.CallOption) (*CountResp, error) {
 	out := new(CountResp)
-	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/Count", in, out, opts...)
+	err := c.cc.Invoke(ctx, MessageCenter_Count_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -61,7 +76,7 @@ func (c *messageCenterClient) Count(ctx context.Context, in *CountReq, opts ...g
 
 func (c *messageCenterClient) UserList(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResp, error) {
 	out := new(UserResp)
-	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/UserList", in, out, opts...)
+	err := c.cc.Invoke(ctx, MessageCenter_UserList_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -70,7 +85,7 @@ func (c *messageCenterClient) UserList(ctx context.Context, in *UserReq, opts ..
 
 func (c *messageCenterClient) FindMessage(ctx context.Context, in *MessageReq, opts ...grpc.CallOption) (*MessageResp, error) {
 	out := new(MessageResp)
-	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/FindMessage", in, out, opts...)
+	err := c.cc.Invoke(ctx, MessageCenter_FindMessage_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -79,7 +94,7 @@ func (c *messageCenterClient) FindMessage(ctx context.Context, in *MessageReq, o
 
 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...)
+	err := c.cc.Invoke(ctx, MessageCenter_SaveMessage_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -88,7 +103,7 @@ func (c *messageCenterClient) SaveMessage(ctx context.Context, in *MessageEntity
 
 func (c *messageCenterClient) CreateChatSession(ctx context.Context, in *ChatSessionReq, opts ...grpc.CallOption) (*ChatSessionResp, error) {
 	out := new(ChatSessionResp)
-	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/CreateChatSession", in, out, opts...)
+	err := c.cc.Invoke(ctx, MessageCenter_CreateChatSession_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -97,7 +112,7 @@ func (c *messageCenterClient) CreateChatSession(ctx context.Context, in *ChatSes
 
 func (c *messageCenterClient) CloseChatSession(ctx context.Context, in *CloseSessionReq, opts ...grpc.CallOption) (*ChatSessionResp, error) {
 	out := new(ChatSessionResp)
-	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/CloseChatSession", in, out, opts...)
+	err := c.cc.Invoke(ctx, MessageCenter_CloseChatSession_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -106,7 +121,7 @@ func (c *messageCenterClient) CloseChatSession(ctx context.Context, in *CloseSes
 
 func (c *messageCenterClient) SaveAutoReplyMsg(ctx context.Context, in *SaveAutoReplyReq, opts ...grpc.CallOption) (*MessageResp, error) {
 	out := new(MessageResp)
-	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/SaveAutoReplyMsg", in, out, opts...)
+	err := c.cc.Invoke(ctx, MessageCenter_SaveAutoReplyMsg_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -115,7 +130,7 @@ func (c *messageCenterClient) SaveAutoReplyMsg(ctx context.Context, in *SaveAuto
 
 func (c *messageCenterClient) UpdateReadById(ctx context.Context, in *ReadStateReq, opts ...grpc.CallOption) (*CurrencyResp, error) {
 	out := new(CurrencyResp)
-	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/UpdateReadById", in, out, opts...)
+	err := c.cc.Invoke(ctx, MessageCenter_UpdateReadById_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -124,7 +139,16 @@ func (c *messageCenterClient) UpdateReadById(ctx context.Context, in *ReadStateR
 
 func (c *messageCenterClient) WithdrawMessage(ctx context.Context, in *ReadWithdrawReq, opts ...grpc.CallOption) (*CurrencyResp, error) {
 	out := new(CurrencyResp)
-	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/WithdrawMessage", in, out, opts...)
+	err := c.cc.Invoke(ctx, MessageCenter_WithdrawMessage_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *messageCenterClient) AppraiseMessage(ctx context.Context, in *AppraiseReq, opts ...grpc.CallOption) (*CurrencyResp, error) {
+	out := new(CurrencyResp)
+	err := c.cc.Invoke(ctx, MessageCenter_AppraiseMessage_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -153,6 +177,8 @@ type MessageCenterServer interface {
 	UpdateReadById(context.Context, *ReadStateReq) (*CurrencyResp, error)
 	// 用户撤回消息
 	WithdrawMessage(context.Context, *ReadWithdrawReq) (*CurrencyResp, error)
+	// 用户评价回复
+	AppraiseMessage(context.Context, *AppraiseReq) (*CurrencyResp, error)
 	mustEmbedUnimplementedMessageCenterServer()
 }
 
@@ -187,6 +213,9 @@ func (UnimplementedMessageCenterServer) UpdateReadById(context.Context, *ReadSta
 func (UnimplementedMessageCenterServer) WithdrawMessage(context.Context, *ReadWithdrawReq) (*CurrencyResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method WithdrawMessage not implemented")
 }
+func (UnimplementedMessageCenterServer) AppraiseMessage(context.Context, *AppraiseReq) (*CurrencyResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method AppraiseMessage not implemented")
+}
 func (UnimplementedMessageCenterServer) mustEmbedUnimplementedMessageCenterServer() {}
 
 // UnsafeMessageCenterServer may be embedded to opt out of forward compatibility for this service.
@@ -210,7 +239,7 @@ func _MessageCenter_Count_Handler(srv interface{}, ctx context.Context, dec func
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/messagecenter.messageCenter/Count",
+		FullMethod: MessageCenter_Count_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).Count(ctx, req.(*CountReq))
@@ -228,7 +257,7 @@ func _MessageCenter_UserList_Handler(srv interface{}, ctx context.Context, dec f
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/messagecenter.messageCenter/UserList",
+		FullMethod: MessageCenter_UserList_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).UserList(ctx, req.(*UserReq))
@@ -246,7 +275,7 @@ func _MessageCenter_FindMessage_Handler(srv interface{}, ctx context.Context, de
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/messagecenter.messageCenter/FindMessage",
+		FullMethod: MessageCenter_FindMessage_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).FindMessage(ctx, req.(*MessageReq))
@@ -264,7 +293,7 @@ func _MessageCenter_SaveMessage_Handler(srv interface{}, ctx context.Context, de
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/messagecenter.messageCenter/SaveMessage",
+		FullMethod: MessageCenter_SaveMessage_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).SaveMessage(ctx, req.(*MessageEntity))
@@ -282,7 +311,7 @@ func _MessageCenter_CreateChatSession_Handler(srv interface{}, ctx context.Conte
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/messagecenter.messageCenter/CreateChatSession",
+		FullMethod: MessageCenter_CreateChatSession_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).CreateChatSession(ctx, req.(*ChatSessionReq))
@@ -300,7 +329,7 @@ func _MessageCenter_CloseChatSession_Handler(srv interface{}, ctx context.Contex
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/messagecenter.messageCenter/CloseChatSession",
+		FullMethod: MessageCenter_CloseChatSession_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).CloseChatSession(ctx, req.(*CloseSessionReq))
@@ -318,7 +347,7 @@ func _MessageCenter_SaveAutoReplyMsg_Handler(srv interface{}, ctx context.Contex
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/messagecenter.messageCenter/SaveAutoReplyMsg",
+		FullMethod: MessageCenter_SaveAutoReplyMsg_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).SaveAutoReplyMsg(ctx, req.(*SaveAutoReplyReq))
@@ -336,7 +365,7 @@ func _MessageCenter_UpdateReadById_Handler(srv interface{}, ctx context.Context,
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/messagecenter.messageCenter/UpdateReadById",
+		FullMethod: MessageCenter_UpdateReadById_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).UpdateReadById(ctx, req.(*ReadStateReq))
@@ -354,7 +383,7 @@ func _MessageCenter_WithdrawMessage_Handler(srv interface{}, ctx context.Context
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/messagecenter.messageCenter/WithdrawMessage",
+		FullMethod: MessageCenter_WithdrawMessage_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).WithdrawMessage(ctx, req.(*ReadWithdrawReq))
@@ -362,6 +391,24 @@ func _MessageCenter_WithdrawMessage_Handler(srv interface{}, ctx context.Context
 	return interceptor(ctx, in, info, handler)
 }
 
+func _MessageCenter_AppraiseMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(AppraiseReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(MessageCenterServer).AppraiseMessage(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: MessageCenter_AppraiseMessage_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(MessageCenterServer).AppraiseMessage(ctx, req.(*AppraiseReq))
+	}
+	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)
@@ -405,6 +452,10 @@ var MessageCenter_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "WithdrawMessage",
 			Handler:    _MessageCenter_WithdrawMessage_Handler,
 		},
+		{
+			MethodName: "AppraiseMessage",
+			Handler:    _MessageCenter_AppraiseMessage_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "messagecenter.proto",

+ 41 - 10
service/message_mail_box.go

@@ -207,14 +207,14 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 		userId := int64(0)
 		sessionId := int64(0)
 		switch in.ItemType {
-		case 4, 5:
+		case 4, 5, 8:
 			if in.OwnType == 1 {
 				sessionId = in.ReceiveId
 				userId = in.NewUserId
 			} else {
 				sessionId = in.SendId
 				userId = in.ReceiveId
-				if in.ItemType == 4 {
+				if in.ItemType == 4 || in.ItemType == 8 {
 					userId = in.NewUserId
 				}
 			}
@@ -320,7 +320,7 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 			receiveOk = util.Mysql.InsertByTx(tx, util.SOCIALIZE_MESSAGE_MAILBOX, messageMailBox)
 			return ok > 1 && receiveOk > 1
 		}
-		if in.ItemType == 4 || in.ItemType == 5 {
+		if in.ItemType == 4 || in.ItemType == 8 || in.ItemType == 5 {
 			//客服或者机器人聊天
 			if in.OwnType == 1 {
 				// (用户发送)客服接受
@@ -341,7 +341,7 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 				messageMailBox["send_user_id"] = in.SendId
 				messageMailBox["receive_user_id"] = in.ReceiveId
 				userId = in.ReceiveId
-				if in.ItemType == 4 {
+				if in.ItemType == 4 || in.ItemType == 8 {
 					messageMailBox["receive_user_id"] = in.NewUserId
 					userId = in.NewUserId
 					messageMailBox["own_id"] = in.NewUserId
@@ -373,7 +373,7 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 			"receive_isdel": 0,
 			"iswithdraw":    0,
 		}
-		if in.ItemType == 4 || in.ItemType == 5 {
+		if in.ItemType == 4 || in.ItemType == 8 || in.ItemType == 5 {
 			//客服或者机器人聊天
 			if in.OwnType == 1 {
 				//用户发送(用户接受)
@@ -392,7 +392,7 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 				messageMailBox["own_id"] = in.SendId
 				messageMailBox["send_user_id"] = in.SendId
 				messageMailBox["receive_user_id"] = in.ReceiveId
-				if in.ItemType == 4 {
+				if in.ItemType == 4 || in.ItemType == 8 {
 					messageMailBox["receive_user_id"] = in.NewUserId
 				}
 			}
@@ -452,7 +452,7 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
 				"LEFT JOIN %s b ON a.messag_id = b.id   "+
 				"LEFT JOIN %s c ON   a.own_type = 1  AND  a.own_id=c.id    "+
 				"WHERE   a.own_type = 1 and a.iswithdraw = 0  "+
-				"AND (a.type = 5 or a.type=4 or  a.type=6 or  a.type=7)   "+
+				"AND (a.type = 5 or a.type=4 or a.type=6 or  a.type=7 or a.type=8 )   "+
 				"AND c.ent_id =   %d "+
 				"AND c.user_id =   %d  %s "+
 				"ORDER BY a.create_time desc ,a.id   asc "+
@@ -461,19 +461,20 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
 				in.EntId, in.SendId, lastStr, in.PageSize)
 		} else {
 			//用户聊天记录查看
-			sqlStr = fmt.Sprintf("SELECT a.messag_id as messageId,  b.*,   IF   ( a.own_id = a.send_user_id, 1, 2 ) AS fool ,   a.send_user_type,   a.type as  itemType,   d.nickname as  robotName,   d.headimage as  robotImg,   c.customer_service_name as  setName   "+
+			sqlStr = fmt.Sprintf("SELECT a.messag_id as messageId,e.appraise as appraise, b.*,   IF ( a.own_id = a.send_user_id, 1, 2 ) AS fool ,   a.send_user_type,   a.type as  itemType,   d.nickname as  robotName,   d.headimage as  robotImg,   c.customer_service_name as  setName   "+
 				"FROM   %s a   "+
 				"LEFT JOIN %s b ON a.messag_id = b.id   "+
 				"LEFT JOIN %s c ON   IF   ( a.send_user_type = 1, a.send_user_id, a.receive_user_id ) = c.id AND  c.ent_id = %d AND c.user_id = %d "+
 				"LEFT JOIN  %s d on  c.ent_id=d.ent_id    "+
+				"LEFT JOIN %s e on  e.messag_id=b.id "+
 				"WHERE   a.own_type = 2  and a.iswithdraw = 0  "+
 				"AND a.own_id =  %d "+
 				"AND  c.ent_id = %d "+
 				"AND c.user_id =  %d "+
-				"AND ( a.type = 4 OR a.type = 5 or a.type=6 or  a.type=7)  %s "+
+				"AND ( a.type = 4 OR a.type = 5 or a.type=6 or  a.type=7 or  a.type=8)  %s "+
 				"ORDER BY a.create_time desc ,a.id   asc "+
 				"limit 0 ,   %d ",
-				util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, util.SOCIALIZE_CHAT_SESSION, in.SendId, in.NewUserId, util.SOCIALIZE_TENANT_ROBOT,
+				util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, util.SOCIALIZE_CHAT_SESSION, in.SendId, in.NewUserId, util.SOCIALIZE_TENANT_ROBOT, util.SOCIALIZE_APPRAISE,
 				in.NewUserId, in.SendId, in.NewUserId, lastStr, in.PageSize)
 		}
 		break
@@ -654,3 +655,33 @@ func (b MessaggeService) WithdrawMessage(in *messagecenter.ReadWithdrawReq) bool
 	return util.Mysql.Update(util.SOCIALIZE_MESSAGE_MAILBOX,
 		map[string]interface{}{"id": messageId}, map[string]interface{}{"messag_id": messageId, "iswithdraw": 1, "withdraw_time": nowForm.Format(util.Date_Full_Layout)})
 }
+
+// AppraiseMessage 消息评价
+func (b MessaggeService) AppraiseMessage(in *messagecenter.AppraiseReq) error {
+	messageId := encrypt.SE.Decode4Hex(in.MessageId)
+	//查询此条消息是否是当前用户的
+	if util.Mysql.Count(util.SOCIALIZE_MESSAGE_MAILBOX, map[string]interface{}{
+		"messag_id":         messageId,
+		"receive_user_id":   in.NewUserId,
+		"receive_user_type": 2,
+		"type":              8,
+	}) == 0 {
+		return fmt.Errorf("未查询到信息")
+	}
+	if util.Mysql.Count(util.SOCIALIZE_APPRAISE, map[string]interface{}{
+		"appid":     in.Appid,
+		"messag_id": messageId,
+	}) > 0 {
+		return fmt.Errorf("请勿重复评价")
+	}
+	//插入评价
+	if util.Mysql.Insert(util.SOCIALIZE_APPRAISE, map[string]interface{}{
+		"appid":       in.Appid,
+		"messag_id":   messageId,
+		"create_time": time.Now().Local().Format(util.Date_Full_Layout),
+		"appraise":    in.Appraise,
+	}) > 0 {
+		return nil
+	}
+	return fmt.Errorf("评价消息异常")
+}