Hibok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

481 line
17 KiB

  1. syntax = "proto2";
  2. package yl_pb;
  3. enum ChatChannelType {
  4. Session = 0; //会话
  5. Group = 1; //群组
  6. CSD =2; //客服频道
  7. }
  8. enum ChatType {
  9. TextChatType = 0; //文字聊天
  10. ImageChatType = 1; //图片
  11. ShortVoiceChatType = 2; //短语音
  12. ShortVideoChatType = 3; //短视频
  13. RealtimeCallVoiceType = 4; //实时通话-语音
  14. RealtimeCallVideoType = 5; //实时通话-视频
  15. RedWalletChatType = 6; //红包
  16. PlaceChatType = 7; //地址类型
  17. EmoticonType = 8; //表情
  18. GroupChatNoticeType = 9; //群公告类型
  19. GiftChatType = 10; //礼物聊天类型
  20. FileChatType = 11; //文件聊天类型
  21. }
  22. enum RedWalletState {
  23. Uncollected = 0; //未领取
  24. Received = 1; //已领取
  25. Expire = 2; //过期
  26. }
  27. //用户间翻译状态
  28. enum TranslateState{
  29. NoPerson = 0;//没有翻译人员在线
  30. SameLan = 1;//同一语言
  31. Unopen = 2;//没有开启人工翻译
  32. Opend = 3; //已经开启人工翻译
  33. }
  34. //红包数据
  35. message RedWallet {
  36. optional string OrderId = 1;
  37. optional uint32 SuId = 2; //发送者Id
  38. optional uint32 TuId = 3; //接收者Id
  39. optional string Title = 4;
  40. optional uint32 Amount = 5;
  41. optional RedWalletState State = 6;
  42. optional int64 RecTime = 7; //领取时间
  43. }
  44. message BaseUserInfo {
  45. optional uint32 Id = 1; //用户Id
  46. optional string NiceName =2; //昵称
  47. optional string HeadUrl =3; //头像Id
  48. }
  49. enum ChatNiceoType {
  50. GroupAddMember = 1; //聊天群-加入用户
  51. GroupRemoveMember = 2; //聊天群-移除用户
  52. }
  53. message ChatNiceo {
  54. optional ChatNiceoType NictoType = 1; //公告类型
  55. optional string NictoMsg = 2; //公告消息
  56. }
  57. message GiftChat {
  58. optional uint32 SuId = 1; //发送者Id
  59. optional uint32 TuId = 2; //接收者Id
  60. optional uint32 GiftId = 3; //礼物Id
  61. optional string GiftName = 4; //礼物名称
  62. optional uint32 GiftAmount = 5; //礼物数量
  63. optional uint32 Money = 6; //钱
  64. }
  65. message FileChat {
  66. optional string Type = 1; //文件类型
  67. optional uint32 Size = 2; //文件大小
  68. optional string Name = 3; //文件名称
  69. }
  70. //引用消息数据结构
  71. message QuoteMsg{
  72. optional ChatChannelType ChannelType = 1; //发送频道类型
  73. optional uint32 TargetId = 2; //发送目标Id SessionId or GroudId
  74. optional uint32 SendUserId = 3; //消息发送者
  75. optional int64 SendTime = 4; //发送时间
  76. optional string Content = 5; //消息附件地址
  77. }
  78. //-------------------------------------------------------------------------消息--------------------------------------------------------------------------------------------------
  79. // MsgId=1 聊天消息发送请求
  80. message ChatSendReq {
  81. optional ChatChannelType ChannelType = 1; //发送频道类型
  82. optional uint32 TargetId = 2; //发送目标Id SessionId or GroudId
  83. optional int64 SendTime = 3; //发送时间
  84. optional ChatType CType = 4; //聊天类型 //文字 图片 短语音 短视频
  85. optional bytes ContentBuff = 5; //内容数据 10k 最大
  86. optional uint32 ContentSzie = 6; //内容大小
  87. optional string EnclosureUrl = 7; //消息附件地址
  88. repeated uint32 AltUserIds = 8; //alt用户id
  89. optional bytes QuoteMsg =9; //引用消息
  90. }
  91. // MsgId=2 聊天消息发送请求回应
  92. message ChatSendRes {
  93. optional int32 ErrorCode = 1; //0发送成功 1参数异常
  94. optional ChatChannelType ChannelType = 2; //发送频道类型
  95. optional uint32 TargetId = 3; //发送目标Id SessionId or GroudId
  96. optional int64 SendTime = 4; //聊天消息Id
  97. }
  98. // MsgId=3 推送用户聊天消息
  99. message PushChat {
  100. optional ChatChannelType ChannelType = 1; //发送频道类型
  101. optional uint32 TargetId = 2; //发送目标Id SessionId or GroudId
  102. optional uint32 SendUserId = 3; //发送者Id 0 通知消息 1 更新消息 非这两种未用户发送消息
  103. optional int64 SendTime = 4; //发送时间
  104. optional ChatType CType = 5; //聊天类型 //文字 图片 短语音 短视频
  105. optional bytes ContentBuff = 6; //内容数据 10k 最大
  106. optional uint32 ContentSzie = 7; //内容大小
  107. optional uint32 TranslateState = 8; //翻译状态 0不翻译 1机翻 2人工翻译
  108. optional bytes TencentTranslate = 9; //Tencent翻译
  109. optional bytes GoogleTranslate = 10; //Google翻译
  110. optional bytes HumanTranslate = 11; //人工翻译翻译
  111. optional string EnclosureUrl = 12; //消息附件地址
  112. repeated uint32 AltUserIds = 13; //alt用户id
  113. optional bytes QuoteMsg =14; //引用消息
  114. }
  115. //MsgId=100 应答消息接收
  116. message AnswerPushChat {
  117. optional int64 MsgId = 1; //消息Id
  118. }
  119. // MsgId=4 用户登陆成功后推送未读消息列表
  120. message PushUserUnreadMsgNotice {
  121. repeated UserUnreadMsgNotice Notices = 2;
  122. }
  123. //未读消息描述
  124. message UnreadMsgDes {
  125. optional uint32 SendUserId = 1; //发送者Id 0 通知消息 1 更新消息 非这两种未用户发送消息
  126. optional int64 SendTime = 2; //发送时间
  127. optional ChatType CType = 3; //聊天类型 //文字 图片 短语音 短视频
  128. optional bytes ContentBuff = 4; //内容数据 只有文字才有 其余的填空
  129. optional bytes TencentTranslate = 5; //腾讯翻译
  130. optional bytes GoogleTranslate = 6; //google翻译
  131. }
  132. message UserUnreadMsgNotice {
  133. optional ChatChannelType ChannelType = 1; //发送频道类型
  134. optional uint32 TargetId = 2; //发送目标Id SessionId or GroudId
  135. optional uint32 UnreadMsgNum = 3; //未读消息数量
  136. optional UnreadMsgDes LastUnreadMsg = 4; //最后一条未读消息
  137. }
  138. // MsgId=5 请求目标未读消息
  139. message RequestTargetUnreadReq {
  140. optional ChatChannelType ChannelType = 1; //发送频道类型
  141. optional uint32 TargetId = 2; //发送目标Id SessionId or GroudId
  142. }
  143. // MsgId=6 请求目标未读消息回应
  144. message RequestTargetUnreadRes {
  145. optional int32 ErrorCode = 1; //0发送成功 1参数异常
  146. }
  147. // MsgId=7 请求设置人工翻译
  148. message RequestSetHTranslReq {
  149. optional uint32 SessionId = 1; //发送目标Id
  150. optional TranslateState HTransl = 2; //是否需要人工翻译
  151. }
  152. // MsgId=8 请求设置人工翻译回应
  153. message RequestSetHTranslRes {
  154. optional int32 ErrorCode = 1; // 0发送成功 1参数异常
  155. }
  156. // MsgId=9 请求设置人工翻译回应
  157. message PushHTranslState {
  158. optional uint32 SessionId = 1; //会话id
  159. optional uint32 UserId = 2; //发送目标Id
  160. optional TranslateState HTransl = 3; //是否需要人工翻译
  161. }
  162. // MsgId=10 请求实时通话
  163. message RequestRealtimeCallReq{
  164. optional uint32 TUserId = 1; //目标用户
  165. optional ChatType CType = 2; //通话类型
  166. }
  167. // MsgId=11 请求实时通话回应
  168. message RequestRealtimeCallRes{
  169. optional int32 ErrorCode = 1; // 0发送成功
  170. }
  171. // MsgId=12 推送实时通话请求
  172. message PushRealtimeCall{
  173. optional uint32 SUserId = 1; //发起通话请求用户
  174. optional ChatType CType = 2; //通话类型
  175. }
  176. // MsgId=13 请求挂断实时通话请求
  177. message RespondRealtimeCallReq{
  178. optional uint32 SUserId = 1; //发起通话请求用户
  179. optional bool IsAnswer = 2; //是否应答 true 应答 false 挂断
  180. }
  181. // MsgId=14 推送挂断实时通话请求
  182. message PushRealtimeCallRespond{
  183. optional uint32 TUserId = 1; //目标用户
  184. optional bool IsAnswer = 2; //是否应答 true 应答 false 挂断
  185. }
  186. // MsgId=17 请求送礼物
  187. message RequestGiftGivingReq{
  188. optional uint32 TargetUserId = 1; //目标用户Id
  189. optional uint32 GiftId = 2; //礼物Id
  190. optional uint32 GiftAmount = 3; //礼物数量
  191. optional uint32 Money = 4; //钱
  192. }
  193. // MsgId=18 推送送礼
  194. message PushGiftGiving{
  195. optional uint32 SendUserId = 1; //目标用户Id
  196. optional uint32 GiftId = 2; //礼物Id
  197. optional uint32 GiftAmount = 3; //礼物数量
  198. optional uint32 Money = 4; //钱
  199. }
  200. //MsgId=80 查询用户基本信息
  201. message QueryUsersInfoReq{
  202. repeated uint32 UserIds = 1;
  203. }
  204. //MsgId=81 查询用户基本信息回应
  205. message QueryUsersInfoRes{
  206. repeated BaseUserInfo Infos = 1;
  207. }
  208. //-------------------------------------------------------------------------------Session相关---------------------------------------------------------------------------------------
  209. //MsgId=101 请求创建会话
  210. message CreateSessionReq {
  211. repeated uint32 MemberIds = 1;
  212. }
  213. //MsgId=102 请求创建会话
  214. message QuerySessionReq {
  215. optional uint32 SessionId = 1;
  216. }
  217. //MsgId=103 请求创建会话回应
  218. message SessionInfoRes {
  219. optional int32 ErrorCode = 1; // 0发送成功 1参数异常
  220. optional uint32 SessionId = 2;
  221. repeated BaseUserInfo Members = 3;
  222. optional TranslateState IsNeedHTransl = 4;
  223. }
  224. //-------------------------------------------------------------------------------Group相关---------------------------------------------------------------------------------------
  225. //群身份
  226. enum GroupMemberIdentity {
  227. identityNormal = 0; //普通成员
  228. identityManager = 1; //管理员
  229. identityMaster = 2; //群主
  230. }
  231. //聊天群信息变化类型
  232. enum GroupChangeType {
  233. AddMember = 1; //加入用户
  234. RemoveMember = 2; //移除用户
  235. MasterTrans = 3; //群主转让
  236. GroupNoticeChange = 4; //群公告改变
  237. GroupNameChange = 5; //群昵称改变
  238. GroupMemberAliasChange = 6; //群成员别名改变
  239. GroupIsOpenMemberCheckChange = 7; //群设置校验成员改变
  240. GroupMemberCheckNotice = 8; //群成员校验公告
  241. QRCodeAddMemberNotice = 9; //通过二维码加入到群
  242. GroupMemberCheckAddMemberNotice = 10; //群主校验添加成员通告
  243. GroupMemberLeave = 11; //群成员离开
  244. }
  245. //群成员结构
  246. message GroupMember {
  247. optional BaseUserInfo Info = 1; //用户Id
  248. optional string Name = 2; //用户Id
  249. optional GroupMemberIdentity Identity = 3; //成员身份
  250. optional bool MessageFree = 4; //消息打扰标记
  251. optional bool EffectiveUser = 5; //有效用户 移除群成员不直接删除数据而是修改有效标签
  252. optional bool IsShowMenberNiceName =6; //是否显示成员昵称
  253. }
  254. //群结构
  255. message GroupInfo {
  256. optional uint32 Id = 1; //群Id
  257. optional uint32 Code= 2;
  258. optional string GroupName = 3; //群名称
  259. optional string Notice = 4; //群公告
  260. repeated GroupMember Members= 5; //群成员
  261. optional bool IsOpenMemberCheck = 6; //是否开启成员校验
  262. }
  263. //推送聊天群变化信息
  264. message GroupChatNotice{
  265. optional GroupChangeType ChangeType = 1; //信息改变类型
  266. optional BaseUserInfo OperatuId = 2; //操作用户Id
  267. repeated BaseUserInfo OperateduId = 3; //被操作用户Ids 有可能是多人
  268. optional string ChangeStr = 4; //改变消息
  269. optional bool ChangeBool = 5; //变化bool值
  270. }
  271. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  272. //MsgId=201 创建聊天群
  273. message CreateChatGroupReq {
  274. repeated uint32 Members = 3; //群成员
  275. }
  276. //MsgId=202 创建聊天群回应
  277. message CreateChatGroupRes {
  278. optional int32 ErrorCode = 1; //详见错误码文档
  279. optional GroupInfo Group = 2; //群信息
  280. }
  281. //MsgId=203 退出聊天群
  282. message QuitChatGroupReq {
  283. optional uint32 GroupId = 1; //群id
  284. }
  285. //MsgId=204 退出聊天群回应
  286. message QuitChatGroupRes {
  287. optional int32 ErrorCode = 1; //详见错误码文档
  288. optional uint32 GroupId = 2; //群id
  289. }
  290. //MsgId=205 查询聊天群组信息
  291. message QueryChatGroupReq {
  292. optional uint32 GroupId = 1; //群信息
  293. }
  294. //MsgId=206 查询聊天群组信息
  295. message QueryChatGroupRes {
  296. optional int32 ErrorCode = 1; //详见错误码文档
  297. optional GroupInfo Group = 2; //群信息
  298. }
  299. //MsgId=207 添加群成员
  300. message AddGroupMemberReq {
  301. optional uint32 GroupId = 1; //群信息
  302. repeated uint32 UserIds = 2; //用户Id
  303. }
  304. //MsgId=208 添加群成员回应
  305. message AddGroupMemberRes {
  306. optional int32 ErrorCode = 1; //详见错误码文档
  307. optional uint32 GroupId = 2; //群信息
  308. }
  309. //MsgId=209 移除群成员回应
  310. message RemoveGroupMemberReq {
  311. optional uint32 GroupId = 1; //群信息
  312. repeated uint32 UserIds = 2;
  313. }
  314. //MsgId=210 移除群成员回应
  315. message RemoveGroupMemberRes {
  316. optional int32 ErrorCode = 1; //详见错误码文档
  317. optional uint32 GroupId = 2; //群信息
  318. }
  319. //MsgId=211 修改群公告请求
  320. message ModifyGroupNoticeReq{
  321. optional uint32 GroupId = 1; //群信息
  322. optional string Notice = 2; //群信息
  323. }
  324. //MsgId=212 修改群公告请求回应
  325. message ModifyGroupNoticeRes {
  326. optional int32 ErrorCode = 1; //详见错误码文档
  327. optional uint32 GroupId = 2; //群信息
  328. }
  329. //MsgId=213 修改群昵称请求
  330. message ModifyGroupNameReq{
  331. optional uint32 GroupId = 1; //群信息
  332. optional string Name = 2; //群信息
  333. }
  334. //MsgId=214 修改群昵称请求回应
  335. message ModifyGroupNameRes {
  336. optional int32 ErrorCode = 1; //详见错误码文档
  337. optional uint32 GroupId = 2; //群信息
  338. }
  339. //MsgId=215 群成员修改别名请求
  340. message GroupMemberModifyAliasReq{
  341. optional uint32 GroupId = 1; //群信息
  342. optional string Name = 2; //群信息
  343. }
  344. //MsgId=216 群成员修改别名请求回应
  345. message GroupMemberModifyAliasRes {
  346. optional int32 ErrorCode = 1; //详见错误码文档
  347. optional uint32 GroupId = 2; //群信息
  348. optional string Name = 3; //群信息
  349. }
  350. //MsgId=217 请求用户关联群列表
  351. message QueryUserRelationGroupReq{
  352. }
  353. //MsgId=218 请求用户关联群列表回应
  354. message QueryUserRelationGroupRes {
  355. optional int32 ErrorCode = 1; //详见错误码文档
  356. repeated GroupInfo RelationGroup = 2;
  357. }
  358. //MsgId=219 设置成员校验
  359. message SettingGroupReq{
  360. optional uint32 GroupId = 1; //群信息
  361. optional bool IsOpenMemberCheck = 2; //是否开启群验证
  362. }
  363. //MsgId=220 请求用户关联群列表回应
  364. message SettingGroupRes {
  365. optional int32 ErrorCode = 1; //详见错误码文档
  366. optional uint32 GroupId = 2; //群信息
  367. }
  368. //MsgId=221 用户二维码加入群请求
  369. message GroupQRcodeAddMemberReq{
  370. optional uint32 GroupId = 1; //群信息
  371. }
  372. //MsgId=222 用户二维码加入群请求回应
  373. message GroupQRcodeAddMemberRes {
  374. optional int32 ErrorCode = 1; //详见错误码文档
  375. optional GroupInfo Group = 2; //群信息
  376. }
  377. //MsgId=223 群主转让请求
  378. message GroupMasterTransReq{
  379. optional uint32 GroupId = 1; //群信息
  380. optional uint32 UserId = 2; //群信息
  381. }
  382. //MsgId=224 群主转让请求回应
  383. message GroupMasterTransRes{
  384. optional int32 ErrorCode = 1; //详见错误码文档
  385. optional uint32 GroupId = 2; //群信息
  386. optional uint32 UserId = 3; //群信息
  387. }
  388. //MsgId=225 群主校验用户接口
  389. message GroupMasterCheckAddMemberReq{
  390. optional uint32 GroupId = 1; //群信息
  391. repeated uint32 UserIds = 2; //群信息
  392. }
  393. //MsgId=226 群主校验用户接口
  394. message GroupMasterCheckAddMemberRes{
  395. optional int32 ErrorCode = 1; //详见错误码文档
  396. optional uint32 GroupId = 2; //群信息
  397. repeated uint32 UserIds = 3; //群信息
  398. }
  399. //MsgId=227 消息免打扰
  400. message SetGroupMasterMessageFreeReq{
  401. optional uint32 GroupId = 1; //群信息
  402. optional bool MessageFree = 2; //消息免打扰
  403. }
  404. //MsgId=228 消息免打扰
  405. message SetGroupMasterMessageFreeRes{
  406. optional int32 ErrorCode = 1; //详见错误码文档
  407. optional uint32 GroupId = 2; //群信息
  408. optional bool MessageFree = 3; //消息免打扰
  409. }
  410. //MsgId=229 消息免打扰
  411. message SetGroupIsShowMenberNiceNameReq{
  412. optional uint32 GroupId = 1; //群信息
  413. optional bool IsShowMenberNiceName = 2; //消息免打扰
  414. }
  415. //MsgId=230 消息免打扰
  416. message SetGroupIsShowMenberNiceNameRes{
  417. optional int32 ErrorCode = 1; //详见错误码文档
  418. optional uint32 GroupId = 2; //群信息
  419. optional bool IsShowMenberNiceName = 3; //消息免打扰
  420. }