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.
 
 
 
 
 
 

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