- syntax = "proto2";
- package yl_pb;
-
- enum ChatChannelType {
- Session = 0; //会话
- Group = 1; //群组
- CSD =2; //客服频道
- TransHK = 3; //翻译管家
- }
-
- enum ChatType {
- TextChatType = 0; //文字聊天
- ImageChatType = 1; //图片
- ShortVoiceChatType = 2; //短语音
- ShortVideoChatType = 3; //短视频
- RealtimeCallVoiceType = 4; //实时通话-语音
- RealtimeCallVideoType = 5; //实时通话-视频
- RedWalletChatType = 6; //红包
- PlaceChatType = 7; //地址类型
- EmoticonType = 8; //表情
- GroupChatNoticeType = 9; //群公告类型
- GiftChatType = 10; //礼物聊天类型
- FileChatType = 11; //文件聊天类型
- }
-
- enum RedWalletState {
- Uncollected = 0; //未领取
- Received = 1; //已领取
- Expire = 2; //过期
- }
-
- //用户间翻译状态
- enum TranslateState{
- NoPerson = 0;//没有翻译人员在线
- SameLan = 1;//同一语言
- Unopen = 2;//没有开启人工翻译
- Opend = 3; //已经开启人工翻译
- }
-
- //红包数据
- message RedWallet {
- optional string OrderId = 1;
- optional uint32 SuId = 2; //发送者Id
- optional uint32 TuId = 3; //接收者Id
- optional string Title = 4;
- optional uint32 Amount = 5;
- optional RedWalletState State = 6;
- optional int64 RecTime = 7; //领取时间
- }
-
- message BaseUserInfo {
- optional uint32 Id = 1; //用户Id
- optional string NiceName =2; //昵称
- optional string HeadUrl =3; //头像Id
- }
-
- enum ChatNiceoType {
- GroupAddMember = 1; //聊天群-加入用户
- GroupRemoveMember = 2; //聊天群-移除用户
- }
-
- message ChatNiceo {
- optional ChatNiceoType NictoType = 1; //公告类型
- optional string NictoMsg = 2; //公告消息
- }
-
- message GiftChat {
- optional uint32 SuId = 1; //发送者Id
- optional uint32 TuId = 2; //接收者Id
- optional uint32 GiftId = 3; //礼物Id
- optional string GiftName = 4; //礼物名称
- optional uint32 GiftAmount = 5; //礼物数量
- optional uint32 Money = 6; //钱
- }
-
- message FileChat {
- optional string Type = 1; //文件类型
- optional uint32 Size = 2; //文件大小
- optional string Name = 3; //文件名称
- }
-
- //引用消息数据结构
- message QuoteMsg{
- optional ChatChannelType ChannelType = 1; //发送频道类型
- optional uint32 TargetId = 2; //发送目标Id SessionId or GroudId
- optional uint32 SendUserId = 3; //消息发送者
- optional int64 SendTime = 4; //发送时间
- optional string Content = 5; //消息附件地址
- }
-
- //翻译失败返回消息结果
- message HumanTransFail {
- optional uint32 Money = 1; //退回h币
- optional uint32 Ticket = 2; //退回翻译券
- }
-
- //-------------------------------------------------------------------------消息--------------------------------------------------------------------------------------------------
- // MsgId=1 聊天消息发送请求
- message ChatSendReq {
- optional ChatChannelType ChannelType = 1; //发送频道类型
- optional uint32 TargetId = 2; //发送目标Id SessionId or GroudId
- optional int64 SendTime = 3; //发送时间
- optional ChatType CType = 4; //聊天类型 //文字 图片 短语音 短视频
- optional bytes ContentBuff = 5; //内容数据 10k 最大
- optional uint32 ContentSzie = 6; //内容大小
- optional string EnclosureUrl = 7; //消息附件地址
- repeated uint32 AltUserIds = 8; //alt用户id
- optional bytes QuoteMsg =9; //引用消息
- }
-
- // MsgId=2 聊天消息发送请求回应
- message ChatSendRes {
- optional int32 ErrorCode = 1; //0发送成功 1参数异常
- optional ChatChannelType ChannelType = 2; //发送频道类型
- optional uint32 TargetId = 3; //发送目标Id SessionId or GroudId
- optional int64 SendTime = 4; //聊天消息Id
- }
-
- // MsgId=3 推送用户聊天消息
- message PushChat {
- optional ChatChannelType ChannelType = 1; //发送频道类型
- optional uint32 TargetId = 2; //发送目标Id SessionId or GroudId
- optional uint32 SendUserId = 3; //发送者Id 0 通知消息 1 更新消息 非这两种未用户发送消息
- optional int64 SendTime = 4; //发送时间
- optional ChatType CType = 5; //聊天类型 //文字 图片 短语音 短视频
- optional bytes ContentBuff = 6; //内容数据 10k 最大
- optional uint32 ContentSzie = 7; //内容大小
- optional uint32 TranslateState = 8; //翻译状态 0不翻译 1机翻 2人工翻译
- optional bytes TencentTranslate = 9; //Tencent翻译
- optional bytes GoogleTranslate = 10; //Google翻译
- optional bytes HumanTranslate = 11; //人工翻译翻译
- optional string EnclosureUrl = 12; //消息附件地址
- repeated uint32 AltUserIds = 13; //alt用户id
- optional bytes QuoteMsg =14; //引用消息
- }
-
- //MsgId=100 应答消息接收
- message AnswerPushChat {
- optional int64 MsgId = 1; //消息Id
- }
-
- // MsgId=4 用户登陆成功后推送未读消息列表
- message PushUserUnreadMsgNotice {
- repeated UserUnreadMsgNotice Notices = 2;
- }
-
- //未读消息描述
- message UnreadMsgDes {
- optional uint32 SendUserId = 1; //发送者Id 0 通知消息 1 更新消息 非这两种未用户发送消息
- optional int64 SendTime = 2; //发送时间
- optional ChatType CType = 3; //聊天类型 //文字 图片 短语音 短视频
- optional bytes ContentBuff = 4; //内容数据 只有文字才有 其余的填空
- optional bytes TencentTranslate = 5; //腾讯翻译
- optional bytes GoogleTranslate = 6; //google翻译
- }
-
- message UserUnreadMsgNotice {
- optional ChatChannelType ChannelType = 1; //发送频道类型
- optional uint32 TargetId = 2; //发送目标Id SessionId or GroudId
- optional uint32 UnreadMsgNum = 3; //未读消息数量
- optional UnreadMsgDes LastUnreadMsg = 4; //最后一条未读消息
- }
-
- // MsgId=5 请求目标未读消息
- message RequestTargetUnreadReq {
- optional ChatChannelType ChannelType = 1; //发送频道类型
- optional uint32 TargetId = 2; //发送目标Id SessionId or GroudId
- }
- // MsgId=6 请求目标未读消息回应
- message RequestTargetUnreadRes {
- optional int32 ErrorCode = 1; //0发送成功 1参数异常
- }
-
- // MsgId=7 请求设置人工翻译
- message RequestSetHTranslReq {
- optional uint32 SessionId = 1; //发送目标Id
- optional TranslateState HTransl = 2; //是否需要人工翻译
- }
-
- // MsgId=8 请求设置人工翻译回应
- message RequestSetHTranslRes {
- optional int32 ErrorCode = 1; // 0发送成功 1参数异常
- }
-
- // MsgId=9 请求设置人工翻译回应
- message PushHTranslState {
- optional uint32 SessionId = 1; //会话id
- optional uint32 UserId = 2; //发送目标Id
- optional TranslateState HTransl = 3; //是否需要人工翻译
- }
-
- // MsgId=10 请求实时通话
- message RequestRealtimeCallReq{
- optional uint32 TUserId = 1; //目标用户
- optional ChatType CType = 2; //通话类型
- }
- // MsgId=11 请求实时通话回应
- message RequestRealtimeCallRes{
- optional int32 ErrorCode = 1; // 0发送成功
- }
- // MsgId=12 推送实时通话请求
- message PushRealtimeCall{
- optional uint32 SUserId = 1; //发起通话请求用户
- optional ChatType CType = 2; //通话类型
- }
-
- // MsgId=13 请求挂断实时通话请求
- message RespondRealtimeCallReq{
- optional uint32 SUserId = 1; //发起通话请求用户
- optional bool IsAnswer = 2; //是否应答 true 应答 false 挂断
- }
- // MsgId=14 推送挂断实时通话请求
- message PushRealtimeCallRespond{
- optional uint32 TUserId = 1; //目标用户
- optional bool IsAnswer = 2; //是否应答 true 应答 false 挂断
- }
-
- // MsgId=17 请求送礼物
- message RequestGiftGivingReq{
- optional uint32 TargetUserId = 1; //目标用户Id
- optional uint32 GiftId = 2; //礼物Id
- optional uint32 GiftAmount = 3; //礼物数量
- optional uint32 Money = 4; //钱
- }
-
- // MsgId=18 推送送礼
- message PushGiftGiving{
- optional uint32 SendUserId = 1; //目标用户Id
- optional uint32 GiftId = 2; //礼物Id
- optional uint32 GiftAmount = 3; //礼物数量
- optional uint32 Money = 4; //钱
- }
-
- //MsgId=80 查询用户基本信息
- message QueryUsersInfoReq{
- repeated uint32 UserIds = 1;
- }
- //MsgId=81 查询用户基本信息回应
- message QueryUsersInfoRes{
- repeated BaseUserInfo Infos = 1;
- }
-
- //-------------------------------------------------------------------------------Session相关---------------------------------------------------------------------------------------
- //MsgId=101 请求创建会话
- message CreateSessionReq {
- repeated uint32 MemberIds = 1;
- }
- //MsgId=102 请求创建会话
- message QuerySessionReq {
- optional uint32 SessionId = 1;
- }
- //MsgId=103 请求创建会话回应
- message SessionInfoRes {
- optional int32 ErrorCode = 1; // 0发送成功 1参数异常
- optional uint32 SessionId = 2;
- repeated BaseUserInfo Members = 3;
- optional TranslateState IsNeedHTransl = 4;
- }
- //-------------------------------------------------------------------------------Group相关---------------------------------------------------------------------------------------
- //群身份
- enum GroupMemberIdentity {
- identityNormal = 0; //普通成员
- identityManager = 1; //管理员
- identityMaster = 2; //群主
- }
-
- //聊天群信息变化类型
- enum GroupChangeType {
- AddMember = 1; //加入用户
- RemoveMember = 2; //移除用户
- MasterTrans = 3; //群主转让
- GroupNoticeChange = 4; //群公告改变
- GroupNameChange = 5; //群昵称改变
- GroupMemberAliasChange = 6; //群成员别名改变
- GroupIsOpenMemberCheckChange = 7; //群设置校验成员改变
- GroupMemberCheckNotice = 8; //群成员校验公告
- QRCodeAddMemberNotice = 9; //通过二维码加入到群
- GroupMemberCheckAddMemberNotice = 10; //群主校验添加成员通告
- GroupMemberLeave = 11; //群成员离开
- }
-
- //群成员结构
- message GroupMember {
- optional BaseUserInfo Info = 1; //用户Id
- optional string Name = 2; //用户Id
- optional GroupMemberIdentity Identity = 3; //成员身份
- optional bool MessageFree = 4; //消息打扰标记
- optional bool EffectiveUser = 5; //有效用户 移除群成员不直接删除数据而是修改有效标签
- optional bool IsShowMenberNiceName =6; //是否显示成员昵称
- }
- //群结构
- message GroupInfo {
- optional uint32 Id = 1; //群Id
- optional uint32 Code= 2;
- optional string GroupName = 3; //群名称
- optional string Notice = 4; //群公告
- repeated GroupMember Members= 5; //群成员
- optional bool IsOpenMemberCheck = 6; //是否开启成员校验
- }
-
- //推送聊天群变化信息
- message GroupChatNotice{
- optional GroupChangeType ChangeType = 1; //信息改变类型
- optional BaseUserInfo OperatuId = 2; //操作用户Id
- repeated BaseUserInfo OperateduId = 3; //被操作用户Ids 有可能是多人
- optional string ChangeStr = 4; //改变消息
- optional bool ChangeBool = 5; //变化bool值
- }
-
- //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- //MsgId=201 创建聊天群
-
- message CreateChatGroupReq {
- repeated uint32 Members = 3; //群成员
- }
-
- //MsgId=202 创建聊天群回应
- message CreateChatGroupRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- optional GroupInfo Group = 2; //群信息
- }
-
- //MsgId=203 退出聊天群
- message QuitChatGroupReq {
- optional uint32 GroupId = 1; //群id
- }
- //MsgId=204 退出聊天群回应
- message QuitChatGroupRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群id
- }
-
- //MsgId=205 查询聊天群组信息
- message QueryChatGroupReq {
- optional uint32 GroupId = 1; //群信息
- }
- //MsgId=206 查询聊天群组信息
- message QueryChatGroupRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- optional GroupInfo Group = 2; //群信息
- }
-
- //MsgId=207 添加群成员
- message AddGroupMemberReq {
- optional uint32 GroupId = 1; //群信息
- repeated uint32 UserIds = 2; //用户Id
- }
- //MsgId=208 添加群成员回应
- message AddGroupMemberRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群信息
- }
-
- //MsgId=209 移除群成员回应
- message RemoveGroupMemberReq {
- optional uint32 GroupId = 1; //群信息
- repeated uint32 UserIds = 2;
- }
-
- //MsgId=210 移除群成员回应
- message RemoveGroupMemberRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群信息
- }
-
- //MsgId=211 修改群公告请求
- message ModifyGroupNoticeReq{
- optional uint32 GroupId = 1; //群信息
- optional string Notice = 2; //群信息
- }
-
- //MsgId=212 修改群公告请求回应
- message ModifyGroupNoticeRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群信息
- }
-
- //MsgId=213 修改群昵称请求
- message ModifyGroupNameReq{
- optional uint32 GroupId = 1; //群信息
- optional string Name = 2; //群信息
- }
-
- //MsgId=214 修改群昵称请求回应
- message ModifyGroupNameRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群信息
- }
-
- //MsgId=215 群成员修改别名请求
- message GroupMemberModifyAliasReq{
- optional uint32 GroupId = 1; //群信息
- optional string Name = 2; //群信息
- }
-
- //MsgId=216 群成员修改别名请求回应
- message GroupMemberModifyAliasRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群信息
- optional string Name = 3; //群信息
- }
-
- //MsgId=217 请求用户关联群列表
- message QueryUserRelationGroupReq{
- }
-
- //MsgId=218 请求用户关联群列表回应
- message QueryUserRelationGroupRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- repeated GroupInfo RelationGroup = 2;
- }
-
- //MsgId=219 设置成员校验
- message SettingGroupReq{
- optional uint32 GroupId = 1; //群信息
- optional bool IsOpenMemberCheck = 2; //是否开启群验证
- }
-
- //MsgId=220 请求用户关联群列表回应
- message SettingGroupRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群信息
- }
-
-
- //MsgId=221 用户二维码加入群请求
- message GroupQRcodeAddMemberReq{
- optional uint32 GroupId = 1; //群信息
- }
-
- //MsgId=222 用户二维码加入群请求回应
- message GroupQRcodeAddMemberRes {
- optional int32 ErrorCode = 1; //详见错误码文档
- optional GroupInfo Group = 2; //群信息
- }
-
- //MsgId=223 群主转让请求
- message GroupMasterTransReq{
- optional uint32 GroupId = 1; //群信息
- optional uint32 UserId = 2; //群信息
- }
-
- //MsgId=224 群主转让请求回应
- message GroupMasterTransRes{
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群信息
- optional uint32 UserId = 3; //群信息
- }
-
- //MsgId=225 群主校验用户接口
- message GroupMasterCheckAddMemberReq{
- optional uint32 GroupId = 1; //群信息
- repeated uint32 UserIds = 2; //群信息
- }
-
- //MsgId=226 群主校验用户接口
- message GroupMasterCheckAddMemberRes{
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群信息
- repeated uint32 UserIds = 3; //群信息
- }
-
- //MsgId=227 消息免打扰
- message SetGroupMasterMessageFreeReq{
- optional uint32 GroupId = 1; //群信息
- optional bool MessageFree = 2; //消息免打扰
- }
-
- //MsgId=228 消息免打扰
- message SetGroupMasterMessageFreeRes{
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群信息
- optional bool MessageFree = 3; //消息免打扰
- }
-
-
- //MsgId=229 消息免打扰
- message SetGroupIsShowMenberNiceNameReq{
- optional uint32 GroupId = 1; //群信息
- optional bool IsShowMenberNiceName = 2; //消息免打扰
- }
-
- //MsgId=230 消息免打扰
- message SetGroupIsShowMenberNiceNameRes{
- optional int32 ErrorCode = 1; //详见错误码文档
- optional uint32 GroupId = 2; //群信息
- optional bool IsShowMenberNiceName = 3; //消息免打扰
- }
|