瀏覽代碼

分支合并

lianbingjie 2 年之前
父節點
當前提交
7022c44c72
共有 27 個文件被更改,包括 1865 次插入224 次删除
  1. 28 0
      api/messagecenter/internal/handler/appraisemessagehandler.go
  2. 28 0
      api/messagecenter/internal/handler/conversationlisthandler.go
  3. 15 0
      api/messagecenter/internal/handler/routes.go
  4. 28 0
      api/messagecenter/internal/handler/withdrawmessagehandler.go
  5. 41 0
      api/messagecenter/internal/logic/appraisemessagelogic.go
  6. 43 0
      api/messagecenter/internal/logic/conversationlistlogic.go
  7. 16 4
      api/messagecenter/internal/logic/messageaddlogic.go
  8. 12 6
      api/messagecenter/internal/logic/userlistlogic.go
  9. 42 0
      api/messagecenter/internal/logic/withdrawmessagelogic.go
  10. 28 6
      api/messagecenter/internal/types/types.go
  11. 40 6
      api/messagecenter/messagecenter.api
  12. 80 1
      entity/util.go
  13. 8 0
      go.mod
  14. 68 0
      go.sum
  15. 39 0
      rpc/messagecenter/internal/logic/appraisemessagelogic.go
  16. 59 0
      rpc/messagecenter/internal/logic/conversationlistlogic.go
  17. 20 17
      rpc/messagecenter/internal/logic/findmessagelogic.go
  18. 18 16
      rpc/messagecenter/internal/logic/userlistlogic.go
  19. 40 0
      rpc/messagecenter/internal/logic/withdrawmessagelogic.go
  20. 25 6
      rpc/messagecenter/internal/server/messagecenterserver.go
  21. 0 1
      rpc/messagecenter/messagecenter.go
  22. 70 0
      rpc/messagecenter/messagecenter.proto
  23. 33 0
      rpc/messagecenter/messagecenter/messagecenter.go
  24. 615 108
      rpc/messagecenter/messagecenter/messagecenter.pb.go
  25. 112 4
      rpc/messagecenter/messagecenter/messagecenter_grpc.pb.go
  26. 356 48
      service/message_mail_box.go
  27. 1 1
      service/message_mail_box_test.go

+ 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)
+		}
+	}
+}

+ 28 - 0
api/messagecenter/internal/handler/conversationlisthandler.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 ConversationListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.UserReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewConversationListLogic(r.Context(), svcCtx)
+		resp, err := l.ConversationList(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

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

@@ -54,6 +54,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
+<<<<<<< HEAD
 				Path:    "/message/chatGroupList",
 				Handler: chatGroupListHandler(serverCtx),
 			},
@@ -91,6 +92,20 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Method:  http.MethodPost,
 				Path:    "/message/groupNoticeGet",
 				Handler: groupNoticeGetHandler(serverCtx),
+=======
+				Path:    "/message/withdrawMessage",
+				Handler: withdrawMessageHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/message/appraiseMessage",
+				Handler: AppraiseMessageHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/message/conversationList",
+				Handler: ConversationListHandler(serverCtx),
+>>>>>>> master
 			},
 		},
 	)

+ 28 - 0
api/messagecenter/internal/handler/withdrawmessagehandler.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 withdrawMessageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.ReadWithdrawReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewWithdrawMessageLogic(r.Context(), svcCtx)
+		resp, err := l.WithdrawMessage(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 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
+
+}

+ 43 - 0
api/messagecenter/internal/logic/conversationlistlogic.go

@@ -0,0 +1,43 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
+	"context"
+
+	"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/core/logx"
+)
+
+type ConversationListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewConversationListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ConversationListLogic {
+	return &ConversationListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *ConversationListLogic) ConversationList(req *types.UserReq) (*types.CommonRes, error) {
+	resp, err := l.svcCtx.Message.ConversationList(l.ctx, &messagecenter.ConversationReq{
+		UserType:     req.UserType,
+		NewUserId:    req.NewUserId,
+		EntUserId:    req.EntUserId,
+		FiltrationId: req.FiltrationId,
+	})
+	if err != nil {
+		return nil, err
+	}
+	return &types.CommonRes{
+		Error_msg:  resp.ErrorMsg,
+		Error_code: int(resp.ErrorCode),
+		Data:       resp.Data,
+		Count:      resp.Count,
+	}, nil
+}

+ 16 - 4
api/messagecenter/internal/logic/messageaddlogic.go

@@ -4,11 +4,11 @@ import (
 	quitl "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/fsw"
-	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
-	"context"
-
 	"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/microcosm-cc/bluemonday"
 
 	"github.com/zeromicro/go-zero/core/logx"
 )
@@ -27,12 +27,24 @@ func NewMessageAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Messag
 	}
 }
 
+var (
+	htmlFilter = bluemonday.NewPolicy()
+)
+
+func init() {
+	htmlFilter.AllowStandardURLs()
+	htmlFilter.AllowAttrs("href").OnElements("a")
+	htmlFilter.AllowAttrs("class").OnElements("li")
+	htmlFilter.AllowAttrs("src").OnElements("img")
+}
+
 func (l *MessageAddLogic) MessageAdd(req *types.MessageEntity) (*types.CommonRes, error) {
+
 	resp, err := l.svcCtx.Message.SaveMessage(l.ctx, &messagecenter.MessageEntity{
 		OwnType:   req.OwnType,
 		Title:     req.Title,
 		SendId:    quitl.Int64All(encrypt.SE.Decode4Hex(req.SendId)),
-		Content:   fsw.Repl(req.Content),
+		Content:   quitl.ObjToString(quitl.If(req.Type == 3 || req.Type == 4, fsw.Repl(req.Content), htmlFilter.Sanitize(fsw.Repl(req.Content)))),
 		Item:      req.Item,
 		Type:      req.Type,
 		Link:      req.Link,

+ 12 - 6
api/messagecenter/internal/logic/userlistlogic.go

@@ -27,12 +27,17 @@ func NewUserListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserList
 func (l *UserListLogic) UserList(req *types.UserReq) (*types.CommonRes, error) {
 	// todo: add your logic here and delete this line
 	resp, err := l.svcCtx.Message.UserList(l.ctx, &messagecenter.UserReq{
-		Phone:     req.Phone,
-		UserType:  req.UserType,
-		StartTime: req.StartTime,
-		EndTime:   req.EndTime,
-		NewUserId: req.NewUserId,
-		EntUserId: req.EntUserId,
+		Phone:        req.Phone,
+		UserType:     req.UserType,
+		StartTime:    req.StartTime,
+		EndTime:      req.EndTime,
+		NewUserId:    req.NewUserId,
+		EntUserId:    req.EntUserId,
+		Page:         req.Page,
+		Size:         req.Size,
+		IsArtificial: req.IsArtificial,
+		FiltrationId: req.FiltrationId,
+		EntId:        req.EntId,
 	})
 	if err != nil {
 		return nil, err
@@ -41,5 +46,6 @@ func (l *UserListLogic) UserList(req *types.UserReq) (*types.CommonRes, error) {
 		Error_msg:  resp.ErrorMsg,
 		Error_code: int(resp.ErrorCode),
 		Data:       resp.Data,
+		Count:      resp.Count,
 	}, nil
 }

+ 42 - 0
api/messagecenter/internal/logic/withdrawmessagelogic.go

@@ -0,0 +1,42 @@
+package logic
+
+import (
+	"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 WithdrawMessageLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewWithdrawMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WithdrawMessageLogic {
+	return &WithdrawMessageLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *WithdrawMessageLogic) WithdrawMessage(req *types.ReadWithdrawReq) (resp *types.CommonRes, err error) {
+	// todo: add your logic here and delete this line
+	r, err := l.svcCtx.Message.WithdrawMessage(l.ctx, &messagecenter.ReadWithdrawReq{
+		MessageId: req.MessageId,
+		Appid:     req.Appid,
+		NewUserId: req.NewUserId,
+		UserType:  req.UserType,
+		EntUserId: req.EntUserId,
+	})
+	if err != nil {
+		return nil, err
+	}
+	return &types.CommonRes{
+		Error_msg:  r.ErrorMsg,
+		Error_code: int(r.ErrorCode),
+	}, nil
+}

+ 28 - 6
api/messagecenter/internal/types/types.go

@@ -14,12 +14,17 @@ type CountResp struct {
 }
 
 type UserReq struct {
-	Phone     string `json:"phone,optional"`
-	UserType  int64  `json:"userType"`
-	StartTime string `json:"startTime,optional"`
-	EndTime   string `json:"endTime,optional"`
-	NewUserId int64  `header:"newUserId"`
-	EntUserId int64  `header:"entUserId,optional"`
+	Phone        string `json:"phone,optional"`
+	UserType     int64  `json:"userType"`
+	StartTime    string `json:"startTime,optional"`
+	EndTime      string `json:"endTime,optional"`
+	NewUserId    int64  `header:"newUserId"`
+	EntId        int64  `header:"entId,optional"`
+	EntUserId    int64  `header:"entUserId,optional"`
+	Page         int64  `json:"page,optional"`
+	Size         int64  `json:"size,optional"`
+	IsArtificial int64  `json:"isArtificial,optional"`
+	FiltrationId string `json:"filtrationId,optional"`
 }
 
 type MessageEntity struct {
@@ -83,6 +88,7 @@ type ReadStateReq struct {
 	NewUserId int64  `header:"newUserId"`
 }
 
+<<<<<<< HEAD
 type ChatGroupListReq struct {
 	EntId      int64  `header:"entId,optional"`
 	UserName   string `json:"userName"`
@@ -120,4 +126,20 @@ type GroupNoticeAddReq struct {
 type GroupNoticeUpdateReq struct {
 	Content       string `json:"content"`
 	GroupNoticeId string `json:"groupNoticeId"`
+=======
+type ReadWithdrawReq struct {
+	MessageId string `json:"messageId"`
+	Appid     string `header:"appid"`
+	NewUserId int64  `header:"newUserId,optional"`
+	EntUserId int64  `header:"entUserId,optional"`
+	UserType  int64  `json:"userType"`
+}
+
+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"`
+>>>>>>> master
 }

+ 40 - 6
api/messagecenter/messagecenter.api

@@ -11,12 +11,17 @@ type CountResp {
 }
 
 type UserReq {
-	Phone     string `json:"phone,optional"`
-	UserType  int64  `json:"userType"`
-	StartTime string `json:"startTime,optional"`
-	EndTime   string `json:"endTime,optional"`
-	NewUserId int64  `header:"newUserId"`
-	EntUserId int64  `header:"entUserId,optional"`
+	Phone        string `json:"phone,optional"`
+	UserType     int64  `json:"userType"`
+	StartTime    string `json:"startTime,optional"`
+	EndTime      string `json:"endTime,optional"`
+	NewUserId    int64  `header:"newUserId"`
+	EntId        int64  `header:"entId,optional"`
+	EntUserId    int64  `header:"entUserId,optional"`
+	Page         int64  `json:"page,optional"`
+	Size         int64  `json:"size,optional"`
+	IsArtificial int64  `json:"isArtificial,optional"`
+	FiltrationId string `json:"filtrationId,optional"`
 }
 type MessageEntity {
 	OwnType   int64  `json:"ownType"`
@@ -73,6 +78,7 @@ type ReadStateReq {
 	EntUserId int64  `header:"entUserId,optional"`
 	NewUserId int64  `header:"newUserId"`
 }
+<<<<<<< HEAD
 type ChatGroupListReq {
 	EntId      int64  `header:"entId,optional"`
 	UserName   string `json:"userName"`
@@ -105,6 +111,25 @@ type GroupNoticeUpdateReq {
 	Content       string `json:"content"`
 	GroupNoticeId string `json:"groupNoticeId"`
 }
+=======
+
+type ReadWithdrawReq {
+	MessageId string `json:"messageId"`
+	Appid     string `header:"appid"`
+	NewUserId int64  `header:"newUserId,optional"`
+	EntUserId int64  `header:"entUserId,optional"`
+	UserType  int64  `json:"userType"`
+}
+
+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"`
+}
+
+>>>>>>> master
 service messagecenter-api {
 	@handler messageCount
 	post /message/messageCount (CountReq) returns (CommonRes);
@@ -122,6 +147,7 @@ service messagecenter-api {
 	post /message/obtainShunt (ShuntReq) returns (CommonRes);
 	@handler updateReadById
 	post /message/updateReadById (ReadStateReq) returns (CommonRes);
+<<<<<<< HEAD
 	@handler chatGroupList
 	post /message/chatGroupList (ChatGroupListReq) returns (CommonRes);
 	@handler chatGroupAdd
@@ -138,4 +164,12 @@ service messagecenter-api {
 	post /message/groupNoticeUpdate (GroupNoticeUpdateReq) returns (CommonRes);
 	@handler groupNoticeGet
 	post /message/groupNoticeGet (ChatGroupPersonReq) returns (CommonRes);
+=======
+	@handler withdrawMessage //撤回消息
+	post /message/withdrawMessage (ReadWithdrawReq) returns (CommonRes);
+	@handler AppraiseMessage // 消息评价
+	post /message/appraiseMessage (AppraiseMessageReq) returns (CommonRes);
+	@handler ConversationList // 会话列表
+	post /message/conversationList (UserReq) returns (CommonRes);
+>>>>>>> master
 }

+ 80 - 1
entity/util.go

@@ -5,6 +5,7 @@ import (
 	"app.yhyue.com/moapp/jybase/redis"
 	"encoding/json"
 	"fmt"
+<<<<<<< HEAD
 	"strings"
 )
 
@@ -23,6 +24,21 @@ const (
 	ENTNICHE_USER = "entniche_user"
 	//mongo
 	ENTNICHE_DELETE = "entniche_delete"
+=======
+	"reflect"
+	"sort"
+)
+
+const (
+	Date_Full_Layout          = "2006-01-02 15:04:05"
+	SOCIALIZE_CHAT_SESSION    = "socialize_chat_session"
+	SOCIALIZE_MESSAGE         = "socialize_message"
+	SOCIALIZE_MESSAGE_MAILBOX = "socialize_message_mailbox"
+	SOCIALIZE_TENANT_ROBOT    = "socialize_tenant_robot"
+	BASE_USER                 = "base_user"
+	SOCIALIZE_APPRAISE        = "socialize_message_appraise"
+	User_message_list         = "user_message_list"
+>>>>>>> master
 )
 const (
 	SUCCESS_CODE = int64(0)
@@ -37,7 +53,7 @@ func SafeConvert2String(obj interface{}) string {
 	return ""
 }
 
-//in数据处理
+// in数据处理
 func Inhandle(data *[]map[string]interface{}) (messId string) {
 	if len(*data) == 0 {
 		messId = "''"
@@ -79,6 +95,7 @@ func SetData(userType int64, userId int64, data map[string]interface{}, survival
 	redis.Put(redisModule, todayKey(userType, userId), data, survivalTime)
 }
 
+<<<<<<< HEAD
 func IntJoin(elems []int64, sep string) string {
 	switch len(elems) {
 	case 0:
@@ -95,4 +112,66 @@ func IntJoin(elems []int64, sep string) string {
 		b.WriteString(quitl.InterfaceToStr(s))
 	}
 	return b.String()
+=======
+// 排序 排序键必须为数字类型
+type SortBy struct {
+	Data    []map[string]interface{}
+	Sortkey string
+}
+
+func (a SortBy) Len() int { return len(a.Data) }
+
+func (a SortBy) Swap(i, j int) {
+	a.Data[i], a.Data[j] = a.Data[j], a.Data[i]
+}
+
+func (a SortBy) Less(i, j int) bool {
+	//return Float64(a.Data[i][a.Sortkey]) < Float64(a.Data[j][a.Sortkey])
+	m := a.Data[i][a.Sortkey]
+	n := a.Data[j][a.Sortkey]
+	w := reflect.ValueOf(m)
+	v := reflect.ValueOf(n)
+	switch v.Kind() {
+	case reflect.String:
+		return w.String() < v.String()
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		return w.Int() < v.Int()
+	case reflect.Float64, reflect.Float32:
+		return w.Float() < v.Float()
+	default:
+		return fmt.Sprintf("%v", w) < fmt.Sprintf("%v", v)
+	}
+}
+
+// 根据指定字符排序
+//
+//	m := []map[string]int{
+//	   {"k": 2},
+//	   {"k": 1},
+//	   {"k": 3},
+//	}
+//
+// customer.SortData(&m, "k", true)
+// ture  倒序3, 2, 1
+// fmt.Println(m)
+func SortData(data interface{}, sortkey string, reverse bool) {
+	//func SortData(data interface{}, sortkey string, reverse bool) {
+	var db []map[string]interface{}
+	err := quitl.Bind(data, &db)
+	if err != nil {
+		fmt.Println(err)
+		return
+	}
+	stb := SortBy{db, sortkey}
+	if !reverse {
+		sort.Sort(stb)
+	} else {
+		sort.Sort(sort.Reverse(stb))
+	}
+	err = quitl.Bind(stb.Data, data)
+	if err != nil {
+		fmt.Println(err)
+	}
+
+>>>>>>> master
 }

+ 8 - 0
go.mod

@@ -6,8 +6,16 @@ require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
 	app.yhyue.com/moapp/jypkg v0.0.0-20230407092858-0d6d33fa63d6
 	bp.jydev.jianyu360.cn/BaseService/gateway v1.3.4
+<<<<<<< HEAD
 	github.com/go-sql-driver/mysql v1.7.0
 	github.com/zeromicro/go-zero v1.4.4
 	google.golang.org/grpc v1.53.0
 	google.golang.org/protobuf v1.28.1
+=======
+	github.com/go-sql-driver/mysql v1.6.0
+	github.com/microcosm-cc/bluemonday v1.0.23
+	github.com/zeromicro/go-zero v1.3.5
+	google.golang.org/grpc v1.47.0
+	google.golang.org/protobuf v1.28.0
+>>>>>>> master
 )

+ 68 - 0
go.sum

@@ -26,7 +26,10 @@ bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230210052334-7b32c3b
 bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230222052351-9d6fad062447/go.mod h1:5nimT8GJh46AyfeeDeyRlDQygMlO7TRM8Pwm41Gxemc=
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220418005748-8ba5d936dd53/go.mod h1:E5lcDI3k4FESLxiAetCfWQTq8qfpy9cv0yN1oKoEO34=
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220419023723-0b32d4a41751/go.mod h1:6KL5LMEku83uRbre0W/bj5kXG2I6pJGBFtktmtp51yM=
+<<<<<<< HEAD
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220419063004-233fc7ce006c/go.mod h1:6KL5LMEku83uRbre0W/bj5kXG2I6pJGBFtktmtp51yM=
+=======
+>>>>>>> master
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220420075831-0b59892e9982/go.mod h1:wsHNO91h37H+xE4ZNny0yd7mtpODeDJxbVYhIRMR+qw=
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.3/go.mod h1:Z353aucNO5hH4ZYjeKST3kE1PN3W8/uPc4J8s0Upz40=
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.4/go.mod h1:rRiGzKG4F/fmkNxXQCxrkxNWc8yf1SmW8qWCKfGIQSM=
@@ -481,7 +484,12 @@ github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb
 github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
 github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
 github.com/aws/aws-sdk-go v1.35.20/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k=
+<<<<<<< HEAD
 github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
+=======
+github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
+github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
+>>>>>>> master
 github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
 github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
@@ -810,10 +818,15 @@ github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3i
 github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU=
 github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw=
 github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA=
+<<<<<<< HEAD
 github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
 github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
 github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
 github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
+=======
+github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
+github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
+>>>>>>> master
 github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
 github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
 github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
@@ -1013,7 +1026,12 @@ github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
+<<<<<<< HEAD
 github.com/memcachier/mc v2.0.1+incompatible/go.mod h1:7bkvFE61leUBvXz+yxsOnGBQSZpBSPIMUQSmmSHvuXc=
+=======
+github.com/microcosm-cc/bluemonday v1.0.23 h1:SMZe2IGa0NuHvnVNAZ+6B38gsTbi5e4sViiWJyDDqFY=
+github.com/microcosm-cc/bluemonday v1.0.23/go.mod h1:mN70sk7UkkF8TUr2IGBpNN0jAgStuPzlK76QuruE/z4=
+>>>>>>> master
 github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
 github.com/mkevac/debugcharts v0.0.0-20191222103121-ae1c48aa8615/go.mod h1:Ad7oeElCZqA1Ufj0U9/liOF4BtVepxRcTvr2ey7zTvM=
 github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
@@ -1231,7 +1249,10 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
 github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
+<<<<<<< HEAD
 github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
+=======
+>>>>>>> master
 github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
 github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
 github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ=
@@ -1373,12 +1394,18 @@ golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPh
 golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
+<<<<<<< HEAD
 golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
 golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+=======
+golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+>>>>>>> master
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -1414,10 +1441,15 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+<<<<<<< HEAD
 golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
 golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+=======
+golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+>>>>>>> master
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1472,6 +1504,7 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx
 golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+<<<<<<< HEAD
 golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
@@ -1486,6 +1519,13 @@ golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfS
 golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
 golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw=
 golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
+=======
+golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
+golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
+golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
+>>>>>>> master
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -1525,9 +1565,13 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+<<<<<<< HEAD
 golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+=======
+golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+>>>>>>> master
 golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
 golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -1623,6 +1667,7 @@ golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+<<<<<<< HEAD
 golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -1635,13 +1680,26 @@ golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
 golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+=======
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+>>>>>>> master
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+<<<<<<< HEAD
 golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
 golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg=
 golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
+=======
+golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
+golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
+golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
+>>>>>>> master
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1652,11 +1710,17 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2/go.mod h1:EFNZuWvGYxIRUEX+K8UmCFwYmZjqcrnq15ZuVldZkZ0=
+<<<<<<< HEAD
 golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
 golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k=
 golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+=======
+golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
+golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+>>>>>>> master
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1740,9 +1804,13 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+<<<<<<< HEAD
 golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
 golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+=======
+golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
+>>>>>>> master
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

+ 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
+}

+ 59 - 0
rpc/messagecenter/internal/logic/conversationlistlogic.go

@@ -0,0 +1,59 @@
+package logic
+
+import (
+	quitl "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service"
+	"context"
+	"time"
+
+	"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 ConversationListLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewConversationListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ConversationListLogic {
+	return &ConversationListLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 用户会话列表查询
+func (l *ConversationListLogic) ConversationList(in *messagecenter.ConversationReq) (*messagecenter.UserResp, error) {
+	// todo: add your logic here and delete this line
+	m := service.MessaggeService{}
+	data, count, err := m.ConversationList(in)
+	if err != nil {
+		return nil, err
+	}
+	var result = []*messagecenter.UserEntity{}
+	if data != nil && len(*data) > 0 {
+		for _, v := range *data {
+			tim, _ := time.ParseInLocation(util.Date_Full_Layout, quitl.InterfaceToStr(v["create_time"]), time.Local)
+			userResp := messagecenter.UserEntity{
+				Name:       quitl.ObjToString(v["name"]),
+				Title:      quitl.ObjToString(v["title"]),
+				Type:       quitl.Int64All(v["type"]),
+				Link:       quitl.ObjToString(v["link"]),
+				Content:    quitl.ObjToString(v["content"]),
+				CreateTime: tim.Unix(),
+				UserType:   quitl.Int64All(v["userType"]),
+				Number:     quitl.Int64All(v["number"]),
+				UserId:     encrypt.SE.Encode2Hex(quitl.InterfaceToStr(v["id"])),
+				Headimg:    quitl.ObjToString(v["headimg"]),
+			}
+			result = append(result, &userResp)
+		}
+	}
+	return &messagecenter.UserResp{Data: result, Count: count}, nil
+}

+ 20 - 17
rpc/messagecenter/internal/logic/findmessagelogic.go

@@ -33,24 +33,27 @@ func (l *FindMessageLogic) FindMessage(in *messagecenter.MessageReq) (*messagece
 	m := service.MessaggeService{}
 	data := m.FindMessage(in)
 	list := []*messagecenter.MessageEntity{}
-	for _, v := range *data {
-		tim, _ := time.ParseInLocation(util.Date_Full_Layout, quitl.InterfaceToStr(v["create_time"]), time.Local)
-		messageEntity := messagecenter.MessageEntity{
-			Title:      quitl.ObjToString(v["title"]),
-			Content:    quitl.ObjToString(v["content"]),
-			CreateTime: tim.Unix(),
-			Item:       quitl.Int64All(v["item"]),
-			Type:       quitl.Int64All(v["type"]),
-			Link:       quitl.ObjToString(v["link"]),
-			Fool:       quitl.Int64All(v["fool"]),
-			ItemType:   quitl.Int64All(v["itemType"]),
-			RobotName:  quitl.ObjToString(v["robotName"]),
-			RobotImg:   quitl.ObjToString(v["robotImg"]),
-			SetName:    quitl.ObjToString(v["setName"]),
-			OwnImg:     quitl.ObjToString(v["ownImg"]),
-			MessageId:  encrypt.SE.Encode2Hex(quitl.InterfaceToStr(v["messageId"])),
+	if data != nil && len(*data) > 0 {
+		for _, v := range *data {
+			tim, _ := time.ParseInLocation(util.Date_Full_Layout, quitl.InterfaceToStr(v["create_time"]), time.Local)
+			messageEntity := messagecenter.MessageEntity{
+				Title:      quitl.ObjToString(v["title"]),
+				Content:    quitl.ObjToString(v["content"]),
+				CreateTime: tim.Unix(),
+				Item:       quitl.Int64All(v["item"]),
+				Type:       quitl.Int64All(v["type"]),
+				Link:       quitl.ObjToString(v["link"]),
+				Fool:       quitl.Int64All(v["fool"]),
+				ItemType:   quitl.Int64All(v["itemType"]),
+				RobotName:  quitl.ObjToString(v["robotName"]),
+				RobotImg:   quitl.ObjToString(v["robotImg"]),
+				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)
 		}
-		list = append(list, &messageEntity)
 	}
 	return &messagecenter.MessageResp{
 		Data:      list,

+ 18 - 16
rpc/messagecenter/internal/logic/userlistlogic.go

@@ -32,26 +32,28 @@ func NewUserListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserList
 func (l *UserListLogic) UserList(in *messagecenter.UserReq) (*messagecenter.UserResp, error) {
 	// todo: add your logic here and delete this line
 	m := service.MessaggeService{}
-	data, err := m.UserList(in)
+	data, count, err := m.UserList(in)
 	if err != nil {
 		return nil, err
 	}
 	var result = []*messagecenter.UserEntity{}
-	for _, v := range *data {
-		tim, _ := time.ParseInLocation(util.Date_Full_Layout, quitl.InterfaceToStr(v["create_time"]), time.Local)
-		userResp := messagecenter.UserEntity{
-			Name:       quitl.ObjToString(v["name"]),
-			Title:      quitl.ObjToString(v["title"]),
-			Type:       quitl.Int64All(v["type"]),
-			Link:       quitl.ObjToString(v["link"]),
-			Content:    quitl.ObjToString(v["content"]),
-			CreateTime: tim.Unix(),
-			UserType:   quitl.Int64All(v["userType"]),
-			Number:     quitl.Int64All(v["number"]),
-			UserId:     encrypt.SE.Encode2Hex(quitl.InterfaceToStr(v["id"])),
-			Headimg:    quitl.ObjToString(v["headimg"]),
+	if data != nil && len(*data) > 0 {
+		for _, v := range *data {
+			tim, _ := time.ParseInLocation(util.Date_Full_Layout, quitl.InterfaceToStr(v["create_time"]), time.Local)
+			userResp := messagecenter.UserEntity{
+				Name:       quitl.ObjToString(v["name"]),
+				Title:      quitl.ObjToString(v["title"]),
+				Type:       quitl.Int64All(v["type"]),
+				Link:       quitl.ObjToString(v["link"]),
+				Content:    quitl.ObjToString(v["content"]),
+				CreateTime: tim.Unix(),
+				UserType:   quitl.Int64All(v["userType"]),
+				Number:     quitl.Int64All(v["number"]),
+				UserId:     encrypt.SE.Encode2Hex(quitl.InterfaceToStr(v["id"])),
+				Headimg:    quitl.ObjToString(v["headimg"]),
+			}
+			result = append(result, &userResp)
 		}
-		result = append(result, &userResp)
 	}
-	return &messagecenter.UserResp{Data: result}, nil
+	return &messagecenter.UserResp{Data: result, Count: count}, nil
 }

+ 40 - 0
rpc/messagecenter/internal/logic/withdrawmessagelogic.go

@@ -0,0 +1,40 @@
+package logic
+
+import (
+	util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
+	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service"
+	"context"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type WithdrawMessageLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewWithdrawMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WithdrawMessageLogic {
+	return &WithdrawMessageLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 用户撤回消息
+func (l *WithdrawMessageLogic) WithdrawMessage(in *messagecenter.ReadWithdrawReq) (*messagecenter.CurrencyResp, error) {
+	// todo: add your logic here and delete this line
+	m := service.MessaggeService{}
+	errorCode := m.WithdrawMessage(in)
+	if !errorCode {
+		return &messagecenter.CurrencyResp{
+			ErrorCode: util.ERROR_CODE,
+			ErrorMsg:  "撤回消息失败",
+		}, nil
+	}
+	return &messagecenter.CurrencyResp{ErrorCode: util.SUCCESS_CODE,
+		ErrorMsg: "撤回消息成功"}, nil
+}

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

@@ -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)
@@ -70,6 +70,7 @@ func (s *MessageCenterServer) UpdateReadById(ctx context.Context, in *messagecen
 	return l.UpdateReadById(in)
 }
 
+<<<<<<< HEAD
 // 群组列表查询
 func (s *MessageCenterServer) ChatGroupList(ctx context.Context, in *messagecenter.ChatGroupListReq) (*messagecenter.ChatGroupListResp, error) {
 	l := logic.NewChatGroupListLogic(ctx, s.svcCtx)
@@ -122,4 +123,22 @@ func (s *MessageCenterServer) GroupNoticeGet(ctx context.Context, in *messagecen
 func (s *MessageCenterServer) EntPersonsList(ctx context.Context, in *messagecenter.EntPersonsListReq) (*messagecenter.EntPersonListResp, error) {
 	l := logic.NewEntPersonsListLogic(ctx, s.svcCtx)
 	return l.EntPersonsList(in)
+=======
+// 用户撤回消息
+func (s *MessageCenterServer) WithdrawMessage(ctx context.Context, in *messagecenter.ReadWithdrawReq) (*messagecenter.CurrencyResp, error) {
+	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)
+}
+
+// 客服列表查询
+func (s *MessageCenterServer) ConversationList(ctx context.Context, in *messagecenter.ConversationReq) (*messagecenter.UserResp, error) {
+	l := logic.NewConversationListLogic(ctx, s.svcCtx)
+	return l.ConversationList(in)
+>>>>>>> master
 }

+ 0 - 1
rpc/messagecenter/messagecenter.go

@@ -26,7 +26,6 @@ func main() {
 		messagecenter.RegisterMessageCenterServer(grpcServer, srv)
 	})
 	defer s.Stop()
-
 	fmt.Printf("Starting rpc server at %s...\n", IC.C.ListenOn)
 	s.Start()
 }

+ 70 - 0
rpc/messagecenter/messagecenter.proto

@@ -21,11 +21,23 @@ message UserReq {
   int64     newUserId = 4;  //用户标识
   int64     userType = 5;  //用户类型:2用户1客服
   int64     entUserId = 6;  //企业标识
+  int64     page = 7;  //页
+  int64     size =8; //数
+  int64     isArtificial =9; //是否人工介入 1:人工介入 2:非让人工介入
+  string    filtrationId = 10; //客服列表过滤会话中派对中用户
+  int64  entId = 11;
 }
 message UserResp {
+<<<<<<< HEAD
   repeated UserEntity data = 1;
   int64 error_code = 2; //响应代码
   string error_msg = 3; //响应消息
+=======
+   repeated UserEntity data=1;
+   int64 error_code = 2; //响应代码
+   string error_msg = 3; //响应消息
+  int64 count = 4; //响应代码
+>>>>>>> master
 }
 message UserEntity {
   string userId = 1;
@@ -35,9 +47,16 @@ message UserEntity {
   string link = 5;
   string content = 6;
   int64 userType = 7;
+<<<<<<< HEAD
   int64 create_time = 8;
   int64 number = 9;
   string headimg = 11;
+=======
+  int64 create_time= 8;
+  int64 number= 9;
+  string headimg=11;
+  bool isOnline=12;
+>>>>>>> master
 }
 message MessageReq {
   int64         msgType = 1;     // 消息类型 ;1:站内信消息 2:点对点消息 3:群消息 4:机器人消息 5:客服消息
@@ -70,6 +89,7 @@ message MessageEntity {
   int64         type = 4;
   string        link = 5;
   int64         create_time = 6;
+<<<<<<< HEAD
   string        appid = 7;
   int64         itemType = 8;
   int64         sendId = 9;
@@ -83,6 +103,22 @@ message MessageEntity {
   int64         receiveId = 17;
   string        ownImg = 18;
   string        messageId = 19;
+=======
+  string        appid=7;
+  int64         itemType=8;
+  int64         sendId=9;
+  int64         entUserId=10;
+  int64         newUserId=16;
+  int64         own_type =11;//拥有者类型;1:用户 2:会话
+  int64         fool=12;
+  string        robotName=13;
+  string        robotImg=14;
+  string        setName=15;
+  int64         receiveId=17;
+  string        ownImg=18;
+  string        messageId=19;
+  int64         appraise=20;
+>>>>>>> master
 }
 
 message ChatSessionReq {
@@ -115,6 +151,21 @@ message ReadStateReq {
   int64         newUserId = 3;
 }
 
+message ReadWithdrawReq {
+  string        messageId = 1;
+  int64         entUserId = 2;
+  string        appid=3;
+  int64         newUserId = 4;
+  int64         userType=6;      //用户类型:2用户1客服
+}
+
+message AppraiseReq {
+  string        appid=1;
+  string        messageId = 2;
+  int64         newUserId = 3;
+  int64         appraise = 4;
+}
+
 message CurrencyResp {
   int64 error_code = 2; //响应代码
   string error_msg = 1; //响应消息
@@ -158,6 +209,7 @@ message ChatGroupPersonResp{
   int64         error_code = 2; //响应代码
   string        error_msg = 3; //响应消息
 }
+<<<<<<< HEAD
 message ChatGroupPersonList{
   repeated      ChatGroupPerson data = 1;
 }
@@ -223,6 +275,15 @@ message EntPersonListResp{
   string entName = 4;
 }
 
+=======
+
+message ConversationReq {
+  int64     newUserId = 4;  //用户标识
+  int64     userType=5;  //用户类型:2用户1客服
+  int64     entUserId = 6;  //企业标识
+  string    filtrationId = 10; //客服列表过滤会话中派对中用户
+}
+>>>>>>> master
 service messageCenter {
   // 查询数量
   rpc Count(CountReq) returns(CountResp);
@@ -240,6 +301,7 @@ service messageCenter {
   rpc SaveAutoReplyMsg(SaveAutoReplyReq)returns(MessageResp);
   //根据消息修改已读状态
   rpc UpdateReadById(ReadStateReq)returns(CurrencyResp);
+<<<<<<< HEAD
   //群组列表查询
   rpc ChatGroupList(ChatGroupListReq)returns(ChatGroupListResp);
   //群组新增
@@ -258,4 +320,12 @@ service messageCenter {
   rpc GroupNoticeGet(ChatGroupPersonReq)returns(GroupNoticeGetResp);
   //通讯录 -企业人员列表
   rpc EntPersonsList(EntPersonsListReq) returns(EntPersonListResp);
+=======
+  //用户撤回消息
+  rpc WithdrawMessage(ReadWithdrawReq)returns(CurrencyResp);
+  // 用户评价回复
+  rpc AppraiseMessage(AppraiseReq) returns(CurrencyResp);
+  // 客服列表查询
+  rpc ConversationList(ConversationReq) returns(UserResp);
+>>>>>>> master
 }

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

@@ -1,5 +1,9 @@
+<<<<<<< HEAD
 
 // Code generated by goctl. DO NOT EDIT.
+=======
+// Code generated by goctl. DO NOT EDIT!
+>>>>>>> master
 // Source: messagecenter.proto
 
 package messagecenter
@@ -29,6 +33,7 @@ type (
 		SaveAutoReplyMsg(ctx context.Context, in *SaveAutoReplyReq, opts ...grpc.CallOption) (*MessageResp, error)
 		// 根据消息修改已读状态
 		UpdateReadById(ctx context.Context, in *ReadStateReq, opts ...grpc.CallOption) (*CurrencyResp, error)
+<<<<<<< HEAD
 		// 群组列表查询
 		ChatGroupList(ctx context.Context, in *ChatGroupListReq, opts ...grpc.CallOption) (*ChatGroupListResp, error)
 		// 群组新增
@@ -48,6 +53,14 @@ type (
 		// 通讯录 -企业人员列表
 		EntPersonsList(ctx context.Context, in *EntPersonsListReq, opts ...grpc.CallOption) (*EntPersonListResp, error)
 
+=======
+		// 用户撤回消息
+		WithdrawMessage(ctx context.Context, in *ReadWithdrawReq, opts ...grpc.CallOption) (*CurrencyResp, error)
+		//  用户评价回复
+		AppraiseMessage(ctx context.Context, in *AppraiseReq, opts ...grpc.CallOption) (*CurrencyResp, error)
+		//  客服列表查询
+		ConversationList(ctx context.Context, in *ConversationReq, opts ...grpc.CallOption) (*UserResp, error)
+>>>>>>> master
 	}
 
 	defaultMessageCenter struct {
@@ -109,6 +122,7 @@ func (m *defaultMessageCenter) UpdateReadById(ctx context.Context, in *ReadState
 	return client.UpdateReadById(ctx, in, opts...)
 }
 
+<<<<<<< HEAD
 // 群组列表查询
 func (m *defaultMessageCenter) ChatGroupList(ctx context.Context, in *ChatGroupListReq, opts ...grpc.CallOption) (*ChatGroupListResp, error) {
 	client := NewMessageCenterClient(m.cli.Conn())
@@ -163,3 +177,22 @@ func (m *defaultMessageCenter) EntPersonsList(ctx context.Context, in *EntPerson
 	return client.EntPersonsList(ctx, in, opts...)
 }
 
+=======
+// 用户撤回消息
+func (m *defaultMessageCenter) WithdrawMessage(ctx context.Context, in *ReadWithdrawReq, opts ...grpc.CallOption) (*CurrencyResp, error) {
+	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...)
+}
+
+// 客服列表查询
+func (m *defaultMessageCenter) ConversationList(ctx context.Context, in *ConversationReq, opts ...grpc.CallOption) (*UserResp, error) {
+	client := NewMessageCenterClient(m.cli.Conn())
+	return client.ConversationList(ctx, in, opts...)
+}
+>>>>>>> master

+ 615 - 108
rpc/messagecenter/messagecenter/messagecenter.pb.go

@@ -1,6 +1,10 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
+<<<<<<< HEAD
 // 	protoc-gen-go v1.28.0
+=======
+// 	protoc-gen-go v1.28.1
+>>>>>>> master
 // 	protoc        v3.19.4
 // source: messagecenter.proto
 
@@ -159,12 +163,17 @@ type UserReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Phone     string `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"`
-	StartTime string `protobuf:"bytes,2,opt,name=startTime,proto3" json:"startTime,omitempty"`
-	EndTime   string `protobuf:"bytes,3,opt,name=endTime,proto3" json:"endTime,omitempty"`
-	NewUserId int64  `protobuf:"varint,4,opt,name=newUserId,proto3" json:"newUserId,omitempty"` //用户标识
-	UserType  int64  `protobuf:"varint,5,opt,name=userType,proto3" json:"userType,omitempty"`   //用户类型:2用户1客服
-	EntUserId int64  `protobuf:"varint,6,opt,name=entUserId,proto3" json:"entUserId,omitempty"` //企业标识
+	Phone        string `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"`
+	StartTime    string `protobuf:"bytes,2,opt,name=startTime,proto3" json:"startTime,omitempty"`
+	EndTime      string `protobuf:"bytes,3,opt,name=endTime,proto3" json:"endTime,omitempty"`
+	NewUserId    int64  `protobuf:"varint,4,opt,name=newUserId,proto3" json:"newUserId,omitempty"`       //用户标识
+	UserType     int64  `protobuf:"varint,5,opt,name=userType,proto3" json:"userType,omitempty"`         //用户类型:2用户1客服
+	EntUserId    int64  `protobuf:"varint,6,opt,name=entUserId,proto3" json:"entUserId,omitempty"`       //企业标识
+	Page         int64  `protobuf:"varint,7,opt,name=page,proto3" json:"page,omitempty"`                 //页
+	Size         int64  `protobuf:"varint,8,opt,name=size,proto3" json:"size,omitempty"`                 //数
+	IsArtificial int64  `protobuf:"varint,9,opt,name=isArtificial,proto3" json:"isArtificial,omitempty"` //是否人工介入 1:人工介入 2:非让人工介入
+	FiltrationId string `protobuf:"bytes,10,opt,name=filtrationId,proto3" json:"filtrationId,omitempty"` //客服列表过滤会话中派对中用户
+	EntId        int64  `protobuf:"varint,11,opt,name=entId,proto3" json:"entId,omitempty"`
 }
 
 func (x *UserReq) Reset() {
@@ -241,6 +250,41 @@ func (x *UserReq) GetEntUserId() int64 {
 	return 0
 }
 
+func (x *UserReq) GetPage() int64 {
+	if x != nil {
+		return x.Page
+	}
+	return 0
+}
+
+func (x *UserReq) GetSize() int64 {
+	if x != nil {
+		return x.Size
+	}
+	return 0
+}
+
+func (x *UserReq) GetIsArtificial() int64 {
+	if x != nil {
+		return x.IsArtificial
+	}
+	return 0
+}
+
+func (x *UserReq) GetFiltrationId() string {
+	if x != nil {
+		return x.FiltrationId
+	}
+	return ""
+}
+
+func (x *UserReq) GetEntId() int64 {
+	if x != nil {
+		return x.EntId
+	}
+	return 0
+}
+
 type UserResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -249,6 +293,7 @@ type UserResp struct {
 	Data      []*UserEntity `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
 	ErrorCode int64         `protobuf:"varint,2,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"`     //响应消息
+	Count     int64         `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"`                          //响应代码
 }
 
 func (x *UserResp) Reset() {
@@ -304,6 +349,13 @@ func (x *UserResp) GetErrorMsg() string {
 	return ""
 }
 
+func (x *UserResp) GetCount() int64 {
+	if x != nil {
+		return x.Count
+	}
+	return 0
+}
+
 type UserEntity struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -319,6 +371,7 @@ type UserEntity struct {
 	CreateTime int64  `protobuf:"varint,8,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
 	Number     int64  `protobuf:"varint,9,opt,name=number,proto3" json:"number,omitempty"`
 	Headimg    string `protobuf:"bytes,11,opt,name=headimg,proto3" json:"headimg,omitempty"`
+	IsOnline   bool   `protobuf:"varint,12,opt,name=isOnline,proto3" json:"isOnline,omitempty"`
 }
 
 func (x *UserEntity) Reset() {
@@ -423,6 +476,13 @@ func (x *UserEntity) GetHeadimg() string {
 	return ""
 }
 
+func (x *UserEntity) GetIsOnline() bool {
+	if x != nil {
+		return x.IsOnline
+	}
+	return false
+}
+
 type MessageReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -708,6 +768,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() {
@@ -875,6 +936,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
@@ -1222,6 +1290,156 @@ func (x *ReadStateReq) GetNewUserId() int64 {
 	return 0
 }
 
+type ReadWithdrawReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	MessageId string `protobuf:"bytes,1,opt,name=messageId,proto3" json:"messageId,omitempty"`
+	EntUserId int64  `protobuf:"varint,2,opt,name=entUserId,proto3" json:"entUserId,omitempty"`
+	Appid     string `protobuf:"bytes,3,opt,name=appid,proto3" json:"appid,omitempty"`
+	NewUserId int64  `protobuf:"varint,4,opt,name=newUserId,proto3" json:"newUserId,omitempty"`
+	UserType  int64  `protobuf:"varint,6,opt,name=userType,proto3" json:"userType,omitempty"` //用户类型:2用户1客服
+}
+
+func (x *ReadWithdrawReq) Reset() {
+	*x = ReadWithdrawReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_messagecenter_proto_msgTypes[14]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ReadWithdrawReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ReadWithdrawReq) ProtoMessage() {}
+
+func (x *ReadWithdrawReq) ProtoReflect() protoreflect.Message {
+	mi := &file_messagecenter_proto_msgTypes[14]
+	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 ReadWithdrawReq.ProtoReflect.Descriptor instead.
+func (*ReadWithdrawReq) Descriptor() ([]byte, []int) {
+	return file_messagecenter_proto_rawDescGZIP(), []int{14}
+}
+
+func (x *ReadWithdrawReq) GetMessageId() string {
+	if x != nil {
+		return x.MessageId
+	}
+	return ""
+}
+
+func (x *ReadWithdrawReq) GetEntUserId() int64 {
+	if x != nil {
+		return x.EntUserId
+	}
+	return 0
+}
+
+func (x *ReadWithdrawReq) GetAppid() string {
+	if x != nil {
+		return x.Appid
+	}
+	return ""
+}
+
+func (x *ReadWithdrawReq) GetNewUserId() int64 {
+	if x != nil {
+		return x.NewUserId
+	}
+	return 0
+}
+
+func (x *ReadWithdrawReq) GetUserType() int64 {
+	if x != nil {
+		return x.UserType
+	}
+	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
@@ -1234,7 +1452,11 @@ type CurrencyResp struct {
 func (x *CurrencyResp) Reset() {
 	*x = CurrencyResp{}
 	if protoimpl.UnsafeEnabled {
+<<<<<<< HEAD
 		mi := &file_messagecenter_proto_msgTypes[14]
+=======
+		mi := &file_messagecenter_proto_msgTypes[16]
+>>>>>>> master
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -1247,7 +1469,11 @@ func (x *CurrencyResp) String() string {
 func (*CurrencyResp) ProtoMessage() {}
 
 func (x *CurrencyResp) ProtoReflect() protoreflect.Message {
+<<<<<<< HEAD
 	mi := &file_messagecenter_proto_msgTypes[14]
+=======
+	mi := &file_messagecenter_proto_msgTypes[16]
+>>>>>>> master
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -1260,7 +1486,11 @@ func (x *CurrencyResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use CurrencyResp.ProtoReflect.Descriptor instead.
 func (*CurrencyResp) Descriptor() ([]byte, []int) {
+<<<<<<< HEAD
 	return file_messagecenter_proto_rawDescGZIP(), []int{14}
+=======
+	return file_messagecenter_proto_rawDescGZIP(), []int{16}
+>>>>>>> master
 }
 
 func (x *CurrencyResp) GetErrorCode() int64 {
@@ -1277,11 +1507,16 @@ func (x *CurrencyResp) GetErrorMsg() string {
 	return ""
 }
 
+<<<<<<< HEAD
 type ChatGroupListReq struct {
+=======
+type ConversationReq struct {
+>>>>>>> master
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
+<<<<<<< HEAD
 	EntId      int64  `protobuf:"varint,1,opt,name=entId,proto3" json:"entId,omitempty"`
 	UserName   string `protobuf:"bytes,2,opt,name=userName,proto3" json:"userName,omitempty"`
 	GroupName  string `protobuf:"bytes,3,opt,name=groupName,proto3" json:"groupName,omitempty"`
@@ -1432,6 +1667,16 @@ type ChatGroupList struct {
 
 func (x *ChatGroupList) Reset() {
 	*x = ChatGroupList{}
+=======
+	NewUserId    int64  `protobuf:"varint,4,opt,name=newUserId,proto3" json:"newUserId,omitempty"`       //用户标识
+	UserType     int64  `protobuf:"varint,5,opt,name=userType,proto3" json:"userType,omitempty"`         //用户类型:2用户1客服
+	EntUserId    int64  `protobuf:"varint,6,opt,name=entUserId,proto3" json:"entUserId,omitempty"`       //企业标识
+	FiltrationId string `protobuf:"bytes,10,opt,name=filtrationId,proto3" json:"filtrationId,omitempty"` //客服列表过滤会话中派对中用户
+}
+
+func (x *ConversationReq) Reset() {
+	*x = ConversationReq{}
+>>>>>>> master
 	if protoimpl.UnsafeEnabled {
 		mi := &file_messagecenter_proto_msgTypes[17]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -1439,6 +1684,7 @@ func (x *ChatGroupList) Reset() {
 	}
 }
 
+<<<<<<< HEAD
 func (x *ChatGroupList) String() string {
 	return protoimpl.X.MessageStringOf(x)
 }
@@ -1446,6 +1692,15 @@ func (x *ChatGroupList) String() string {
 func (*ChatGroupList) ProtoMessage() {}
 
 func (x *ChatGroupList) ProtoReflect() protoreflect.Message {
+=======
+func (x *ConversationReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ConversationReq) ProtoMessage() {}
+
+func (x *ConversationReq) ProtoReflect() protoreflect.Message {
+>>>>>>> master
 	mi := &file_messagecenter_proto_msgTypes[17]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -1457,6 +1712,7 @@ func (x *ChatGroupList) ProtoReflect() protoreflect.Message {
 	return mi.MessageOf(x)
 }
 
+<<<<<<< HEAD
 // Deprecated: Use ChatGroupList.ProtoReflect.Descriptor instead.
 func (*ChatGroupList) Descriptor() ([]byte, []int) {
 	return file_messagecenter_proto_rawDescGZIP(), []int{17}
@@ -1613,10 +1869,21 @@ func (x *CommonReq) GetStatus() bool {
 func (x *CommonReq) GetErrorCode() int64 {
 	if x != nil {
 		return x.ErrorCode
+=======
+// Deprecated: Use ConversationReq.ProtoReflect.Descriptor instead.
+func (*ConversationReq) Descriptor() ([]byte, []int) {
+	return file_messagecenter_proto_rawDescGZIP(), []int{17}
+}
+
+func (x *ConversationReq) GetNewUserId() int64 {
+	if x != nil {
+		return x.NewUserId
+>>>>>>> master
 	}
 	return 0
 }
 
+<<<<<<< HEAD
 func (x *CommonReq) GetErrorMsg() string {
 	if x != nil {
 		return x.ErrorMsg
@@ -1669,17 +1936,29 @@ func (*ChatGroupPersonReq) Descriptor() ([]byte, []int) {
 func (x *ChatGroupPersonReq) GetChatGroupId() int64 {
 	if x != nil {
 		return x.ChatGroupId
+=======
+func (x *ConversationReq) GetUserType() int64 {
+	if x != nil {
+		return x.UserType
+>>>>>>> master
 	}
 	return 0
 }
 
+<<<<<<< HEAD
 func (x *ChatGroupPersonReq) GetEntId() int64 {
 	if x != nil {
 		return x.EntId
+=======
+func (x *ConversationReq) GetEntUserId() int64 {
+	if x != nil {
+		return x.EntUserId
+>>>>>>> master
 	}
 	return 0
 }
 
+<<<<<<< HEAD
 func (x *ChatGroupPersonReq) GetAppId() string {
 	if x != nil {
 		return x.AppId
@@ -2527,6 +2806,11 @@ func (x *EntPersonListResp) GetData() []*DepartmentsInfo {
 func (x *EntPersonListResp) GetEntName() string {
 	if x != nil {
 		return x.EntName
+=======
+func (x *ConversationReq) GetFiltrationId() string {
+	if x != nil {
+		return x.FiltrationId
+>>>>>>> master
 	}
 	return ""
 }
@@ -2552,7 +2836,7 @@ var file_messagecenter_proto_rawDesc = []byte{
 	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, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
-	0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x22, 0xaf, 0x01, 0x0a, 0x07, 0x55, 0x73, 0x65,
+	0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x22, 0xb5, 0x02, 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,
@@ -2563,108 +2847,124 @@ var file_messagecenter_proto_rawDesc = []byte{
 	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, 0x12, 0x1c, 0x0a, 0x09,
 	0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x75, 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, 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, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73,
-	0x67, 0x22, 0xff, 0x01, 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, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
-	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05,
-	0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74,
-	0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
-	0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e,
-	0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65,
-	0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65,
-	0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
-	0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
-	0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x61,
-	0x64, 0x69, 0x6d, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64,
-	0x69, 0x6d, 0x67, 0x22, 0x9a, 0x02, 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, 0x16, 0x0a, 0x06, 0x4c, 0x61, 0x73, 0x74,
-	0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x49, 0x64,
-	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, 0x16, 0x0a, 0x06,
-	0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x65,
-	0x6e, 0x64, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49,
-	0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72,
-	0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18,
-	0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64,
-	0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d,
-	0x65, 0x72, 0x45, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63,
-	0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04,
-	0x73, 0x6f, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74,
-	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, 0x95, 0x01, 0x0a, 0x0f, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e,
-	0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30,
-	0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d,
-	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
-	0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
-	0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x22, 0xf9, 0x03, 0x0a,
-	0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x14,
-	0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74,
-	0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18,
-	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12,
-	0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x69, 0x74,
-	0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72,
-	0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61,
-	0x70, 0x70, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69,
-	0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a,
-	0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73,
-	0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72,
-	0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65,
-	0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64,
-	0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49,
-	0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04,
-	0x66, 0x6f, 0x6f, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66, 0x6f, 0x6f, 0x6c,
-	0x12, 0x1c, 0x0a, 0x09, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0d, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a,
-	0x0a, 0x08, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x49, 0x6d, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x08, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x49, 0x6d, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65,
-	0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x74,
-	0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49,
-	0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
-	0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x67, 0x18, 0x12, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x06, 0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65,
-	0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 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,
+	0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61,
+	0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12,
+	0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69,
+	0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x73, 0x41, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x69,
+	0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x69, 0x73, 0x41, 0x72, 0x74, 0x69,
+	0x66, 0x69, 0x63, 0x69, 0x61, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x69, 0x6c, 0x74, 0x72, 0x61,
+	0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x69,
+	0x6c, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e,
+	0x74, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64,
+	0x22, 0x8b, 0x01, 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, 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, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
+	0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e,
+	0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x9b,
+	0x02, 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, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74,
+	0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12,
+	0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74,
+	0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
+	0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
+	0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a,
+	0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16,
+	0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
+	0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x69, 0x6d,
+	0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x69, 0x6d, 0x67,
+	0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x0c, 0x20, 0x01,
+	0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x9a, 0x02, 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, 0x16, 0x0a, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x49, 0x64, 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, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18,
+	0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1c, 0x0a,
+	0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65,
+	0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
+	0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74,
+	0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12,
+	0x24, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x49, 0x64,
+	0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
+	0x45, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x0a, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 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, 0x95, 0x01,
+	0x0a, 0x0f, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63,
+	0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74,
+	0x69, 0x74, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72,
+	0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65,
+	0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f,
+	0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72,
+	0x6f, 0x72, 0x4d, 0x73, 0x67, 0x22, 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, 0x09, 0x52, 0x07,
+	0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18,
+	0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x74,
+	0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12,
+	0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c,
+	0x69, 0x6e, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69,
+	0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+	0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x07, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x74,
+	0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x74,
+	0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64,
+	0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1c,
+	0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09,
+	0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x77,
+	0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6f, 0x77,
+	0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6f, 0x6f, 0x6c, 0x18, 0x0c, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x04, 0x66, 0x6f, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x6f, 0x62,
+	0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x6f,
+	0x62, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x62, 0x6f, 0x74,
+	0x49, 0x6d, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x62, 0x6f, 0x74,
+	0x49, 0x6d, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0f,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a,
+	0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f,
+	0x77, 0x6e, 0x49, 0x6d, 0x67, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x77, 0x6e,
+	0x49, 0x6d, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64,
+	0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 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,
+<<<<<<< HEAD
 	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,
@@ -2939,6 +3239,124 @@ var file_messagecenter_proto_rawDesc = []byte{
 	0x4c, 0x69, 0x73, 0x74, 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,
+=======
+	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, 0x9d, 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, 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, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
+	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x1c, 0x0a,
+	0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 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, 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,
+	0x22, 0x8d, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
+	0x6e, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49,
+	0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72,
+	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, 0x12, 0x1c,
+	0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c,
+	0x66, 0x69, 0x6c, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x0c, 0x66, 0x69, 0x6c, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64,
+	0x32, 0xc9, 0x06, 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, 0x12,
+	0x4b, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c,
+	0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x63, 0x65, 0x6e,
+	0x74, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+	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, 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,
+>>>>>>> master
 }
 
 var (
@@ -2953,6 +3371,7 @@ func file_messagecenter_proto_rawDescGZIP() []byte {
 	return file_messagecenter_proto_rawDescData
 }
 
+<<<<<<< HEAD
 var file_messagecenter_proto_msgTypes = make([]protoimpl.MessageInfo, 35)
 var file_messagecenter_proto_goTypes = []interface{}{
 	(*CountReq)(nil),             // 0: messagecenter.CountReq
@@ -2990,12 +3409,35 @@ var file_messagecenter_proto_goTypes = []interface{}{
 	(*DepartmentsInfo)(nil),      // 32: messagecenter.departmentsInfo
 	(*EntPersonListResp)(nil),    // 33: messagecenter.EntPersonListResp
 	nil,                          // 34: messagecenter.ChatGroupPersonResp.DataEntry
+=======
+var file_messagecenter_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
+var file_messagecenter_proto_goTypes = []interface{}{
+	(*CountReq)(nil),         // 0: messagecenter.CountReq
+	(*CountResp)(nil),        // 1: messagecenter.CountResp
+	(*UserReq)(nil),          // 2: messagecenter.UserReq
+	(*UserResp)(nil),         // 3: messagecenter.UserResp
+	(*UserEntity)(nil),       // 4: messagecenter.UserEntity
+	(*MessageReq)(nil),       // 5: messagecenter.MessageReq
+	(*MessageResp)(nil),      // 6: messagecenter.MessageResp
+	(*SaveMessageResp)(nil),  // 7: messagecenter.SaveMessageResp
+	(*MessageEntity)(nil),    // 8: messagecenter.MessageEntity
+	(*ChatSessionReq)(nil),   // 9: messagecenter.ChatSessionReq
+	(*CloseSessionReq)(nil),  // 10: messagecenter.CloseSessionReq
+	(*ChatSessionResp)(nil),  // 11: messagecenter.ChatSessionResp
+	(*SaveAutoReplyReq)(nil), // 12: messagecenter.SaveAutoReplyReq
+	(*ReadStateReq)(nil),     // 13: messagecenter.ReadStateReq
+	(*ReadWithdrawReq)(nil),  // 14: messagecenter.ReadWithdrawReq
+	(*AppraiseReq)(nil),      // 15: messagecenter.AppraiseReq
+	(*CurrencyResp)(nil),     // 16: messagecenter.CurrencyResp
+	(*ConversationReq)(nil),  // 17: messagecenter.ConversationReq
+>>>>>>> master
 }
 var file_messagecenter_proto_depIdxs = []int32{
 	8,  // 0: messagecenter.CountResp.lastMessage:type_name -> messagecenter.MessageEntity
 	4,  // 1: messagecenter.UserResp.data:type_name -> messagecenter.UserEntity
 	8,  // 2: messagecenter.MessageResp.data:type_name -> messagecenter.MessageEntity
 	8,  // 3: messagecenter.SaveMessageResp.data:type_name -> messagecenter.MessageEntity
+<<<<<<< HEAD
 	17, // 4: messagecenter.ChatGroupListResp.data:type_name -> messagecenter.ChatGroupList
 	34, // 5: messagecenter.ChatGroupPersonResp.data:type_name -> messagecenter.ChatGroupPersonResp.DataEntry
 	23, // 6: messagecenter.ChatGroupPersonList.data:type_name -> messagecenter.ChatGroupPerson
@@ -3042,6 +3484,35 @@ var file_messagecenter_proto_depIdxs = []int32{
 	11, // [11:11] is the sub-list for extension type_name
 	11, // [11:11] is the sub-list for extension extendee
 	0,  // [0:11] is the sub-list for field type_name
+=======
+	0,  // 4: messagecenter.messageCenter.Count:input_type -> messagecenter.CountReq
+	2,  // 5: messagecenter.messageCenter.UserList:input_type -> messagecenter.UserReq
+	5,  // 6: messagecenter.messageCenter.FindMessage:input_type -> messagecenter.MessageReq
+	8,  // 7: messagecenter.messageCenter.SaveMessage:input_type -> messagecenter.MessageEntity
+	9,  // 8: messagecenter.messageCenter.CreateChatSession:input_type -> messagecenter.ChatSessionReq
+	10, // 9: messagecenter.messageCenter.CloseChatSession:input_type -> messagecenter.CloseSessionReq
+	12, // 10: messagecenter.messageCenter.SaveAutoReplyMsg:input_type -> messagecenter.SaveAutoReplyReq
+	13, // 11: messagecenter.messageCenter.UpdateReadById:input_type -> messagecenter.ReadStateReq
+	14, // 12: messagecenter.messageCenter.WithdrawMessage:input_type -> messagecenter.ReadWithdrawReq
+	15, // 13: messagecenter.messageCenter.AppraiseMessage:input_type -> messagecenter.AppraiseReq
+	17, // 14: messagecenter.messageCenter.ConversationList:input_type -> messagecenter.ConversationReq
+	1,  // 15: messagecenter.messageCenter.Count:output_type -> messagecenter.CountResp
+	3,  // 16: messagecenter.messageCenter.UserList:output_type -> messagecenter.UserResp
+	6,  // 17: messagecenter.messageCenter.FindMessage:output_type -> messagecenter.MessageResp
+	7,  // 18: messagecenter.messageCenter.SaveMessage:output_type -> messagecenter.SaveMessageResp
+	11, // 19: messagecenter.messageCenter.CreateChatSession:output_type -> messagecenter.ChatSessionResp
+	11, // 20: messagecenter.messageCenter.CloseChatSession:output_type -> messagecenter.ChatSessionResp
+	6,  // 21: messagecenter.messageCenter.SaveAutoReplyMsg:output_type -> messagecenter.MessageResp
+	16, // 22: messagecenter.messageCenter.UpdateReadById:output_type -> messagecenter.CurrencyResp
+	16, // 23: messagecenter.messageCenter.WithdrawMessage:output_type -> messagecenter.CurrencyResp
+	16, // 24: messagecenter.messageCenter.AppraiseMessage:output_type -> messagecenter.CurrencyResp
+	3,  // 25: messagecenter.messageCenter.ConversationList:output_type -> messagecenter.UserResp
+	15, // [15:26] is the sub-list for method output_type
+	4,  // [4:15] 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
+>>>>>>> master
 }
 
 func init() { file_messagecenter_proto_init() }
@@ -3219,6 +3690,33 @@ func file_messagecenter_proto_init() {
 			}
 		}
 		file_messagecenter_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
+<<<<<<< HEAD
+=======
+			switch v := v.(*ReadWithdrawReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		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{} {
+>>>>>>> master
 			switch v := v.(*CurrencyResp); i {
 			case 0:
 				return &v.state
@@ -3230,6 +3728,7 @@ func file_messagecenter_proto_init() {
 				return nil
 			}
 		}
+<<<<<<< HEAD
 		file_messagecenter_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*ChatGroupListReq); i {
 			case 0:
@@ -3448,6 +3947,10 @@ func file_messagecenter_proto_init() {
 		}
 		file_messagecenter_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*EntPersonListResp); i {
+=======
+		file_messagecenter_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ConversationReq); i {
+>>>>>>> master
 			case 0:
 				return &v.state
 			case 1:
@@ -3465,7 +3968,11 @@ func file_messagecenter_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_messagecenter_proto_rawDesc,
 			NumEnums:      0,
+<<<<<<< HEAD
 			NumMessages:   35,
+=======
+			NumMessages:   18,
+>>>>>>> master
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 112 - 4
rpc/messagecenter/messagecenter/messagecenter_grpc.pb.go

@@ -34,10 +34,11 @@ type MessageCenterClient interface {
 	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)
-	//根据消息修改已读状态
+	// 根据消息修改已读状态
 	UpdateReadById(ctx context.Context, in *ReadStateReq, opts ...grpc.CallOption) (*CurrencyResp, error)
+<<<<<<< HEAD
 	//群组列表查询
 	ChatGroupList(ctx context.Context, in *ChatGroupListReq, opts ...grpc.CallOption) (*ChatGroupListResp, error)
 	//群组新增
@@ -56,6 +57,14 @@ type MessageCenterClient interface {
 	GroupNoticeGet(ctx context.Context, in *ChatGroupPersonReq, opts ...grpc.CallOption) (*GroupNoticeGetResp, error)
 	//通讯录 -企业人员列表
 	EntPersonsList(ctx context.Context, in *EntPersonsListReq, opts ...grpc.CallOption) (*EntPersonListResp, error)
+=======
+	// 用户撤回消息
+	WithdrawMessage(ctx context.Context, in *ReadWithdrawReq, opts ...grpc.CallOption) (*CurrencyResp, error)
+	// 用户评价回复
+	AppraiseMessage(ctx context.Context, in *AppraiseReq, opts ...grpc.CallOption) (*CurrencyResp, error)
+	// 客服列表查询
+	ConversationList(ctx context.Context, in *ConversationReq, opts ...grpc.CallOption) (*UserResp, error)
+>>>>>>> master
 }
 
 type messageCenterClient struct {
@@ -138,24 +147,37 @@ func (c *messageCenterClient) UpdateReadById(ctx context.Context, in *ReadStateR
 	return out, nil
 }
 
+<<<<<<< HEAD
 func (c *messageCenterClient) ChatGroupList(ctx context.Context, in *ChatGroupListReq, opts ...grpc.CallOption) (*ChatGroupListResp, error) {
 	out := new(ChatGroupListResp)
 	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/ChatGroupList", in, out, opts...)
+=======
+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...)
+>>>>>>> master
 	if err != nil {
 		return nil, err
 	}
 	return out, nil
 }
 
+<<<<<<< HEAD
 func (c *messageCenterClient) ChatGroupAdd(ctx context.Context, in *ChatGroupAddReq, opts ...grpc.CallOption) (*CommonReq, error) {
 	out := new(CommonReq)
 	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/ChatGroupAdd", in, out, opts...)
+=======
+func (c *messageCenterClient) AppraiseMessage(ctx context.Context, in *AppraiseReq, opts ...grpc.CallOption) (*CurrencyResp, error) {
+	out := new(CurrencyResp)
+	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/AppraiseMessage", in, out, opts...)
+>>>>>>> master
 	if err != nil {
 		return nil, err
 	}
 	return out, nil
 }
 
+<<<<<<< HEAD
 func (c *messageCenterClient) ChatGroupPerson(ctx context.Context, in *ChatGroupPersonReq, opts ...grpc.CallOption) (*ChatGroupPersonResp, error) {
 	out := new(ChatGroupPersonResp)
 	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/ChatGroupPerson", in, out, opts...)
@@ -213,6 +235,11 @@ func (c *messageCenterClient) GroupNoticeGet(ctx context.Context, in *ChatGroupP
 func (c *messageCenterClient) EntPersonsList(ctx context.Context, in *EntPersonsListReq, opts ...grpc.CallOption) (*EntPersonListResp, error) {
 	out := new(EntPersonListResp)
 	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/EntPersonsList", in, out, opts...)
+=======
+func (c *messageCenterClient) ConversationList(ctx context.Context, in *ConversationReq, opts ...grpc.CallOption) (*UserResp, error) {
+	out := new(UserResp)
+	err := c.cc.Invoke(ctx, "/messagecenter.messageCenter/ConversationList", in, out, opts...)
+>>>>>>> master
 	if err != nil {
 		return nil, err
 	}
@@ -235,10 +262,11 @@ type MessageCenterServer interface {
 	CreateChatSession(context.Context, *ChatSessionReq) (*ChatSessionResp, error)
 	// 会话关闭
 	CloseChatSession(context.Context, *CloseSessionReq) (*ChatSessionResp, error)
-	//创建会话并且保存信息
+	// 创建会话并且保存信息
 	SaveAutoReplyMsg(context.Context, *SaveAutoReplyReq) (*MessageResp, error)
-	//根据消息修改已读状态
+	// 根据消息修改已读状态
 	UpdateReadById(context.Context, *ReadStateReq) (*CurrencyResp, error)
+<<<<<<< HEAD
 	//群组列表查询
 	ChatGroupList(context.Context, *ChatGroupListReq) (*ChatGroupListResp, error)
 	//群组新增
@@ -257,6 +285,14 @@ type MessageCenterServer interface {
 	GroupNoticeGet(context.Context, *ChatGroupPersonReq) (*GroupNoticeGetResp, error)
 	//通讯录 -企业人员列表
 	EntPersonsList(context.Context, *EntPersonsListReq) (*EntPersonListResp, error)
+=======
+	// 用户撤回消息
+	WithdrawMessage(context.Context, *ReadWithdrawReq) (*CurrencyResp, error)
+	// 用户评价回复
+	AppraiseMessage(context.Context, *AppraiseReq) (*CurrencyResp, error)
+	// 客服列表查询
+	ConversationList(context.Context, *ConversationReq) (*UserResp, error)
+>>>>>>> master
 	mustEmbedUnimplementedMessageCenterServer()
 }
 
@@ -288,6 +324,7 @@ func (UnimplementedMessageCenterServer) SaveAutoReplyMsg(context.Context, *SaveA
 func (UnimplementedMessageCenterServer) UpdateReadById(context.Context, *ReadStateReq) (*CurrencyResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method UpdateReadById not implemented")
 }
+<<<<<<< HEAD
 func (UnimplementedMessageCenterServer) ChatGroupList(context.Context, *ChatGroupListReq) (*ChatGroupListResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ChatGroupList not implemented")
 }
@@ -314,6 +351,16 @@ func (UnimplementedMessageCenterServer) GroupNoticeGet(context.Context, *ChatGro
 }
 func (UnimplementedMessageCenterServer) EntPersonsList(context.Context, *EntPersonsListReq) (*EntPersonListResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method EntPersonsList not implemented")
+=======
+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) ConversationList(context.Context, *ConversationReq) (*UserResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ConversationList not implemented")
+>>>>>>> master
 }
 func (UnimplementedMessageCenterServer) mustEmbedUnimplementedMessageCenterServer() {}
 
@@ -472,12 +519,18 @@ func _MessageCenter_UpdateReadById_Handler(srv interface{}, ctx context.Context,
 	return interceptor(ctx, in, info, handler)
 }
 
+<<<<<<< HEAD
 func _MessageCenter_ChatGroupList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(ChatGroupListReq)
+=======
+func _MessageCenter_WithdrawMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ReadWithdrawReq)
+>>>>>>> master
 	if err := dec(in); err != nil {
 		return nil, err
 	}
 	if interceptor == nil {
+<<<<<<< HEAD
 		return srv.(MessageCenterServer).ChatGroupList(ctx, in)
 	}
 	info := &grpc.UnaryServerInfo{
@@ -486,16 +539,32 @@ func _MessageCenter_ChatGroupList_Handler(srv interface{}, ctx context.Context,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).ChatGroupList(ctx, req.(*ChatGroupListReq))
+=======
+		return srv.(MessageCenterServer).WithdrawMessage(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/messagecenter.messageCenter/WithdrawMessage",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(MessageCenterServer).WithdrawMessage(ctx, req.(*ReadWithdrawReq))
+>>>>>>> master
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
+<<<<<<< HEAD
 func _MessageCenter_ChatGroupAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(ChatGroupAddReq)
+=======
+func _MessageCenter_AppraiseMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(AppraiseReq)
+>>>>>>> master
 	if err := dec(in); err != nil {
 		return nil, err
 	}
 	if interceptor == nil {
+<<<<<<< HEAD
 		return srv.(MessageCenterServer).ChatGroupAdd(ctx, in)
 	}
 	info := &grpc.UnaryServerInfo{
@@ -504,16 +573,32 @@ func _MessageCenter_ChatGroupAdd_Handler(srv interface{}, ctx context.Context, d
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).ChatGroupAdd(ctx, req.(*ChatGroupAddReq))
+=======
+		return srv.(MessageCenterServer).AppraiseMessage(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/messagecenter.messageCenter/AppraiseMessage",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(MessageCenterServer).AppraiseMessage(ctx, req.(*AppraiseReq))
+>>>>>>> master
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
+<<<<<<< HEAD
 func _MessageCenter_ChatGroupPerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(ChatGroupPersonReq)
+=======
+func _MessageCenter_ConversationList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ConversationReq)
+>>>>>>> master
 	if err := dec(in); err != nil {
 		return nil, err
 	}
 	if interceptor == nil {
+<<<<<<< HEAD
 		return srv.(MessageCenterServer).ChatGroupPerson(ctx, in)
 	}
 	info := &grpc.UnaryServerInfo{
@@ -630,6 +715,16 @@ func _MessageCenter_EntPersonsList_Handler(srv interface{}, ctx context.Context,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(MessageCenterServer).EntPersonsList(ctx, req.(*EntPersonsListReq))
+=======
+		return srv.(MessageCenterServer).ConversationList(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/messagecenter.messageCenter/ConversationList",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(MessageCenterServer).ConversationList(ctx, req.(*ConversationReq))
+>>>>>>> master
 	}
 	return interceptor(ctx, in, info, handler)
 }
@@ -674,6 +769,7 @@ var MessageCenter_ServiceDesc = grpc.ServiceDesc{
 			Handler:    _MessageCenter_UpdateReadById_Handler,
 		},
 		{
+<<<<<<< HEAD
 			MethodName: "ChatGroupList",
 			Handler:    _MessageCenter_ChatGroupList_Handler,
 		},
@@ -708,6 +804,18 @@ var MessageCenter_ServiceDesc = grpc.ServiceDesc{
 		{
 			MethodName: "EntPersonsList",
 			Handler:    _MessageCenter_EntPersonsList_Handler,
+=======
+			MethodName: "WithdrawMessage",
+			Handler:    _MessageCenter_WithdrawMessage_Handler,
+		},
+		{
+			MethodName: "AppraiseMessage",
+			Handler:    _MessageCenter_AppraiseMessage_Handler,
+		},
+		{
+			MethodName: "ConversationList",
+			Handler:    _MessageCenter_ConversationList_Handler,
+>>>>>>> master
 		},
 	},
 	Streams:  []grpc.StreamDesc{},

+ 356 - 48
service/message_mail_box.go

@@ -2,19 +2,23 @@ package service
 
 import (
 	quitl "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
 	IC "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/init"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
 	"database/sql"
 	"fmt"
 	"log"
+	"strings"
+	"sync"
 	"time"
 )
 
 type MessaggeService struct{}
 
-//未读消息查询
+// 未读消息查询
 func (b MessaggeService) Count(newUserId, userType, entUserId int64, isClean bool) (count int, last map[string]interface{}, err error) {
+	log.Printf("用户id:%d,userType:%d,entUserId:%d,isClean:%v", newUserId, userType, entUserId, isClean)
 	v := make([]interface{}, 0)
 	sqlStr := ""
 	if userType == 1 {
@@ -29,7 +33,8 @@ func (b MessaggeService) Count(newUserId, userType, entUserId int64, isClean boo
 		sqlStr = fmt.Sprintf("select  count(b.id) from   %s a  "+
 			"LEFT  JOIN  %s  b ON a.id=b.own_id "+
 			"where  b.type=5 "+
-			"AND   a.customer_service_id=%d   "+
+			"AND   a.customer_service_id=%d  "+
+			"AND b.iswithdraw = 0  "+
 			"AND  b.isread=0  "+
 			"AND own_type = 1 "+
 			"order by create_time", util.SOCIALIZE_CHAT_SESSION, util.SOCIALIZE_MESSAGE_MAILBOX, entUserId)
@@ -43,7 +48,8 @@ func (b MessaggeService) Count(newUserId, userType, entUserId int64, isClean boo
 		}
 		sqlStr = fmt.Sprintf("select  count(b.id) from    %s  b "+
 			"where   b.send_user_id != %d    "+
-			"AND   b.own_id=%d  "+
+			"AND   b.own_id=%d "+
+			"AND b.iswithdraw = 0  "+
 			"AND  b.isread=0 "+
 			"AND own_type = 2 "+
 			"order by create_time", util.SOCIALIZE_MESSAGE_MAILBOX, newUserId, newUserId)
@@ -57,7 +63,8 @@ func (b MessaggeService) Count(newUserId, userType, entUserId int64, isClean boo
 	sqlStr = fmt.Sprintf("SELECT  c.* FROM %s  b   "+
 		"LEFT join %s c on  b.messag_id=c.id "+
 		"WHERE  b.send_user_id != %d   "+
-		"AND b.own_id = %d  "+
+		"AND b.own_id = %d "+
+		"AND b.iswithdraw = 0  "+
 		"AND   b.isread=0  "+
 		"AND own_type = 2  "+
 		"ORDER BY  create_time DESC   "+
@@ -81,13 +88,15 @@ func (b MessaggeService) Count(newUserId, userType, entUserId int64, isClean boo
 	return
 }
 
-//用户列表查询
-func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string]interface{}, err error) {
+// 用户列表查询
+func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string]interface{}, count int64, err error) {
 	sqlStr := ""
+	tm := time.Now()
 	if in.UserType == 2 {
 		//用户最后一次信息查询
 		userSql := fmt.Sprintf("SELECT  MAX( c.id )   as messageId  FROM  socialize_message_mailbox c "+
-			"WHERE  c.own_id = %d   "+
+			"WHERE  c.own_id = %d  "+
+			"AND c.iswithdraw = 0  "+
 			"AND c.type = 2   "+
 			"AND c.own_type = 2 "+
 			"GROUP BY  (  CASE  WHEN c.send_user_id > c.receive_user_id "+
@@ -101,6 +110,7 @@ func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string
 		customerSql := fmt.Sprintf("SELECT   MAX( c.id )   as messageId  FROM   %s c "+
 			"LEFT JOIN %s d ON  IF   ( c.send_user_type = 1, d.id = c.send_user_id, d.id = c.receive_user_id ) "+
 			"WHERE   c.own_id = %d  "+
+			"AND c.iswithdraw = 0 "+
 			"AND ( c.type = 4 OR c.type = 5  or c.type=6 or  c.type=7 ) "+
 			"AND c.own_type = 2 "+
 			"AND   d.user_id=c.own_id "+
@@ -109,14 +119,14 @@ func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string
 		customerMessageId := util.Inhandle(data)
 		//用户的列表
 		sqlStr = fmt.Sprintf("SELECT "+
-			"(  CASE        WHEN SUBSTR( b.nickname, 1, 3 ) = 'JY_' THEN    CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) )     WHEN b.nickname = '' THEN    CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) ) ELSE b.nickname    END    )"+
+			"(  CASE        WHEN SUBSTR( b.nickname, 1, 3 ) = 'JY_' THEN    CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) )     WHEN b.nickname = '' or b.nickname is null THEN    CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) ) ELSE b.nickname    END    )"+
 			"AS name, b.id, e.title, b.headimg, e.type, e.link, e.content, 2 AS userType, a.create_time, a.type AS itemType, "+
 			"( SELECT  count( h.id )  FROM  %s h  "+
 			"WHERE  h.type = 2  "+
 			"AND h.own_id = %d  "+
 			"AND h.own_type = 2  "+
 			"AND   h.send_user_id=b.id   "+
-			"AND h.isread = 0  ) AS number  FROM  %s a "+
+			"AND h.isread = 0 AND h.iswithdraw = 0  ) AS number  FROM  %s a "+
 			"LEFT JOIN  %s b ON  b.id = a.receive_user_id or  b.id = a.send_user_id  "+
 			"LEFT JOIN  %s e ON e.id = a.messag_id  "+
 			"WHERE a.id IN ( %s )  AND b.id != %d "+
@@ -145,16 +155,17 @@ func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string
 			util.SOCIALIZE_TENANT_ROBOT,
 			customerMessageId)
 	} else {
-		phoneSql := ""
-		if in.Phone != "" {
-			phoneSql = "AND  b.phone like '%" + in.Phone + "%'"
+		idSql := fmt.Sprintf(" (a.customer_service_id = %d OR a.customer_service_id = 0) ", in.EntUserId)
+		if in.IsArtificial == 1 {
+			idSql = fmt.Sprintf(" a.customer_service_id = %d ", in.EntUserId)
+		} else if in.IsArtificial == 2 {
+			idSql = " a.customer_service_id = 0 "
 		}
-		startTimeSql := ""
 		if in.StartTime != "" {
-			startTimeSql = "AND  DATE_FORMAT(c.create_time,'%Y-%m-%d') >= '" + in.StartTime + "' "
+			idSql += " AND  DATE_FORMAT(a.update_time,'%Y-%m-%d') >= '" + in.StartTime + "' "
 		}
-		endTimeSql := ""
 		if in.EndTime != "" {
+<<<<<<< HEAD
 			endTimeSql = "AND DATE_FORMAT(c.create_time,'%Y-%m-%d') <= '" + in.EndTime + "' "
 		}
 		//先获取每个用户最后聊天记录
@@ -188,32 +199,165 @@ func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string
 				"WHERE  a.id IN  ( %s) %s ORDER BY  a.create_time DESC",
 				util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_CHAT_SESSION,
 				in.EntUserId, util.SOCIALIZE_MESSAGE_MAILBOX, util.BASE_USER, util.SOCIALIZE_MESSAGE, util.SOCIALIZE_CHAT_SESSION, customerMessageId, phoneSql)
+=======
+			idSql += "AND DATE_FORMAT(a.update_time,'%Y-%m-%d') <= '" + in.EndTime + "' "
+		}
+		if in.Phone != "" {
+			idSql += " AND  b.phone like '%" + in.Phone + "%'"
+		}
+		if in.FiltrationId != "" {
+			var ids []string
+			for _, v := range strings.Split(in.FiltrationId, ",") {
+				ids = append(ids, encrypt.SE.Decode4Hex(v))
+			}
+			idSql += fmt.Sprintf(" AND  b.id not in (%s)", strings.Join(ids, ","))
+		}
+		if in.Page <= 0 {
+			in.Page = 1
 		}
+		if in.Size <= 0 || in.Size > 100 {
+			in.Size = 50
+		}
+		sqlStr = fmt.Sprintf(`SELECT(
+			 CASE
+            	WHEN SUBSTR( b.nickname, 1, 3 ) = 'JY_' THEN
+            	CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) ) 
+            	WHEN b.nickname = '' 
+            	OR b.nickname IS NULL THEN
+            	CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) ) ELSE b.nickname 
+            	END 
+            ) AS name,
+			b.id,
+			e.title,
+			b.headimg,
+			e.type,
+			e.link,
+			e.content,
+			a.update_time as create_time,
+			(
+			SELECT
+				count( h.id ) 
+			FROM
+				 %s h
+				LEFT JOIN  %s i ON h.own_id = i.id 
+			WHERE
+				h.own_type = 1 
+				AND i.ent_id = a.ent_id 
+				AND i.user_id = a.user_id 
+				AND h.isread = 0 
+				AND h.iswithdraw = 0 
+				AND i.customer_service_id = %d 
+			) AS number 
+		FROM
+			%s a
+			INNER JOIN %s b ON  a.ent_id = %d and %s 
+			AND a.user_id = b.id
+			LEFT JOIN  %s e ON e.id = a.message_id 
+	ORDER BY
+	a.update_time DESC`, util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_CHAT_SESSION, in.EntUserId, util.User_message_list, util.BASE_USER, in.EntId, idSql, util.SOCIALIZE_MESSAGE)
 	}
+	dataSize := []map[string]interface{}{}
 	if sqlStr != "" {
+		log.Println("查询列表sql:", sqlStr)
+		data = util.Mysql.SelectBySql(sqlStr)
+		if data != nil && len(*data) > 0 {
+			count = quitl.Int64All(len(*data))
+			log.Println("查询列表耗时2:", time.Since(tm), count)
+			if in.UserType != 2 {
+				if in.Page*in.Size >= count {
+					dataSize = (*data)[(in.Page-1)*in.Size:]
+				} else {
+					dataSize = (*data)[(in.Page-1)*in.Size : in.Page*in.Size]
+				}
+				return &dataSize, count, err
+			}
+		}
+	}
+	return
+}
+
+// 客服会话列表
+func (b MessaggeService) ConversationList(in *messagecenter.ConversationReq) (data *[]map[string]interface{}, count int64, err error) {
+	sqlStr := ""
+	tm := time.Now()
+	if in.UserType == 1 && in.FiltrationId != "" {
+		var ids []string
+		for _, v := range strings.Split(in.FiltrationId, ",") {
+			ids = append(ids, encrypt.SE.Decode4Hex(v))
+>>>>>>> master
+		}
+
+		idSql := fmt.Sprintf("a.customer_service_id = %d AND  b.id  in (%s) ", in.EntUserId, strings.Join(ids, ","))
+		sqlStr = fmt.Sprintf(`SELECT(
+			CASE
+            	WHEN SUBSTR( b.nickname, 1, 3 ) = 'JY_' THEN
+            	CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) ) 
+            	WHEN b.nickname = '' 
+            	OR b.nickname IS NULL THEN
+            	CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) ) ELSE b.nickname 
+            	END 
+            ) AS name,
+			b.id,
+			e.title,
+			b.headimg,
+			e.type,
+			e.link,
+			e.content,
+			a.update_time as create_time,
+			(
+			SELECT
+				count( h.id ) 
+			FROM
+				 %s h
+				LEFT JOIN  %s i ON h.own_id = i.id 
+			WHERE
+				h.own_type = 1 
+				AND i.ent_id = a.ent_id 
+				AND i.user_id = a.user_id 
+				AND h.isread = 0 
+				AND h.iswithdraw = 0 
+				AND i.customer_service_id = %d 
+			) AS number 
+		FROM
+			%s a
+			INNER JOIN %s b ON  %s 
+			AND a.user_id = b.id
+			LEFT JOIN  %s e ON e.id = a.message_id`,
+			util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_CHAT_SESSION, in.EntUserId, util.User_message_list, util.BASE_USER, idSql, util.SOCIALIZE_MESSAGE)
+	}
+
+	if sqlStr != "" {
+<<<<<<< HEAD
 		log.Println(sqlStr)
 		data = IC.BaseMysql.SelectBySql(sqlStr)
+=======
+		log.Println("查询列表sql:", sqlStr)
+		data = util.Mysql.SelectBySql(sqlStr)
+		log.Println("查询耗时2:", time.Since(tm), count)
+>>>>>>> master
 	}
 	return
 }
 
-//消息保存
+// 消息保存
 func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool, errorMsg string, content string, messageId, nowInt int64) {
 	//先插入信息表
 	//判断会话标识是否属于本人
+	var customer_service_id, userid, entid, message_id int64
 	nowForm := time.Now().Local()
+	create_time := nowForm.Format(util.Date_Full_Layout)
 	if in.ItemType != 2 {
 		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
 				}
 			}
@@ -232,7 +376,11 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 			break
 		}
 		//查找会话信息
+<<<<<<< HEAD
 		chatJson := IC.BaseMysql.FindOne(util.SOCIALIZE_CHAT_SESSION, map[string]interface{}{"id": sessionId}, "user_id", "")
+=======
+		chatJson := util.Mysql.FindOne(util.SOCIALIZE_CHAT_SESSION, map[string]interface{}{"id": sessionId}, "user_id,ent_id,customer_service_id", "")
+>>>>>>> master
 		if chatJson == nil {
 			return false, "会话标识不存在", "", 0, nowForm.Unix()
 		} else {
@@ -240,10 +388,12 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 				return false, "会话标识不属于此用户", "", 0, nowForm.Unix()
 			}
 		}
+		customer_service_id = quitl.Int64All((*chatJson)["customer_service_id"])
+		entid = quitl.Int64All((*chatJson)["ent_id"])
+		userid = userId
 	}
 	fool = IC.BaseMysql.ExecTx("聊天信息保存", func(tx *sql.Tx) bool {
 		//先插入信息表
-		create_time := nowForm.Format(util.Date_Full_Layout)
 		userType := int64(1)
 		userId := int64(0)
 		message := map[string]interface{}{
@@ -264,7 +414,7 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 		}
 		ok := IC.BaseMysql.InsertByTx(tx, util.SOCIALIZE_MESSAGE, message)
 		receiveOk := int64(0)
-		messageId = ok
+		messageId, message_id = ok, ok
 		data["id"] = ok
 		//在插入邮箱表socialize_message_mailbox
 		messageMailBox := map[string]interface{}{
@@ -319,7 +469,7 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 			receiveOk = IC.BaseMysql.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 {
 				// (用户发送)客服接受
@@ -340,7 +490,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
@@ -372,7 +522,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 {
 				//用户发送(用户接受)
@@ -391,7 +541,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
 				}
 			}
@@ -414,10 +564,47 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 		}
 		return ok > 1 && receiveOk > 1
 	})
+	if fool && in.ItemType != 2 && in.ItemType != 3 {
+		go UserSynchronousList(customer_service_id, userid, entid, message_id, create_time)
+	}
 	return fool, "", in.Content, messageId, nowForm.Unix()
 }
 
-//历史信息查询
+var rwLock = new(sync.RWMutex)
+
+// 客服 用户聊天消息列表同步
+func UserSynchronousList(customerServiceId, userId, entId, messageId int64, createTime string) {
+	log.Printf("同步最后消息参数customerServiceId:%d,userId:%d,entId%d,messageId:%d", customerServiceId, userId, entId, messageId)
+	rwLock.Lock()
+	defer rwLock.Unlock()
+	if util.Mysql.Count(util.User_message_list, map[string]interface{}{"user_id": userId, "ent_id": entId}) > 0 {
+		upData := map[string]interface{}{
+			"message_id":  messageId,
+			"update_time": createTime,
+		}
+		//判断是否机器人聊天
+		if customerServiceId > 0 && util.Mysql.Count(util.User_message_list, map[string]interface{}{"user_id": userId, "ent_id": entId, "customer_service_id": 0}) > 0 {
+			//将机器人列表更新成用户
+			upData["customer_service_id"] = customerServiceId
+			//转人工 机器人聊天类型修改
+			upData["type"] = 1
+		}
+		//已于人工客服联系过 只同步最后消息
+		util.Mysql.Update(util.User_message_list, map[string]interface{}{"user_id": userId, "ent_id": entId}, upData)
+		return
+	}
+	//不存在消息列表 创建
+	util.Mysql.Insert(util.User_message_list, map[string]interface{}{
+		"ent_id":              entId,
+		"user_id":             userId,
+		"message_id":          messageId,
+		"update_time":         createTime,
+		"customer_service_id": customerServiceId,
+		"type":                quitl.If(customerServiceId == 0, 0, 1),
+	})
+}
+
+// 历史信息查询
 func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string]interface{} {
 	sqlStr := ""
 	lastStr := ""
@@ -435,10 +622,10 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
 			"LEFT JOIN %s b on  a.messag_id=b.id  "+
 			"LEFT  JOIN  %s c on  c.id=a.send_user_id   "+
 			"LEFT JOIN  %s d on  d.id=a.receive_user_id  "+
-			"where  a.own_id=  %d "+
+			"where  a.own_id=  %d and a.iswithdraw = 0"+
 			"AND ((a.send_user_id=   %d AND   a.receive_user_id=   %d) or (a.send_user_id=  %d AND  a.receive_user_id=  %d)) "+
 			"AND  a.type=2  %s "+
-			"ORDER BY a.create_time desc ,a.id   asc "+
+			"ORDER BY a.create_time desc,a.id   asc "+
 			"limit 0 ,  %d ",
 			util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, util.BASE_USER, util.BASE_USER,
 			in.NewUserId, in.NewUserId, in.SendId, in.SendId, in.NewUserId, lastStr, in.PageSize)
@@ -450,29 +637,30 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
 				"FROM   %s a   "+
 				"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.type = 5 or a.type=4 or  a.type=6 or  a.type=7)   "+
+				"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 or a.type=8 )   "+
 				"AND c.ent_id =   %d "+
 				"AND c.user_id =   %d  %s "+
-				"ORDER BY a.create_time desc ,a.id   asc "+
+				"ORDER BY a.create_time desc ,a.id asc "+
 				"limit 0 ,  %d ",
 				util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, util.SOCIALIZE_CHAT_SESSION,
 				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    "+
-				"WHERE   a.own_type = 2    "+
+				"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 "+
-				"ORDER BY a.create_time desc ,a.id   asc "+
+				"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
@@ -491,8 +679,8 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
 	}
 	go func() {
 		updateMap := map[string]interface{}{}
-		//if len(*data) > 0 && data != nil {
-		if true {
+		if len(*data) > 0 && data != nil {
+			//if true {
 			//未读信息修改
 			switch in.MsgType {
 			case 2: //点对点聊天
@@ -508,14 +696,14 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
 				sqlStr := ""
 				if in.UserType == 1 {
 					sqlStr = fmt.Sprintf("UPDATE %s a  SET a.isread = 1,    a.read_time = now( )  "+
-						"WHERE    a.own_type = 1  "+
+						"WHERE    a.own_type = 1 and a.iswithdraw = 0 "+
 						"AND a.type IN ( 4,5,6,7)  "+
 						"AND a.isread = 0    "+
 						"AND a.own_id IN ( SELECT b.id FROM %s b WHERE   b.customer_service_id=%d AND    b.user_id=%d  )",
 						util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_CHAT_SESSION, in.EntUserId, in.SendId)
 				} else {
 					sqlStr = fmt.Sprintf("UPDATE %s a  SET a.isread = 1,    a.read_time = now( )  "+
-						"WHERE    a.own_type = 2  "+
+						"WHERE    a.own_type = 2 and a.iswithdraw = 0 "+
 						"AND a.type IN ( 4,5,6,7 )  "+
 						"AND a.isread = 0    "+
 						"AND a.own_id =%d ", util.SOCIALIZE_MESSAGE_MAILBOX, in.NewUserId)
@@ -530,7 +718,7 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
 	return data
 }
 
-//创建会话
+// 创建会话
 func (b MessaggeService) CreateChatSession(in *messagecenter.ChatSessionReq) (fool bool, sessionId int64) {
 	fool = IC.BaseMysql.ExecTx("会话新建", func(tx *sql.Tx) bool {
 		customerserviceName := in.CustomerserviceName
@@ -566,7 +754,7 @@ func (b MessaggeService) CreateChatSession(in *messagecenter.ChatSessionReq) (fo
 	return
 }
 
-//结束会话
+// 结束会话
 func (b MessaggeService) CloseChatSession(in *messagecenter.CloseSessionReq) bool {
 	fool := IC.BaseMysql.ExecTx("关闭会话", func(tx *sql.Tx) bool {
 		updateMap := map[string]interface{}{
@@ -578,10 +766,15 @@ func (b MessaggeService) CloseChatSession(in *messagecenter.CloseSessionReq) boo
 	return fool
 }
 
-//创建会话并保存信息
+// 创建会话并保存信息
 func (b *MessaggeService) SaveAutoReplyMsg(userType, entId, entUserId, userId int64, content, appId, nowFormat string) (bool, int64) {
+	var customer_service_id, userid, entid, message_id int64
 	messageId := int64(0)
+<<<<<<< HEAD
 	return IC.BaseMysql.ExecTx("保存自动回复消息", func(tx *sql.Tx) bool {
+=======
+	ok1 := util.Mysql.ExecTx("保存自动回复消息", func(tx *sql.Tx) bool {
+>>>>>>> master
 		entUserName := ""
 		if entUserId > 0 {
 			list := IC.BaseMysql.SelectBySql(`select ? from socialize_tenant_seat where appid=? AND ent_id=? AND customer_service_id=?`, util.SOCIALIZE_CHAT_SESSION, appId, entId, entUserId)
@@ -601,12 +794,21 @@ func (b *MessaggeService) SaveAutoReplyMsg(userType, entId, entUserId, userId in
 		} else if userType == 2 {
 			ok = IC.BaseMysql.InsertBySqlByTx(tx, `insert into socialize_message_mailbox (appid,messag_id,type,send_user_id,send_user_type,receive_user_id,receive_user_type,own_id,own_type,create_time) values (?,?,?,?,?,?,?,?,?,?)`, appId, messageId, 7, sessionId, 1, userId, 2, userId, 2, nowFormat) > 0
 		}
+		message_id = messageId
 		return messageId > 0 && sessionId > 0 && ok
-	}), messageId
+	})
+	if ok1 {
+		customer_service_id = entUserId
+		userid = userId
+		entid = entId
+		go UserSynchronousList(customer_service_id, userid, entid, message_id, nowFormat)
+	}
+	return ok1, messageId
 }
 
-//修改未读状态
+// 修改未读状态
 func (b MessaggeService) UpdateReadById(in *messagecenter.ReadStateReq) bool {
+<<<<<<< HEAD
 	fool := IC.BaseMysql.ExecTx("已读状态修改", func(tx *sql.Tx) bool {
 		updateMap := map[string]interface{}{
 			"messag_id": in.MessageId,
@@ -634,13 +836,119 @@ func (b MessaggeService) UpdateReadById(in *messagecenter.ReadStateReq) bool {
 							util.SetData(userType, userId, map[string]interface{}{"data": map[string]interface{}{}, "count": pc_a.Count - 1}, IC.SurvivalTime)
 						} else {
 							util.SetData(userType, userId, map[string]interface{}{"data": data, "count": pc_a.Count - 1}, IC.SurvivalTime)
+=======
+	updateMap := map[string]interface{}{
+		"messag_id": in.MessageId,
+		"isread":    0,
+	}
+	if util.Mysql.Count(util.SOCIALIZE_MESSAGE_MAILBOX, updateMap) > 0 {
+		fool := util.Mysql.ExecTx("已读状态修改", func(tx *sql.Tx) bool {
+
+			fool := util.Mysql.Update(util.SOCIALIZE_MESSAGE_MAILBOX, updateMap, map[string]interface{}{"read_time": time.Now().Local().Format(util.Date_Full_Layout), "isread": 1})
+			if fool {
+				//查询此条信息拥有者
+				data := util.Mysql.FindOne(util.SOCIALIZE_MESSAGE_MAILBOX, updateMap, "receive_user_type", "")
+				if data != nil {
+					userType := int64(1)
+					userId := int64(0)
+					if (*data)["receive_user_type"] == 2 {
+						userType = 2
+						userId = in.EntUserId
+					} else {
+						userType = 1
+						userId = in.NewUserId
+					}
+					pc_a, err := util.GetData(userType, userId)
+					if fool {
+						if err == nil && pc_a != nil {
+							if pc_a.Count >= 1 {
+								//id一致
+								if in.MessageId == pc_a.Data["id"] {
+									util.SetData(userType, userId, map[string]interface{}{"data": map[string]interface{}{}, "count": pc_a.Count - 1}, util.SurvivalTime)
+								} else {
+									util.SetData(userType, userId, map[string]interface{}{"data": data, "count": pc_a.Count - 1}, util.SurvivalTime)
+								}
+							}
+>>>>>>> master
 						}
 					}
-				}
 
+				}
 			}
-		}
+			return fool
+		})
 		return fool
-	})
-	return fool
+	}
+	return true
+}
+
+// WithdrawMessage 撤回消息
+func (b MessaggeService) WithdrawMessage(in *messagecenter.ReadWithdrawReq) bool {
+	messageId := encrypt.SE.Decode4Hex(in.MessageId)
+	newUserId, entUserId := NewEndId(quitl.Int64All(messageId), in.UserType)
+	msg := util.Mysql.FindOne(util.SOCIALIZE_MESSAGE, map[string]interface{}{"id": messageId}, "create_time", "")
+	if msg == nil || len(*msg) <= 0 {
+		log.Println("查询消息id失败")
+		return false
+	}
+	createTime, _ := time.Parse(util.Date_Full_Layout, quitl.InterfaceToStr((*msg)["create_time"]))
+	if createTime.Unix()+60*2 < time.Now().Unix() {
+		log.Println("消息已超过2分钟,撤回失败")
+		return false
+	}
+	nowForm := time.Now().Local()
+	m := util.Mysql.Update(util.SOCIALIZE_MESSAGE_MAILBOX,
+		map[string]interface{}{"messag_id": messageId}, map[string]interface{}{"iswithdraw": 1, "withdraw_time": nowForm.Format(util.Date_Full_Layout)})
+	if m {
+		//消息撤回 更新对方私信
+		in.UserType = quitl.Int64All(quitl.If(in.UserType == 1, 2, 1))
+		b.Count(newUserId, in.UserType, entUserId, true)
+	}
+	return m
+}
+
+// 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("评价消息异常")
+}
+
+// NewEndId 消息撤回 获取对方userid
+func NewEndId(messageId, iType int64) (newUserId, entUserId int64) {
+	data := util.Mysql.FindOne(util.SOCIALIZE_MESSAGE_MAILBOX, map[string]interface{}{"messag_id": messageId, "own_type": iType}, "", "")
+	if data != nil && len(*data) > 0 {
+		if iType == 1 { //客服撤回消息 获取客服id与用户id
+			entUserId = quitl.Int64All((*data)["send_user_id"])
+			newUserId = quitl.Int64All((*data)["receive_user_id"])
+		} else {
+			//用户撤回消息 获取客服id与用户id
+			newUserId = quitl.Int64All((*data)["send_user_id"])
+			entUserId = quitl.Int64All((*data)["receive_user_id"])
+		}
+	}
+	return
 }

+ 1 - 1
service/message_mail_box_test.go

@@ -601,7 +601,7 @@ func TestMessaggeService_UserList(t *testing.T) {
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
 			b := MessaggeService{}
-			gotData, err := b.UserList(tt.args.in)
+			gotData, _, err := b.UserList(tt.args.in)
 			if (err != nil) != tt.wantErr {
 				t.Errorf("UserList() error = %v, wantErr %v", err, tt.wantErr)
 				return