syntax = "proto3"; package message; message SendMsgRequest { string receiveUserId = 1; //接收方用户ID string receiveName = 2; //接收方用户名 string sendUserId = 3; //发送方用户ID string sendName = 4; //发送方用户名 string title = 5; //主题 string content = 6; //内容 int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话 string link = 8; //跳转链接 int64 citeId = 9; //引用id string appid = 10; //应用标识 } message ChangeReadStatusRequest { string id = 1; // 消息id int64 readStatus = 2; // 阅读状态 0-未读 1-已读 string appid = 3; //应用标识 } message ResCount { int64 msgType = 1; // 类型及未读数量 int64 count = 2; // 类型及未读数量 } // 删除单一消息 message DeleteSingleMessageRequest { string id = 1; // 消息id string appid = 3; //应用标识 } // 批量删除消息 message DeleteMultipleMessageRequest { string id = 1; // 多条消息id, 逗号分隔 string appid = 3; //应用标识 } // 查询指定用户未读消息合计 message GetUnreadCountRequest { string userId = 1; // 用户id string appid = 2; //应用标识 } message Response { int64 code = 1; //状态码 string message = 2; //响应消息 } message GetUnreadCountResponse { int64 code = 1; //状态码 string message = 2; //响应消息 int64 count = 3; // } message FindUserMsgReq { string userId = 1; //用户id string receiveUserId = 2; //聊天方用户id string appid = 3; //应用标识 int64 offSet = 4; //当前 int64 pageSize = 5; //大小 int64 msgType = 6; //是否区分类型 int64 read = 7; // 是否区分已读未读 -1 不区分已读未读 0 未读 1 已读 } message Messages { string receiveUserId = 1; //接收方用户ID string receiveName = 2; //接收方用户名 string sendUserId = 3; //发送方用户ID string sendName = 4; //发送方用户名 string title = 5; //主题 string content = 6; //内容 int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话 string link = 8; //跳转链接 int64 citeId = 9; //引用id int64 isRead = 10; //已读未读 0:未读 1:已读 string createtime = 11; string appid = 12; //应用标识 string id = 13; //消息id } message FindUserMsgRes { int64 code = 1; //状态码 string message = 2; //响应消息 repeated Messages data = 3; // int64 count = 4; //总数 } message GetClassUnreadCountReq { string userId = 1; // 用户id int64 msgType = 2; //分类 1:客服 2:系统通知 3:营销 4:用户会话 string appid = 3; //应用标识 } //查看消息内容 message MessageDetailReq { string id = 1; //消息id } message MessageDetailResp { int64 code = 1; //状态码 string message = 2; //响应消息 Messages data = 3; // } message GetLastMessageReq { string userId = 1; // 用户id int64 msgType = 2; //分类 1:客服 2:系统通知 3:营销 4:用户会话 string appid = 3; //应用标识 int64 isRead = 4; // 0:未读 1:已读 -1 不区分 } message GetLastMessageRes { int64 code = 1; //状态码 string message = 2; //响应消息 Messages data = 3; // } // 获取用户分类的的未读消息分类及数量 及分类下最新的消息 message GetUnreadClassCountReq { string userId = 1; // 用户id string appid = 2; //应用标识 bool needMsg = 3; //是否需要分类下的最新一条消息 } message GetUnreadClassCountRes { int64 code = 1; //状态码 string message = 2; //响应消息 repeated ResCount data = 3; // repeated Messages info = 4; // 每个类型最新消息列表 } message GetMsgTypeReq { string userId = 1; // 用户id string appid = 2; //应用标识 } message GetMsgTypeRes { int64 code = 1; //状态码 string message = 2; //响应消息 repeated int64 data = 3; // } //更新分类下消息状态 已读、未读 message UpdateMessageReadReq { int64 msgType = 1; string receiveUserid = 2; string appId = 3; } message UpdateMessageReadResp { int64 code = 1; //状态码 string message = 2; //响应消息 int64 status = 3; } message user { string userId = 1; string userName = 2; } message multipleSaveMsgReq { string userIds = 1; string userNames = 2; string sendUserId = 3; //发送方用户ID string sendName = 4; //发送方用户名 string title = 5; //主题 string content = 6; //内容 int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话 string link = 8; //跳转链接 int64 citeId = 9; //引用id string appid = 10; //应用标识 } message multipleSaveMsgResp { int64 code = 1; //状态码 string message = 2; //响应消息 int64 errCount = 3; // 保存出错数量 } service Message { //批量保存消息 rpc multipleSaveMsg (multipleSaveMsgReq) returns (multipleSaveMsgResp); // 修改消息阅读状态 rpc ChangeReadStatus (ChangeReadStatusRequest) returns (Response); //指定用户发消息 rpc SendUserMsg (SendMsgRequest) returns (Response); // 删除单一消息 rpc DeleteSingleMessage (DeleteSingleMessageRequest) returns (Response); // 删除多条消息 rpc DeleteMultipleMessage (DeleteMultipleMessageRequest) returns (Response); // 查询指定用户未读消息合计 rpc GetUnreadCount (GetUnreadCountRequest) returns (GetUnreadCountResponse); // 查询指定用户的历史消息记录 rpc FindUserMsg (FindUserMsgReq) returns (FindUserMsgRes); // 查询指定用户指定分类的未读消息合计 rpc GetClassUnreadCount (GetClassUnreadCountReq) returns (GetUnreadCountResponse); // 获取指定用户指定分类的最新一条消息 rpc GetLastMessage (GetLastMessageReq) returns (GetLastMessageRes); //查看详细详情 rpc FindMessageDetail (MessageDetailReq) returns (MessageDetailResp); // 获取指定用户的分类及未读消息数量 rpc GetUnreadClassCount (GetUnreadClassCountReq) returns (GetUnreadClassCountRes); // 获取指定用户收到消息的分类 rpc GetMsgType (GetMsgTypeReq) returns (GetMsgTypeRes); //修改用户指定分类下的消息已读未读 rpc UpdateMessageRead (UpdateMessageReadReq) returns (UpdateMessageReadResp); }