jiaojiao7 vor 3 Jahren
Ursprung
Commit
6d8a9de66f

+ 29 - 0
api/internal/handler/messagedetailhandler.go

@@ -0,0 +1,29 @@
+package handler
+
+import (
+	"net/http"
+
+	"app.yhyue.com/moapp/MessageCenter/api/internal/logic"
+	"app.yhyue.com/moapp/MessageCenter/api/internal/svc"
+	"app.yhyue.com/moapp/MessageCenter/api/internal/types"
+
+	"github.com/tal-tech/go-zero/rest/httpx"
+)
+
+func MessageDetailHandler(ctx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.MessageDetailReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewMessageDetailLogic(r.Context(), ctx)
+		resp, err := l.MessageDetail(req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

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

@@ -17,6 +17,11 @@ func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/message/messageDelete",
 				Handler: MessageDeleteHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodGet,
+				Path:    "/message/messageDetail",
+				Handler: MessageDetailHandler(serverCtx),
+			},
 		},
 	)
 }

+ 3 - 5
api/internal/logic/messagedeletelogic.go

@@ -27,7 +27,7 @@ func NewMessageDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) Mess
 
 func (l *MessageDeleteLogic) MessageDelete(req types.MessageDeleteReq) (*types.MessageDeleteResp, error) {
 	// todo: add your logic here and delete this line
-	result := &types.MessageDeleteResp{}
+	result := &types.Response{}
 	log.Println(req)
 	lsi := l.svcCtx.MessageCenter
 	resp, err := lsi.DeleteMultipleMessage(l.ctx, &messageclient.DeleteMultipleMessageRequest{
@@ -37,12 +37,10 @@ func (l *MessageDeleteLogic) MessageDelete(req types.MessageDeleteReq) (*types.M
 	if err != nil {
 		return nil, err
 	}
-	//data := make([]map[string]interface{}, 0)
 
 	result.Code = resp.Code
 	result.Message = resp.Message
-	result.Status = 0
 	return result, nil
-
-	return &types.MessageDeleteResp{}, nil
 }
+
+

+ 57 - 0
api/internal/logic/messagedetaillogic.go

@@ -0,0 +1,57 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
+	"context"
+	"log"
+
+	"app.yhyue.com/moapp/MessageCenter/api/internal/svc"
+	"app.yhyue.com/moapp/MessageCenter/api/internal/types"
+
+	"github.com/tal-tech/go-zero/core/logx"
+)
+
+type MessageDetailLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewMessageDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) MessageDetailLogic {
+	return MessageDetailLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *MessageDetailLogic) MessageDetail(req types.MessageDetailReq) (*types.MessageDetailResp, error) {
+	result := &types.Response{}
+	log.Println(req)
+	lsi := l.svcCtx.MessageCenter
+	resp, err := lsi.FindMessageDetail(l.ctx, &messageclient.MessageDetailReq{
+		Id:    req.Id,
+	})
+	if err != nil {
+		return nil, err
+	}
+	log.Println(resp)
+	/*mess := map[string]interface{}{
+		"id":resp.Id,
+		"receiveUserId":resp.ReceiveUserId,
+		"receiveName":resp.ReceiveName,
+		"sendName":resp.SendName,
+		"sendUserId":resp.SendUserId,
+		"title":resp.Title,
+		"content":resp.Content,
+		"msgType":resp.MsgType,
+		"link":resp.Link,
+		"citeId":resp.CiteId,
+		"isRead":resp.IsRead,
+		"createtime":resp.Createtime,
+	}
+*/
+	//result.Code =
+	//result.Message = resp.
+	return nil, nil
+}

+ 11 - 2
api/internal/types/types.go

@@ -6,8 +6,17 @@ type MessageDeleteReq struct {
 	AppId string `form:"appId"`
 }
 
-type MessageDeleteResp struct {
+type Response struct {
 	Code    int64  `json:"code"`
 	Message string `json:"message"`
-	Status  int64  `json:"isOk"`
+}
+
+type MessageDetailReq struct {
+	Id int64 `form:"id"`
+}
+
+type MessageDetailResp struct {
+	Code    int64                  `json:"code"`
+	Message string                 `json:"message"`
+	Data    map[string]interface{} `json:"data"`
 }

+ 16 - 3
api/message.api

@@ -12,14 +12,27 @@ type MessageDeleteReq {
 	AppId string `form:"appId"`
 }
 
-type MessageDeleteResp {
+type response {
 	Code    int64  `json:"code"`
 	Message string `json:"message"`
-	Status  int64  `json:"isOk"`
+}
+
+//查询消息详情
+type MessageDetailReq {
+	Id int64 `form:"id"`
+}
+type MessageDetailResp {
+	Code    int64                  `json:"code"`
+	Message string                 `json:"message"`
+	Data    map[string]interface{} `json:"data"`
 }
 
 service message-api {
+	//删除消息
 	@handler MessageDeleteHandler // TODO: set handler name and delete this comment
-	get /message/messageDelete(MessageDeleteReq) returns(MessageDeleteResp)
+	get /message/messageDelete(MessageDeleteReq) returns(response)
+	//查询消息详情
+	@handler MessageDetailHandler // TODO: set handler name and delete this comment
+	get /message/messageDetail(MessageDetailReq) returns(MessageDetailResp)
 	
 }

+ 24 - 4
rpc/internal/logic/findmessagedetaillogic.go

@@ -1,10 +1,10 @@
 package logic
 
 import (
-	"context"
-
 	"app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
 	"app.yhyue.com/moapp/MessageCenter/rpc/message"
+	"app.yhyue.com/moapp/MessageCenter/service"
+	"context"
 
 	"github.com/tal-tech/go-zero/core/logx"
 )
@@ -26,6 +26,26 @@ func NewFindMessageDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 // 查看详细详情
 func (l *FindMessageDetailLogic) FindMessageDetail(in *message.MessageDetailReq) (*message.MessageDetailResp, error) {
 	// todo: add your logic here and delete this line
-
-	return &message.MessageDetailResp{}, nil
+	result := &message.MessageDetailResp{}
+	mess, err := service.FindMessageDetail(in.Id)
+	if err != nil {
+		return &message.MessageDetailResp{}, nil
+	}
+	detail := &message.Messages{
+		ReceiveUserId: mess.ReceiveUserid,
+		ReceiveName:   mess.ReceiveName,
+		SendName:      mess.SendName,
+		SendUserId:    mess.SendUserid,
+		Title:         mess.Title,
+		Content:       mess.Content,
+		MsgType:       int64(mess.MsgType),
+		Link:          mess.Link,
+		CiteId:        int64(mess.CiteId),
+		IsRead:        int64(mess.IsRead),
+		Createtime:    (mess.CreateTime).Format("2006-01-02 15:04:05"),
+	}
+	result.Code = 1
+	result.Message = "请求成功"
+	result.Data = detail
+	return result, nil
 }

+ 3 - 3
rpc/internal/server/messageserver.go

@@ -6,9 +6,9 @@ package server
 import (
 	"context"
 
-	"rpc/internal/logic"
-	"rpc/internal/svc"
-	"rpc/message"
+	"app.yhyue.com/moapp/MessageCenter/rpc/internal/logic"
+	"app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
+	"app.yhyue.com/moapp/MessageCenter/rpc/message"
 )
 
 type MessageServer struct {

+ 9 - 13
rpc/message.proto

@@ -13,6 +13,12 @@ message SendMsgRequest {
     string link = 8; //跳转链接
     int64 citeId = 9; //引用id
     string appid = 10; //应用标识
+    int64 isdel = 11; //是否删除
+    string sendTime = 12; //发送时间
+    string sendMode = 13; //发送模式
+    string receiveTime = 14; //接收时间
+    int64 sendStatus = 15; //发送状态
+    string updateTime = 16; //修改时间
 }
 
 message ChangeReadStatusRequest {
@@ -91,19 +97,9 @@ message MessageDetailReq {
     int64 id = 1; //消息id
 }
 message MessageDetailResp {
-    int64 id = 1;
-    string receiveUserId = 2; //接收方用户ID
-    string receiveName = 3; //接收方用户名
-    string sendUserId = 4; //发送方用户ID
-    string sendName = 5; //发送方用户名
-    string title = 6; //主题
-    string content = 7; //内容
-    int64 msgType = 8; //消息类型 1:客服   2:系统通知  3:营销   4:用户会话
-    string link = 9; //跳转链接
-    int64 citeId = 10; //引用id
-    int64 isRead = 11; //已读未读 0:未读  1:已读
-    string createtime = 12;
-    string appid = 13; //应用标识
+    int64 code = 1; //状态码
+    string message = 2; //响应消息
+    Messages data = 3; //
 }
 message GetLastMessageReq {
     string userId = 1; // 用户id

+ 159 - 195
rpc/message/message.pb.go

@@ -44,6 +44,12 @@ type SendMsgRequest struct {
 	Link          string `protobuf:"bytes,8,opt,name=link,proto3" json:"link,omitempty"`                   //跳转链接
 	CiteId        int64  `protobuf:"varint,9,opt,name=citeId,proto3" json:"citeId,omitempty"`              //引用id
 	Appid         string `protobuf:"bytes,10,opt,name=appid,proto3" json:"appid,omitempty"`                //应用标识
+	Isdel         int64  `protobuf:"varint,11,opt,name=isdel,proto3" json:"isdel,omitempty"`               //是否删除
+	SendTime      string `protobuf:"bytes,12,opt,name=sendTime,proto3" json:"sendTime,omitempty"`          //发送时间
+	SendMode      string `protobuf:"bytes,13,opt,name=sendMode,proto3" json:"sendMode,omitempty"`          //发送模式
+	ReceiveTime   string `protobuf:"bytes,14,opt,name=receiveTime,proto3" json:"receiveTime,omitempty"`    //接收时间
+	SendStatus    int64  `protobuf:"varint,15,opt,name=sendStatus,proto3" json:"sendStatus,omitempty"`     //发送状态
+	UpdateTime    string `protobuf:"bytes,16,opt,name=updateTime,proto3" json:"updateTime,omitempty"`      //修改时间
 }
 
 func (x *SendMsgRequest) Reset() {
@@ -148,6 +154,48 @@ func (x *SendMsgRequest) GetAppid() string {
 	return ""
 }
 
+func (x *SendMsgRequest) GetIsdel() int64 {
+	if x != nil {
+		return x.Isdel
+	}
+	return 0
+}
+
+func (x *SendMsgRequest) GetSendTime() string {
+	if x != nil {
+		return x.SendTime
+	}
+	return ""
+}
+
+func (x *SendMsgRequest) GetSendMode() string {
+	if x != nil {
+		return x.SendMode
+	}
+	return ""
+}
+
+func (x *SendMsgRequest) GetReceiveTime() string {
+	if x != nil {
+		return x.ReceiveTime
+	}
+	return ""
+}
+
+func (x *SendMsgRequest) GetSendStatus() int64 {
+	if x != nil {
+		return x.SendStatus
+	}
+	return 0
+}
+
+func (x *SendMsgRequest) GetUpdateTime() string {
+	if x != nil {
+		return x.UpdateTime
+	}
+	return ""
+}
+
 type ChangeReadStatusRequest struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -914,19 +962,9 @@ type MessageDetailResp struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Id            int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
-	ReceiveUserId string `protobuf:"bytes,2,opt,name=receiveUserId,proto3" json:"receiveUserId,omitempty"` //接收方用户ID
-	ReceiveName   string `protobuf:"bytes,3,opt,name=receiveName,proto3" json:"receiveName,omitempty"`     //接收方用户名
-	SendUserId    string `protobuf:"bytes,4,opt,name=sendUserId,proto3" json:"sendUserId,omitempty"`       //发送方用户ID
-	SendName      string `protobuf:"bytes,5,opt,name=sendName,proto3" json:"sendName,omitempty"`           //发送方用户名
-	Title         string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"`                 //主题
-	Content       string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"`             //内容
-	MsgType       int64  `protobuf:"varint,8,opt,name=msgType,proto3" json:"msgType,omitempty"`            //消息类型 1:客服   2:系统通知  3:营销   4:用户会话
-	Link          string `protobuf:"bytes,9,opt,name=link,proto3" json:"link,omitempty"`                   //跳转链接
-	CiteId        int64  `protobuf:"varint,10,opt,name=citeId,proto3" json:"citeId,omitempty"`             //引用id
-	IsRead        int64  `protobuf:"varint,11,opt,name=isRead,proto3" json:"isRead,omitempty"`             //已读未读 0:未读  1:已读
-	Createtime    string `protobuf:"bytes,12,opt,name=createtime,proto3" json:"createtime,omitempty"`
-	Appid         string `protobuf:"bytes,13,opt,name=appid,proto3" json:"appid,omitempty"` //应用标识
+	Code    int64     `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`      //状态码
+	Message string    `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` //响应消息
+	Data    *Messages `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`       //
 }
 
 func (x *MessageDetailResp) Reset() {
@@ -961,95 +999,25 @@ func (*MessageDetailResp) Descriptor() ([]byte, []int) {
 	return file_message_proto_rawDescGZIP(), []int{12}
 }
 
-func (x *MessageDetailResp) GetId() int64 {
-	if x != nil {
-		return x.Id
-	}
-	return 0
-}
-
-func (x *MessageDetailResp) GetReceiveUserId() string {
-	if x != nil {
-		return x.ReceiveUserId
-	}
-	return ""
-}
-
-func (x *MessageDetailResp) GetReceiveName() string {
-	if x != nil {
-		return x.ReceiveName
-	}
-	return ""
-}
-
-func (x *MessageDetailResp) GetSendUserId() string {
+func (x *MessageDetailResp) GetCode() int64 {
 	if x != nil {
-		return x.SendUserId
-	}
-	return ""
-}
-
-func (x *MessageDetailResp) GetSendName() string {
-	if x != nil {
-		return x.SendName
-	}
-	return ""
-}
-
-func (x *MessageDetailResp) GetTitle() string {
-	if x != nil {
-		return x.Title
-	}
-	return ""
-}
-
-func (x *MessageDetailResp) GetContent() string {
-	if x != nil {
-		return x.Content
-	}
-	return ""
-}
-
-func (x *MessageDetailResp) GetMsgType() int64 {
-	if x != nil {
-		return x.MsgType
-	}
-	return 0
-}
-
-func (x *MessageDetailResp) GetLink() string {
-	if x != nil {
-		return x.Link
-	}
-	return ""
-}
-
-func (x *MessageDetailResp) GetCiteId() int64 {
-	if x != nil {
-		return x.CiteId
-	}
-	return 0
-}
-
-func (x *MessageDetailResp) GetIsRead() int64 {
-	if x != nil {
-		return x.IsRead
+		return x.Code
 	}
 	return 0
 }
 
-func (x *MessageDetailResp) GetCreatetime() string {
+func (x *MessageDetailResp) GetMessage() string {
 	if x != nil {
-		return x.Createtime
+		return x.Message
 	}
 	return ""
 }
 
-func (x *MessageDetailResp) GetAppid() string {
+func (x *MessageDetailResp) GetData() *Messages {
 	if x != nil {
-		return x.Appid
+		return x.Data
 	}
-	return ""
+	return nil
 }
 
 type GetLastMessageReq struct {
@@ -1182,7 +1150,7 @@ var File_message_proto protoreflect.FileDescriptor
 
 var file_message_proto_rawDesc = []byte{
 	0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
-	0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa0, 0x02, 0x0a, 0x0e, 0x53, 0x65, 0x6e,
+	0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xd0, 0x03, 0x0a, 0x0e, 0x53, 0x65, 0x6e,
 	0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x72,
 	0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
 	0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49,
@@ -1200,7 +1168,18 @@ var file_message_proto_rawDesc = []byte{
 	0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x16, 0x0a,
 	0x06, 0x63, 0x69, 0x74, 0x65, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63,
 	0x69, 0x74, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x0a,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x22, 0x5f, 0x0a, 0x17, 0x43,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69,
+	0x73, 0x64, 0x65, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x73, 0x64, 0x65,
+	0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a,
+	0x08, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x08, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x63,
+	0x65, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
+	0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73,
+	0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x0a, 0x73, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x75,
+	0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x5f, 0x0a, 0x17, 0x43,
 	0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
 	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
 	0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x53, 0x74,
@@ -1279,86 +1258,70 @@ var file_message_proto_rawDesc = []byte{
 	0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70,
 	0x69, 0x64, 0x22, 0x22, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x74,
 	0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xeb, 0x02, 0x0a, 0x11, 0x4d, 0x65, 0x73, 0x73, 0x61,
-	0x67, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02,
-	0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0d,
-	0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72,
-	0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4e, 0x61, 0x6d,
-	0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
-	0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72,
-	0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x6e, 0x64, 0x55, 0x73,
-	0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x4e, 0x61, 0x6d, 0x65,
-	0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x4e, 0x61, 0x6d, 0x65,
-	0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
-	0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
-	0x12, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69,
-	0x6e, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x16,
-	0x0a, 0x06, 0x63, 0x69, 0x74, 0x65, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
-	0x63, 0x69, 0x74, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x52, 0x65, 0x61, 0x64,
-	0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1e,
-	0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14,
-	0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61,
-	0x70, 0x70, 0x69, 0x64, 0x22, 0x5b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x4d,
-	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 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, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61,
-	0x70, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69,
-	0x64, 0x22, 0x68, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73,
-	0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65,
-	0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01,
-	0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xb2, 0x05, 0x0a, 0x07,
-	0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x47, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x6e, 0x67,
-	0x65, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65,
-	0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x61, 0x64,
-	0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e,
-	0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
-	0x12, 0x39, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x12,
-	0x17, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73,
-	0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
-	0x67, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x13, 0x44,
-	0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61,
-	0x67, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x44, 0x65, 0x6c,
-	0x65, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
-	0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
-	0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x15, 0x44, 0x65,
-	0x6c, 0x65, 0x74, 0x65, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73,
-	0x61, 0x67, 0x65, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x44, 0x65,
-	0x6c, 0x65, 0x74, 0x65, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73,
-	0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a,
-	0x0e, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12,
-	0x1e, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x72,
-	0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
-	0x1f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x72,
-	0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
-	0x12, 0x3f, 0x0a, 0x0b, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x12,
-	0x17, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73,
-	0x65, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
-	0x67, 0x65, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x65,
-	0x73, 0x12, 0x57, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x55, 0x6e, 0x72,
-	0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
-	0x67, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x55, 0x6e, 0x72, 0x65, 0x61,
-	0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x73, 0x73,
-	0x61, 0x67, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75,
-	0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0e, 0x47, 0x65,
-	0x74, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x2e, 0x6d,
-	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x65,
-	0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
+	0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x68, 0x0a, 0x11, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63,
+	0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
+	0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x64, 0x61, 0x74,
+	0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
+	0x22, 0x5b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x52, 0x65, 0x71, 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, 0x18, 0x0a,
+	0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07,
+	0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
+	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x22, 0x68, 0x0a,
+	0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52,
+	0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x12, 0x25, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11,
+	0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xb2, 0x05, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73,
+	0x61, 0x67, 0x65, 0x12, 0x47, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x61,
+	0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74,
+	0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73,
+	0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0b,
+	0x53, 0x65, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x17, 0x2e, 0x6d, 0x65,
+	0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71,
+	0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52,
+	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74,
+	0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x23,
+	0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53,
+	0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75,
+	0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65,
+	0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
+	0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
+	0x25, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
+	0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52,
+	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x47, 0x65, 0x74,
+	0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x6d, 0x65,
+	0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43,
+	0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65,
+	0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43,
+	0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0b,
+	0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x17, 0x2e, 0x6d, 0x65,
+	0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x73,
+	0x67, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x46,
+	0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x12, 0x57, 0x0a,
+	0x13, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43,
+	0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x47,
+	0x65, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75,
+	0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e,
+	0x47, 0x65, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65,
+	0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73,
+	0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
 	0x67, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
-	0x65, 0x52, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x11, 0x46, 0x69, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73,
-	0x61, 0x67, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x2e, 0x6d, 0x65, 0x73, 0x73,
-	0x61, 0x67, 0x65, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69,
-	0x6c, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d,
-	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70,
-	0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x47,
+	0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73,
+	0x12, 0x4a, 0x0a, 0x11, 0x46, 0x69, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44,
+	0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e,
+	0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71,
+	0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x62, 0x06, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -1393,30 +1356,31 @@ var file_message_proto_goTypes = []interface{}{
 }
 var file_message_proto_depIdxs = []int32{
 	8,  // 0: message.FindUserMsgRes.data:type_name -> message.Messages
-	8,  // 1: message.GetLastMessageRes.data:type_name -> message.Messages
-	1,  // 2: message.Message.ChangeReadStatus:input_type -> message.ChangeReadStatusRequest
-	0,  // 3: message.Message.SendUserMsg:input_type -> message.SendMsgRequest
-	2,  // 4: message.Message.DeleteSingleMessage:input_type -> message.DeleteSingleMessageRequest
-	3,  // 5: message.Message.DeleteMultipleMessage:input_type -> message.DeleteMultipleMessageRequest
-	4,  // 6: message.Message.GetUnreadCount:input_type -> message.GetUnreadCountRequest
-	7,  // 7: message.Message.FindUserMsg:input_type -> message.FindUserMsgReq
-	10, // 8: message.Message.GetClassUnreadCount:input_type -> message.GetClassUnreadCountReq
-	13, // 9: message.Message.GetLastMessage:input_type -> message.GetLastMessageReq
-	11, // 10: message.Message.FindMessageDetail:input_type -> message.MessageDetailReq
-	5,  // 11: message.Message.ChangeReadStatus:output_type -> message.Response
-	5,  // 12: message.Message.SendUserMsg:output_type -> message.Response
-	5,  // 13: message.Message.DeleteSingleMessage:output_type -> message.Response
-	5,  // 14: message.Message.DeleteMultipleMessage:output_type -> message.Response
-	6,  // 15: message.Message.GetUnreadCount:output_type -> message.GetUnreadCountResponse
-	9,  // 16: message.Message.FindUserMsg:output_type -> message.FindUserMsgRes
-	6,  // 17: message.Message.GetClassUnreadCount:output_type -> message.GetUnreadCountResponse
-	14, // 18: message.Message.GetLastMessage:output_type -> message.GetLastMessageRes
-	12, // 19: message.Message.FindMessageDetail:output_type -> message.MessageDetailResp
-	11, // [11:20] is the sub-list for method output_type
-	2,  // [2:11] is the sub-list for method input_type
-	2,  // [2:2] is the sub-list for extension type_name
-	2,  // [2:2] is the sub-list for extension extendee
-	0,  // [0:2] is the sub-list for field type_name
+	8,  // 1: message.MessageDetailResp.data:type_name -> message.Messages
+	8,  // 2: message.GetLastMessageRes.data:type_name -> message.Messages
+	1,  // 3: message.Message.ChangeReadStatus:input_type -> message.ChangeReadStatusRequest
+	0,  // 4: message.Message.SendUserMsg:input_type -> message.SendMsgRequest
+	2,  // 5: message.Message.DeleteSingleMessage:input_type -> message.DeleteSingleMessageRequest
+	3,  // 6: message.Message.DeleteMultipleMessage:input_type -> message.DeleteMultipleMessageRequest
+	4,  // 7: message.Message.GetUnreadCount:input_type -> message.GetUnreadCountRequest
+	7,  // 8: message.Message.FindUserMsg:input_type -> message.FindUserMsgReq
+	10, // 9: message.Message.GetClassUnreadCount:input_type -> message.GetClassUnreadCountReq
+	13, // 10: message.Message.GetLastMessage:input_type -> message.GetLastMessageReq
+	11, // 11: message.Message.FindMessageDetail:input_type -> message.MessageDetailReq
+	5,  // 12: message.Message.ChangeReadStatus:output_type -> message.Response
+	5,  // 13: message.Message.SendUserMsg:output_type -> message.Response
+	5,  // 14: message.Message.DeleteSingleMessage:output_type -> message.Response
+	5,  // 15: message.Message.DeleteMultipleMessage:output_type -> message.Response
+	6,  // 16: message.Message.GetUnreadCount:output_type -> message.GetUnreadCountResponse
+	9,  // 17: message.Message.FindUserMsg:output_type -> message.FindUserMsgRes
+	6,  // 18: message.Message.GetClassUnreadCount:output_type -> message.GetUnreadCountResponse
+	14, // 19: message.Message.GetLastMessage:output_type -> message.GetLastMessageRes
+	12, // 20: message.Message.FindMessageDetail:output_type -> message.MessageDetailResp
+	12, // [12:21] is the sub-list for method output_type
+	3,  // [3:12] is the sub-list for method input_type
+	3,  // [3:3] is the sub-list for extension type_name
+	3,  // [3:3] is the sub-list for extension extendee
+	0,  // [0:3] is the sub-list for field type_name
 }
 
 func init() { file_message_proto_init() }

+ 9 - 9
rpc/messageclient/message.go

@@ -8,27 +8,27 @@ package messageclient
 import (
 	"context"
 
-	"rpc/message"
+	"app.yhyue.com/moapp/MessageCenter/rpc/message"
 
 	"github.com/tal-tech/go-zero/zrpc"
 )
 
 type (
+	ChangeReadStatusRequest      = message.ChangeReadStatusRequest
+	MessageDetailReq             = message.MessageDetailReq
+	SendMsgRequest               = message.SendMsgRequest
+	Response                     = message.Response
+	GetUnreadCountResponse       = message.GetUnreadCountResponse
+	FindUserMsgReq               = message.FindUserMsgReq
 	Messages                     = message.Messages
+	MessageDetailResp            = message.MessageDetailResp
 	GetLastMessageReq            = message.GetLastMessageReq
+	GetLastMessageRes            = message.GetLastMessageRes
 	DeleteSingleMessageRequest   = message.DeleteSingleMessageRequest
 	DeleteMultipleMessageRequest = message.DeleteMultipleMessageRequest
 	GetUnreadCountRequest        = message.GetUnreadCountRequest
 	FindUserMsgRes               = message.FindUserMsgRes
 	GetClassUnreadCountReq       = message.GetClassUnreadCountReq
-	MessageDetailResp            = message.MessageDetailResp
-	SendMsgRequest               = message.SendMsgRequest
-	ChangeReadStatusRequest      = message.ChangeReadStatusRequest
-	FindUserMsgReq               = message.FindUserMsgReq
-	Response                     = message.Response
-	GetUnreadCountResponse       = message.GetUnreadCountResponse
-	MessageDetailReq             = message.MessageDetailReq
-	GetLastMessageRes            = message.GetLastMessageRes
 
 	Message interface {
 		//  修改消息阅读状态

+ 31 - 19
service/messageService.go

@@ -72,18 +72,18 @@ func (service *MessageService) CountUnread(userId string, appId string) (int64,
 }
 
 // 获取指定用户指定分类最新一条未读消息
-func (service *MessageService)LastMessage(userId string, appId string, msgType int64) ( *message.Messages,error) {
+func (service *MessageService) LastMessage(userId string, appId string, msgType int64) (*message.Messages, error) {
 	orm := entity.Engine.NewSession()
 	log.Println("123")
 	defer orm.Close()
 	m1 := []*entity.Message{}
 	//m := []*message.Messages{}
-	err := orm.Select("*").Where("receive_userid=? and isdel=1 and appid=? and isRead=0 and msg_type=?", userId, appId, msgType).OrderBy("createtime desc").Limit(1,0).Find(&m1)
+	err := orm.Select("*").Where("receive_userid=? and isdel=1 and appid=? and isRead=0 and msg_type=?", userId, appId, msgType).OrderBy("createtime desc").Limit(1, 0).Find(&m1)
 
 	if err != nil {
 		log.Println(err)
 		log.Println("咋回事")
-		return nil ,errors.New("查询未读消息失败")
+		return nil, errors.New("查询未读消息失败")
 	}
 	//msg := message.Messages{
 	//	Appid:         m.AppId,
@@ -100,26 +100,38 @@ func (service *MessageService)LastMessage(userId string, appId string, msgType i
 	//	IsRead:        int64(m.IsRead),
 	//}
 	//log.Println(count)
-	if len(m1)>0{
+	if len(m1) > 0 {
 		m := m1[0]
 		msg := message.Messages{
-				Appid:         m.AppId,
-				ReceiveUserId: m.ReceiveUserid,
-				ReceiveName:   m.ReceiveName,
-				SendUserId:    m.SendUserid,
-				SendName:      m.SendName,
-				Createtime:    m.CreateTime.Format("2006-01-02 15:04:05"),
-				Title:         m.Title,
-				MsgType:       int64(m.MsgType),
-				Link:          m.Link,
-				CiteId:        int64(m.CiteId),
-				Content:       m.Content,
-				IsRead:        int64(m.IsRead),
+			Appid:         m.AppId,
+			ReceiveUserId: m.ReceiveUserid,
+			ReceiveName:   m.ReceiveName,
+			SendUserId:    m.SendUserid,
+			SendName:      m.SendName,
+			Createtime:    m.CreateTime.Format("2006-01-02 15:04:05"),
+			Title:         m.Title,
+			MsgType:       int64(m.MsgType),
+			Link:          m.Link,
+			CiteId:        int64(m.CiteId),
+			Content:       m.Content,
+			IsRead:        int64(m.IsRead),
 		}
-		return &msg,nil
-	}else {
-		return nil,nil
+		return &msg, nil
+	} else {
+		return nil, nil
 
 	}
 
 }
+
+//查询消息详情
+func FindMessageDetail(id int64) (entity.Message, error) {
+	orm := entity.Engine.NewSession()
+	defer orm.Close()
+	mess := entity.Message{}
+	err := orm.Table("message").Select("*").Where("id = ?", id).Find(&mess)
+	if err != nil {
+		return mess, err
+	}
+	return mess, nil
+}