syntax = "proto3"; package message; option go_package = "message/"; message ChangeReadStatusReq { int64 id = 1; // 消息id int64 readStatus = 2; // 阅读状态 0-未读 1-已读 string appid = 3; //应用标识 string userId = 4; } message ResCount { int64 msgType = 1; // 类型及未读数量 int64 count = 2; // 类型及未读数量 } message Response { int64 code = 1; //状态码 string message = 2; //响应消息 } 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 { int64 id = 1; //消息id int64 msgLogId = 2; string userId = 3; } 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 MsgTypes{ int64 msgType =1; string img = 2; string name =3; string code = 4; string displayPlatform = 5; } /*message GetMsgTypeRes { int64 code = 1; //状态码 string message = 2; //响应消息 repeated MsgTypes data = 3; // }*/ message user { string userId = 1; string userName = 2; } message multipleSaveMsgReq { string userIds = 1; string sendUserId = 3; //发送方用户ID string title = 5; //主题 string content = 6; //内容 int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话 string link = 8; //跳转链接 string appid = 10; //应用标识 int64 msgLogId = 11;//消息记录表id string positionIds = 14;// 职位id 逗号分割 string row4 = 15; string productName = 16; string orderId = 17; string orderMoney = 18; string identity = 19; string appPushUrl = 20; string wxPushUrl = 21; string iosPushUrl = 22; string baseUserIds = 23; } message CustomWxTpl { string TplId = 1; map tmplData = 2; } message TmplItem { string value = 1; string color = 2; } 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; int64 NewUserId =5;//私信相关 } 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 isColumn =9; //是否需要获取栏目 bool isColumnNewMsg = 10; //是否需各栏目获取最新消息 bool isMsgList =11; //是否需要列表信息 int64 NewUserId =12;//私信相关 int64 PositionId =13;//私信相关 bool isContainLetter =14;//是否包含私信未读数 bool isClassSearch =15;// 是否是消息细化分类查询 } message UserMsgListRes { int64 code = 1; //状态码 string message = 2; //响应消息 repeated Messages list = 3; // Messages last = 4; // repeated AllSortData column = 5; // int64 count = 6; //总数 int64 unread = 7; //未读总数 int64 toDoUnread = 8; //待办未读数量 } message UserMsgList { repeated Messages data = 1; // repeated AllSortData sortData = 2; // int64 count = 3; //总数 int64 unread = 4; //未读总数 int64 toDoUnread = 5; //待办未读数量 } message AllSortData { int64 unreadMessages =1 ; string name =2; string img = 3; int64 msgType = 4; //是否区分类型; repeated Messages data = 5; // bool isClassSearch =6;// 是否是消息细化分类查询 } message WxTmplResponse { int64 sendTotal = 1; //发送数量 string message = 2; //信息 } /*message UserUnreadMsgListReq { string userId = 1; //用户id string appid = 3; //应用标识 int64 offSet = 4; //当前 int64 pageSize = 5; //大小 int64 isNeedData = 6; //是否需要未读的消息数据,0 不需要 1需要 }*/ /*message UserUnreadMsgListRes { int64 code = 1; //状态码 string message = 2; //响应消息 repeated Messages list = 3; int64 count = 4; //总数 }*/ // 剑鱼系统通用模版 message WxTmplMsgRequest { string userIds = 1; //接受人 mongo_userId(多个用,分割) string positionIds = 2; //接受人 职位id(多个用,分割) int64 msgType =3; //数据库中switch字段 string title = 4; //课程名称 string detail = 5; //课程时间 string date = 6; //课程地点 string row4 =7; string url = 8; //消息跳转连接 } message SendMsgResponse { int64 total = 1; //发送数量 string message = 2; //响应消息 } message MsgOpenLogReq{ int64 msgLogId =1; int64 platform =2; string userId = 3; string appId = 4; } //新用户消息调用接口 message NewUserInsertMsgReq{ string userIds = 1; string title = 5; //主题 string content = 6; //内容 int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话 string link = 8; //跳转链接 string appid = 10; //应用标识 int64 msgLogId = 11;//消息记录表id string positionIds = 14;// 职位id 逗号分割 string row4 = 15; string productName = 16; string orderId = 17; string orderMoney = 18; string identity = 19; string appPushUrl = 20; string wxPushUrl = 21; string iosPushUrl = 22; } message UpdateMsgSummaryReq{ int64 msgLogId = 1; int64 groupId = 2; int64 msgType = 3; } message BitmapSaveMsgReq{ string userIds = 1; string title = 5; //主题 string content = 6; //内容 int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话 string link = 8; //跳转链接 string appid = 10; //应用标识 int64 msgLogId = 11;//消息记录表id string positionIds = 14;// 职位id 逗号分割 string row4 = 15; string productName = 16; string orderId = 17; string orderMoney = 18; string identity = 19; string appPushUrl = 20; string wxPushUrl = 21; string iosPushUrl = 22; string baseUserIds = 23; string sendUserId = 24; } service Message { //发送消息更新一次消息汇总表 rpc UpdateMsgSummary (UpdateMsgSummaryReq) returns (Response); //新用户发送消息 rpc NewUserMsg (NewUserInsertMsgReq) returns (Response); //bitmap保存消息 rpc bitmapSaveMsg (multipleSaveMsgReq) returns (multipleSaveMsgResp); //批量保存消息 rpc multipleSaveMsg (multipleSaveMsgReq) returns (multipleSaveMsgResp); // 修改消息阅读状态 rpc ChangeReadStatus (ChangeReadStatusReq) returns (Response); // 查询指定用户的历史消息记录 rpc FindUserMsg (FindUserMsgReq) returns (FindUserMsgRes); //查看详细详情 rpc FindMessageDetail (MessageDetailReq) returns (MessageDetailResp); // 消息的分类 // rpc GetMsgType (GetMsgTypeReq) returns (GetMsgTypeRes); // 查询指定用户的浮标消息 rpc FindUserBuoyMsg (FindUserBuoyMsgReq) returns (FindUserBuoyMsgRes); // 一键清空未读消息 rpc ClearUnreadMsg (ClearUnreadMsgReq) returns (Response); // new用户消息列表 rpc UserMsgList (UserMsgListReq) returns (UserMsgListRes); // 发送剑鱼微信模版消息 rpc SendWxTmplMsg (WxTmplMsgRequest) returns(SendMsgResponse); // 官网、移动端首页、工作桌面消息滚动 // rpc UserUnreadMsgList (UserUnreadMsgListReq) returns (UserUnreadMsgListRes); // 点击消息-存查看记录 rpc MsgOpenLog (MsgOpenLogReq) returns (Response); // 发送剑鱼微信模版消息 rpc AppLetterPush (WxTmplMsgRequest) returns(SendMsgResponse); }