syntax = "proto3"; package message; option go_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 ChangeReadStatusReq { string id = 1; // 消息id int64 readStatus = 2; // 阅读状态 0-未读 1-已读 string appid = 3; //应用标识 } message ResCount { int64 msgType = 1; // 类型及未读数量 int64 count = 2; // 类型及未读数量 } // 查询指定用户未读消息合计 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 int64 msgLogId = 14; map url = 15; } 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 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; //应用标识 int64 msgLogId = 11;//消息记录表id int64 showBuoy = 12;//是否展示为浮标 string showContent =13;//展示文案 string positionIds = 14;// 职位id 逗号分割 } message multipleSaveMsgResp { int64 code = 1; //状态码 string message = 2; //响应消息 int64 errCount = 3; // 保存出错数量 } message FindUserBuoyMsgReq { string userId = 1; //用户id string appid = 2; //应用标识 int64 pageSize = 3; //大小 } message FindUserBuoyMsgRes { int64 code = 1; //状态码 string message = 2; //响应消息 repeated BuoyMessages data = 3; // } message BuoyMessages { string id = 1; //消息id string buoy_detail = 2; //浮标内容 string pcUrl =3; string androidUrl = 4; string iosUrl = 5; string weChatUrl =6; } message ClearUnreadMsgReq { string userid = 1; //mgoId int64 entId = 2; int64 positionId = 3; //职位id string appId = 4; } message UserMsgListReq { string userId = 1; //用户id string appid = 3; //应用标识 int64 offSet = 4; //当前 int64 pageSize = 5; //大小 int64 msgType = 6; //是否区分类型 int64 read = 7; // 是否区分已读未读 -1 不区分已读未读 0 未读 1 已读 int64 SortSize = 8; //分类 每类数 bool isPc = 9; bool mobileHome = 10; } message UserMsgListRes { int64 code = 1; //状态码 string message = 2; //响应消息 repeated Messages list = 3; // Messages last = 4; // repeated AllSortData column = 5; // int64 count = 6; //总数 } message UserMsgList { repeated Messages data = 1; // repeated AllSortData sortData = 2; // int64 count = 3; //总数 } // 发送微信模版消息 message WxTmplMsg { string appid = 1; //应用标识 string userIds = 2; //接受人 mongo_userId(多个用,分割) string openIds = 3; //接受人 openid(多个用,分割) string positionIds = 4; //接受人 职位id string url = 5; //消息跳转连接 int64 msgType = 6; //信息类型 附件、图片、链接类型 string tmplId = 7; //消息模版id 根据此字段判断发送模版 } message AllSortData { int64 unreadMessages =1 ; string name =2; string img = 3; int64 msgType = 4; //是否区分类型; repeated Messages data = 5; // } message WxTmplResponse { int64 sendTotal = 1; //发送数量 string message = 2; //信息 } service Message { //批量保存消息 rpc multipleSaveMsg (multipleSaveMsgReq) returns (multipleSaveMsgResp); // 修改消息阅读状态 rpc ChangeReadStatus (ChangeReadStatusReq) returns (Response); //指定用户发消息 rpc SendUserMsg (SendMsgRequest) 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 FindUserBuoyMsg (FindUserBuoyMsgReq) returns (FindUserBuoyMsgRes); // 一键清空未读消息 rpc ClearUnreadMsg (ClearUnreadMsgReq) returns (Response); // new用户消息列表 rpc UserMsgList (UserMsgListReq) returns (UserMsgListRes); // 发送微信模版消息 rpc SendWxTmplMsg (WxTmplMsg) returns(Response); }