Hibok
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

466 行
16 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. }
  253. //群结构
  254. message GroupInfo {
  255. optional uint32 Id = 1; //群Id
  256. optional uint32 Code= 2;
  257. optional string GroupName = 3; //群名称
  258. optional string Notice = 4; //群公告
  259. repeated GroupMember Members= 5; //群成员
  260. optional bool IsOpenMemberCheck = 6; //是否开启成员校验
  261. }
  262. //推送聊天群变化信息
  263. message GroupChatNotice{
  264. optional GroupChangeType ChangeType = 1; //信息改变类型
  265. optional BaseUserInfo OperatuId = 2; //操作用户Id
  266. repeated BaseUserInfo OperateduId = 3; //被操作用户Ids 有可能是多人
  267. optional string ChangeStr = 4; //改变消息
  268. optional bool ChangeBool = 5; //变化bool值
  269. }
  270. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  271. //MsgId=201 创建聊天群
  272. message CreateChatGroupReq {
  273. repeated uint32 Members = 3; //群成员
  274. }
  275. //MsgId=202 创建聊天群回应
  276. message CreateChatGroupRes {
  277. optional int32 ErrorCode = 1; //详见错误码文档
  278. optional GroupInfo Group = 2; //群信息
  279. }
  280. //MsgId=203 退出聊天群
  281. message QuitChatGroupReq {
  282. optional uint32 GroupId = 1; //群id
  283. }
  284. //MsgId=204 退出聊天群回应
  285. message QuitChatGroupRes {
  286. optional int32 ErrorCode = 1; //详见错误码文档
  287. optional uint32 GroupId = 2; //群id
  288. }
  289. //MsgId=205 查询聊天群组信息
  290. message QueryChatGroupReq {
  291. optional uint32 GroupId = 1; //群信息
  292. }
  293. //MsgId=206 查询聊天群组信息
  294. message QueryChatGroupRes {
  295. optional int32 ErrorCode = 1; //详见错误码文档
  296. optional GroupInfo Group = 2; //群信息
  297. }
  298. //MsgId=207 添加群成员
  299. message AddGroupMemberReq {
  300. optional uint32 GroupId = 1; //群信息
  301. repeated uint32 UserIds = 2; //用户Id
  302. }
  303. //MsgId=208 添加群成员回应
  304. message AddGroupMemberRes {
  305. optional int32 ErrorCode = 1; //详见错误码文档
  306. optional uint32 GroupId = 2; //群信息
  307. }
  308. //MsgId=209 移除群成员回应
  309. message RemoveGroupMemberReq {
  310. optional uint32 GroupId = 1; //群信息
  311. repeated uint32 UserIds = 2;
  312. }
  313. //MsgId=210 移除群成员回应
  314. message RemoveGroupMemberRes {
  315. optional int32 ErrorCode = 1; //详见错误码文档
  316. optional uint32 GroupId = 2; //群信息
  317. }
  318. //MsgId=211 修改群公告请求
  319. message ModifyGroupNoticeReq{
  320. optional uint32 GroupId = 1; //群信息
  321. optional string Notice = 2; //群信息
  322. }
  323. //MsgId=212 修改群公告请求回应
  324. message ModifyGroupNoticeRes {
  325. optional int32 ErrorCode = 1; //详见错误码文档
  326. optional uint32 GroupId = 2; //群信息
  327. }
  328. //MsgId=213 修改群昵称请求
  329. message ModifyGroupNameReq{
  330. optional uint32 GroupId = 1; //群信息
  331. optional string Name = 2; //群信息
  332. }
  333. //MsgId=214 修改群昵称请求回应
  334. message ModifyGroupNameRes {
  335. optional int32 ErrorCode = 1; //详见错误码文档
  336. optional uint32 GroupId = 2; //群信息
  337. }
  338. //MsgId=215 群成员修改别名请求
  339. message GroupMemberModifyAliasReq{
  340. optional uint32 GroupId = 1; //群信息
  341. optional string Name = 2; //群信息
  342. }
  343. //MsgId=216 群成员修改别名请求回应
  344. message GroupMemberModifyAliasRes {
  345. optional int32 ErrorCode = 1; //详见错误码文档
  346. optional uint32 GroupId = 2; //群信息
  347. optional string Name = 3; //群信息
  348. }
  349. //MsgId=217 请求用户关联群列表
  350. message QueryUserRelationGroupReq{
  351. }
  352. //MsgId=218 请求用户关联群列表回应
  353. message QueryUserRelationGroupRes {
  354. optional int32 ErrorCode = 1; //详见错误码文档
  355. repeated GroupInfo RelationGroup = 2;
  356. }
  357. //MsgId=219 设置成员校验
  358. message SettingGroupReq{
  359. optional uint32 GroupId = 1; //群信息
  360. optional bool IsOpenMemberCheck = 2; //是否开启群验证
  361. }
  362. //MsgId=220 请求用户关联群列表回应
  363. message SettingGroupRes {
  364. optional int32 ErrorCode = 1; //详见错误码文档
  365. optional uint32 GroupId = 2; //群信息
  366. }
  367. //MsgId=221 用户二维码加入群请求
  368. message GroupQRcodeAddMemberReq{
  369. optional uint32 GroupId = 1; //群信息
  370. }
  371. //MsgId=222 用户二维码加入群请求回应
  372. message GroupQRcodeAddMemberRes {
  373. optional int32 ErrorCode = 1; //详见错误码文档
  374. optional GroupInfo Group = 2; //群信息
  375. }
  376. //MsgId=223 群主转让请求
  377. message GroupMasterTransReq{
  378. optional uint32 GroupId = 1; //群信息
  379. optional uint32 UserId = 2; //群信息
  380. }
  381. //MsgId=224 群主转让请求回应
  382. message GroupMasterTransRes{
  383. optional int32 ErrorCode = 1; //详见错误码文档
  384. optional uint32 GroupId = 2; //群信息
  385. optional uint32 UserId = 3; //群信息
  386. }
  387. //MsgId=225 群主校验用户接口
  388. message GroupMasterCheckAddMemberReq{
  389. optional uint32 GroupId = 1; //群信息
  390. repeated uint32 UserIds = 2; //群信息
  391. }
  392. //MsgId=226 群主校验用户接口
  393. message GroupMasterCheckAddMemberRes{
  394. optional int32 ErrorCode = 1; //详见错误码文档
  395. optional uint32 GroupId = 2; //群信息
  396. repeated uint32 UserIds = 3; //群信息
  397. }
  398. //MsgId=227 消息免打扰
  399. message SetGroupMasterMessageFreeReq{
  400. optional uint32 GroupId = 1; //群信息
  401. optional bool MessageFree = 2; //消息免打扰
  402. }
  403. //MsgId=228 消息免打扰
  404. message SetGroupMasterMessageFreeRes{
  405. optional int32 ErrorCode = 1; //详见错误码文档
  406. optional uint32 GroupId = 2; //群信息
  407. optional bool MessageFree = 3; //消息免打扰
  408. }