Hibok
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

482 linhas
17 KiB

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