1119 lines
34 KiB
Protocol Buffer
1119 lines
34 KiB
Protocol Buffer
// Copyright © 2023 OpenIM open source community. All rights reserved.
|
||
//
|
||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||
// you may not use this file except in compliance with the License.
|
||
// You may obtain a copy of the License at
|
||
//
|
||
// http://www.apache.org/licenses/LICENSE-2.0
|
||
//
|
||
// Unless required by applicable law or agreed to in writing, software
|
||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
// See the License for the specific language governing permissions and
|
||
// limitations under the License.
|
||
|
||
syntax = "proto3";
|
||
package openim.chat;
|
||
|
||
import "common/common.proto";
|
||
import "sdkws/sdkws.proto";
|
||
import "wrapperspb/wrapperspb.proto";
|
||
|
||
option go_package = "git.imall.cloud/openim/chat/pkg/protocol/chat";
|
||
|
||
message UserIdentity {
|
||
string email = 1;
|
||
string areaCode = 2;
|
||
string phoneNumber = 3;
|
||
string deviceID = 4;
|
||
int32 platform = 5;
|
||
string account = 6;
|
||
}
|
||
|
||
message UpdateUserInfoReq {
|
||
string userID = 1;
|
||
openim.protobuf.StringValue account = 2;
|
||
openim.protobuf.StringValue phoneNumber = 3;
|
||
openim.protobuf.StringValue areaCode = 4;
|
||
openim.protobuf.StringValue email = 5;
|
||
openim.protobuf.StringValue nickname = 6;
|
||
openim.protobuf.StringValue faceURL = 7;
|
||
openim.protobuf.Int32Value gender = 8;
|
||
openim.protobuf.Int32Value level = 9;
|
||
openim.protobuf.Int64Value birth = 10;
|
||
openim.protobuf.Int32Value allowAddFriend = 11;
|
||
openim.protobuf.Int32Value allowBeep = 12;
|
||
openim.protobuf.Int32Value allowVibration = 13;
|
||
openim.protobuf.Int32Value globalRecvMsgOpt = 14;
|
||
openim.protobuf.Int32Value RegisterType = 15;
|
||
int32 userType = 16; // 用户类型: 0=普通用户, 1=企业用户, 2=机器人, 3=管理员
|
||
openim.protobuf.StringValue userFlag = 17; // 用户标签/标识,类似UserType的字符串版本
|
||
}
|
||
|
||
message UpdateUserInfoResp {
|
||
string faceUrl = 1;
|
||
string nickName = 2;
|
||
}
|
||
|
||
message FindUserPublicInfoReq {
|
||
repeated string userIDs = 1;
|
||
}
|
||
|
||
message FindUserPublicInfoResp {
|
||
repeated openim.chat.common.UserPublicInfo users = 1;
|
||
}
|
||
|
||
message SearchUserPublicInfoReq {
|
||
string keyword = 1;
|
||
openim.sdkws.RequestPagination pagination = 2;
|
||
int32 genders = 3;
|
||
}
|
||
|
||
message SearchUserPublicInfoResp {
|
||
uint32 total = 1;
|
||
repeated openim.chat.common.UserPublicInfo users = 2;
|
||
}
|
||
|
||
message FindUserFullInfoReq {
|
||
repeated string userIDs = 1;
|
||
}
|
||
|
||
message FindUserFullInfoResp {
|
||
repeated openim.chat.common.UserFullInfo users = 1;
|
||
}
|
||
|
||
message SendVerifyCodeReq {
|
||
int32 usedFor = 1;
|
||
string ip = 2;
|
||
string invitationCode = 3;
|
||
string deviceID = 4;
|
||
int32 platform = 5;
|
||
string areaCode = 6;
|
||
string phoneNumber = 7;
|
||
string email = 8;
|
||
}
|
||
|
||
message SendVerifyCodeResp {}
|
||
|
||
message VerifyCodeReq {
|
||
string areaCode = 1;
|
||
string phoneNumber = 2;
|
||
string verifyCode = 3;
|
||
string email = 4;
|
||
string captchaID = 5; // 图片验证码ID(可选,如果提供则验证图片验证码)
|
||
string account = 6; // 用户名(用于账号注册验证)
|
||
}
|
||
|
||
message VerifyCodeResp {
|
||
string registerToken = 1; // H5注册token(仅在验证图片验证码成功后返回,用于后续注册,有效期120秒)
|
||
}
|
||
|
||
message GetCaptchaImageReq {}
|
||
|
||
message GetCaptchaImageResp {
|
||
string captchaID = 1; // 验证码ID,用于后续验证
|
||
string code = 2; // 6位数字验证码(用于生成图片)
|
||
}
|
||
|
||
message RegisterUserInfo {
|
||
string userID = 1;
|
||
string nickname = 2;
|
||
string faceURL = 3;
|
||
int64 birth = 4;
|
||
int32 gender = 5;
|
||
string areaCode = 6;
|
||
string phoneNumber = 7;
|
||
string email = 8;
|
||
string account = 9;
|
||
string password = 10;
|
||
int32 RegisterType = 11;
|
||
int32 userType = 12; // 用户类型: 0=普通用户, 1=企业用户, 2=机器人, 3=管理员
|
||
string userFlag = 13; // 用户标签/标识
|
||
}
|
||
|
||
message RegisterUserReq {
|
||
string invitationCode = 1;
|
||
string verifyCode = 2;
|
||
string ip = 3;
|
||
string deviceID = 4;
|
||
int32 platform = 5;
|
||
bool autoLogin = 6;
|
||
RegisterUserInfo user = 7;
|
||
string registerToken = 8; // H5注册token(可选,用于H5注册场景,验证手机号合法性)
|
||
}
|
||
|
||
message RegisterUserResp {
|
||
string userID = 1;
|
||
string chatToken = 3;
|
||
}
|
||
|
||
message AddUserAccountReq {
|
||
string ip = 1;
|
||
string deviceID = 2;
|
||
int32 platform = 3;
|
||
RegisterUserInfo user = 4;
|
||
}
|
||
|
||
message AddUserAccountResp {}
|
||
|
||
message LoginReq {
|
||
string areaCode = 1;
|
||
string phoneNumber = 2;
|
||
string verifyCode = 3;
|
||
string account = 4;
|
||
string password = 5;
|
||
int32 platform = 6;
|
||
string deviceID = 7;
|
||
string ip = 8;
|
||
string email = 9;
|
||
}
|
||
|
||
message ResetPasswordReq {
|
||
string areaCode = 1;
|
||
string phoneNumber = 2;
|
||
string verifyCode = 3;
|
||
string password = 4;
|
||
string email = 5;
|
||
}
|
||
|
||
message ResetPasswordResp {}
|
||
|
||
message ChangePasswordReq {
|
||
string userID = 1;
|
||
string currentPassword = 2;
|
||
string newPassword = 3;
|
||
}
|
||
|
||
message ChangePasswordResp {}
|
||
|
||
message FindUserAccountReq {
|
||
repeated string userIDs = 1;
|
||
}
|
||
|
||
message FindUserAccountResp {
|
||
map<string, string> userAccountMap = 1; // userID account
|
||
}
|
||
|
||
message FindAccountUserReq {
|
||
repeated string accounts = 1;
|
||
}
|
||
|
||
message FindAccountUserResp {
|
||
map<string, string> accountUserMap = 1; // account userID
|
||
}
|
||
|
||
message SignalRecord {
|
||
string fileName = 1;
|
||
string mediaType = 2;
|
||
string roomType = 3;
|
||
string senderID = 4;
|
||
string senderNickname = 5;
|
||
string recvID = 6;
|
||
string recvNickname = 7;
|
||
string groupID = 8;
|
||
string groupName = 9;
|
||
repeated openim.chat.common.UserPublicInfo inviterUserList = 10;
|
||
int32 duration = 11;
|
||
int64 createTime = 12;
|
||
string size = 13;
|
||
string downloadURL = 14;
|
||
}
|
||
|
||
message OpenIMCallbackReq {
|
||
string command = 1;
|
||
string body = 2;
|
||
}
|
||
|
||
message OpenIMCallbackResp {}
|
||
|
||
message SearchUserFullInfoReq {
|
||
string keyword = 1;
|
||
openim.sdkws.RequestPagination pagination = 2;
|
||
int32 genders = 3;
|
||
int32 normal = 4;
|
||
int64 startTime = 5; // 注册时间范围开始时间(毫秒时间戳)
|
||
int64 endTime = 6; // 注册时间范围结束时间(毫秒时间戳)
|
||
string realNameKeyword = 7; // 真实姓名搜索关键词(可选)
|
||
string idCardKeyword = 8; // 身份证号搜索关键词(可选)
|
||
}
|
||
|
||
message SearchUserFullInfoResp {
|
||
uint32 total = 1;
|
||
repeated openim.chat.common.UserFullInfo users = 2;
|
||
}
|
||
|
||
message UserLoginCountReq {
|
||
int64 start = 1;
|
||
int64 end = 2;
|
||
}
|
||
|
||
message UserLoginCountResp {
|
||
int64 loginCount = 1;
|
||
int64 unloginCount = 2;
|
||
map<string, int64> count = 3;
|
||
}
|
||
|
||
message LoginResp {
|
||
string chatToken = 2;
|
||
string userID = 3;
|
||
}
|
||
|
||
message SearchUserInfoReq {
|
||
string keyword = 1;
|
||
openim.sdkws.RequestPagination pagination = 2;
|
||
repeated int32 genders = 3;
|
||
repeated string userIDs = 4;
|
||
}
|
||
|
||
message SearchUserInfoResp {
|
||
uint32 total = 1;
|
||
repeated openim.chat.common.UserFullInfo users = 2;
|
||
}
|
||
|
||
message GetTokenForVideoMeetingReq {
|
||
string room = 1;
|
||
string identity = 2;
|
||
}
|
||
|
||
message GetTokenForVideoMeetingResp {
|
||
string serverUrl = 1;
|
||
string token = 2;
|
||
}
|
||
|
||
message CheckUserExistReq {
|
||
RegisterUserInfo user = 1;
|
||
}
|
||
|
||
message CheckUserExistResp {
|
||
string userid = 1;
|
||
bool isRegistered = 2;
|
||
}
|
||
|
||
message DelUserAccountReq {
|
||
repeated string userIDs = 1;
|
||
}
|
||
message DelUserAccountResp {}
|
||
|
||
message SetAllowRegisterReq {
|
||
bool allowRegister = 1;
|
||
}
|
||
|
||
message SetAllowRegisterResp {
|
||
}
|
||
|
||
message GetAllowRegisterReq {
|
||
}
|
||
|
||
message GetAllowRegisterResp {
|
||
bool allowRegister = 1;
|
||
}
|
||
|
||
// ==================== 敏感词检测相关消息(用户端) ====================
|
||
|
||
// 敏感词信息(简化版,客户端用)
|
||
message SensitiveWordInfo {
|
||
string word = 1; // 敏感词内容
|
||
int32 action = 2; // 处理动作 1:替换为*** 2:拦截不发
|
||
string replaceChar = 3; // 替换字符
|
||
}
|
||
|
||
// 获取敏感词列表请求
|
||
message GetSensitiveWordsReq {}
|
||
|
||
// 获取敏感词列表响应
|
||
message GetSensitiveWordsResp {
|
||
repeated SensitiveWordInfo words = 1; // 敏感词列表
|
||
bool enableFilter = 2; // 是否启用过滤
|
||
string defaultReplaceChar = 3; // 默认替换字符
|
||
}
|
||
|
||
// 检测敏感词请求(用户发送消息时调用)
|
||
message CheckSensitiveWordsReq {
|
||
string content = 1; // 要检测的内容
|
||
}
|
||
|
||
// 检测敏感词响应
|
||
message CheckSensitiveWordsResp {
|
||
bool hasSensitive = 1; // 是否包含敏感词
|
||
string filteredContent = 2; // 过滤后的内容(如果被替换)
|
||
repeated string matchedWords = 3; // 匹配到的敏感词列表
|
||
}
|
||
|
||
// ==================== 敏感词管理相关消息(管理端) ====================
|
||
|
||
// 敏感词详细信息(管理端)
|
||
message SensitiveWordDetailInfo {
|
||
string id = 1;
|
||
string word = 2;
|
||
int32 level = 3;
|
||
int32 type = 4;
|
||
int32 action = 5;
|
||
int32 status = 6;
|
||
string creator = 7;
|
||
string updater = 8;
|
||
int64 create_time = 9;
|
||
int64 update_time = 10;
|
||
string remark = 11;
|
||
}
|
||
|
||
// 敏感词分组信息
|
||
message SensitiveWordGroupInfo {
|
||
string id = 1;
|
||
string name = 2;
|
||
string remark = 3;
|
||
int64 create_time = 4;
|
||
int64 update_time = 5;
|
||
}
|
||
|
||
// 敏感词配置信息
|
||
message SensitiveWordConfigInfo {
|
||
string id = 1;
|
||
bool enable_filter = 2;
|
||
int32 filter_mode = 3;
|
||
string replace_char = 4;
|
||
repeated string whitelist_users = 5;
|
||
repeated string whitelist_groups = 6;
|
||
bool log_enabled = 7;
|
||
bool auto_approve = 8;
|
||
int64 update_time = 9;
|
||
}
|
||
|
||
// 敏感词日志信息
|
||
message SensitiveWordLogInfo {
|
||
string id = 1;
|
||
string user_id = 2;
|
||
string group_id = 3;
|
||
string content = 4;
|
||
repeated string matched_words = 5;
|
||
int32 action = 6;
|
||
string processed_text = 7;
|
||
int64 create_time = 8;
|
||
}
|
||
|
||
// 敏感词统计信息
|
||
message SensitiveWordStatsInfo {
|
||
int64 total = 1;
|
||
int64 enabled = 2;
|
||
int64 disabled = 3;
|
||
int64 replace = 4;
|
||
int64 block = 5;
|
||
}
|
||
|
||
// 敏感词日志统计信息
|
||
message SensitiveWordLogStatsInfo {
|
||
int64 total = 1;
|
||
int64 replace = 2;
|
||
int64 block = 3;
|
||
}
|
||
|
||
// 添加敏感词
|
||
message AddSensitiveWordReq {
|
||
string word = 1;
|
||
int32 level = 2;
|
||
int32 type = 3;
|
||
int32 action = 4;
|
||
int32 status = 5;
|
||
string remark = 6;
|
||
}
|
||
|
||
message AddSensitiveWordResp {}
|
||
|
||
// 更新敏感词
|
||
message UpdateSensitiveWordReq {
|
||
string id = 1;
|
||
string word = 2;
|
||
int32 level = 3;
|
||
int32 type = 4;
|
||
int32 action = 5;
|
||
int32 status = 6;
|
||
string remark = 7;
|
||
}
|
||
|
||
message UpdateSensitiveWordResp {}
|
||
|
||
// 删除敏感词
|
||
message DeleteSensitiveWordReq {
|
||
repeated string ids = 1;
|
||
}
|
||
|
||
message DeleteSensitiveWordResp {}
|
||
|
||
// 获取敏感词
|
||
message GetSensitiveWordReq {
|
||
string id = 1;
|
||
}
|
||
|
||
message GetSensitiveWordResp {
|
||
SensitiveWordDetailInfo word = 1;
|
||
}
|
||
|
||
// 搜索敏感词
|
||
message SearchSensitiveWordsReq {
|
||
string keyword = 1;
|
||
int32 action = 2;
|
||
int32 status = 3;
|
||
openim.sdkws.RequestPagination pagination = 4;
|
||
}
|
||
|
||
message SearchSensitiveWordsResp {
|
||
uint32 total = 1;
|
||
repeated SensitiveWordDetailInfo words = 2;
|
||
}
|
||
|
||
// 批量添加敏感词
|
||
message BatchAddSensitiveWordsReq {
|
||
repeated SensitiveWordDetailInfo words = 1;
|
||
}
|
||
|
||
message BatchAddSensitiveWordsResp {}
|
||
|
||
// 批量更新敏感词
|
||
message BatchUpdateSensitiveWordsReq {
|
||
map<string, SensitiveWordDetailInfo> updates = 1;
|
||
}
|
||
|
||
message BatchUpdateSensitiveWordsResp {}
|
||
|
||
// 批量删除敏感词
|
||
message BatchDeleteSensitiveWordsReq {
|
||
repeated string ids = 1;
|
||
}
|
||
|
||
message BatchDeleteSensitiveWordsResp {}
|
||
|
||
// 添加敏感词分组
|
||
message AddSensitiveWordGroupReq {
|
||
string name = 1;
|
||
string remark = 2;
|
||
}
|
||
|
||
message AddSensitiveWordGroupResp {}
|
||
|
||
// 更新敏感词分组
|
||
message UpdateSensitiveWordGroupReq {
|
||
string id = 1;
|
||
string name = 2;
|
||
string remark = 3;
|
||
}
|
||
|
||
message UpdateSensitiveWordGroupResp {}
|
||
|
||
// 删除敏感词分组
|
||
message DeleteSensitiveWordGroupReq {
|
||
repeated string ids = 1;
|
||
}
|
||
|
||
message DeleteSensitiveWordGroupResp {}
|
||
|
||
// 获取敏感词分组
|
||
message GetSensitiveWordGroupReq {
|
||
string id = 1;
|
||
}
|
||
|
||
message GetSensitiveWordGroupResp {
|
||
SensitiveWordGroupInfo group = 1;
|
||
}
|
||
|
||
// 获取所有敏感词分组
|
||
message GetAllSensitiveWordGroupsReq {}
|
||
|
||
message GetAllSensitiveWordGroupsResp {
|
||
repeated SensitiveWordGroupInfo groups = 1;
|
||
}
|
||
|
||
// 获取敏感词配置
|
||
message GetSensitiveWordConfigReq {}
|
||
|
||
message GetSensitiveWordConfigResp {
|
||
SensitiveWordConfigInfo config = 1;
|
||
}
|
||
|
||
// 更新敏感词配置
|
||
message UpdateSensitiveWordConfigReq {
|
||
SensitiveWordConfigInfo config = 1;
|
||
}
|
||
|
||
message UpdateSensitiveWordConfigResp {}
|
||
|
||
// 获取敏感词日志
|
||
message GetSensitiveWordLogsReq {
|
||
string user_id = 1;
|
||
string group_id = 2;
|
||
openim.sdkws.RequestPagination pagination = 3;
|
||
}
|
||
|
||
message GetSensitiveWordLogsResp {
|
||
uint32 total = 1;
|
||
repeated SensitiveWordLogInfo logs = 2;
|
||
}
|
||
|
||
// 用户登录记录信息
|
||
message UserLoginRecordInfo {
|
||
string user_id = 1; // 用户ID
|
||
int64 login_time = 2; // 登录时间(毫秒时间戳)
|
||
string ip = 3; // 登录IP
|
||
string device_id = 4; // 设备ID
|
||
string platform = 5; // 平台
|
||
string face_url = 6; // 用户头像
|
||
string nickname = 7; // 用户昵称
|
||
}
|
||
|
||
// 查询用户登录记录请求
|
||
message GetUserLoginRecordsReq {
|
||
string user_id = 1; // 用户ID(可选,如果提供则查询该用户的登录记录)
|
||
string ip = 2; // IP地址(可选,如果提供则查询使用该IP的所有登录记录)
|
||
openim.sdkws.RequestPagination pagination = 3; // 分页信息
|
||
}
|
||
|
||
// 查询用户登录记录响应
|
||
message GetUserLoginRecordsResp {
|
||
uint32 total = 1; // 总数
|
||
repeated UserLoginRecordInfo records = 2; // 登录记录列表
|
||
}
|
||
|
||
// 删除敏感词日志
|
||
message DeleteSensitiveWordLogsReq {
|
||
repeated string ids = 1;
|
||
}
|
||
|
||
message DeleteSensitiveWordLogsResp {}
|
||
|
||
// 获取敏感词统计
|
||
message GetSensitiveWordStatsReq {}
|
||
|
||
message GetSensitiveWordStatsResp {
|
||
SensitiveWordStatsInfo stats = 1;
|
||
}
|
||
|
||
// 获取敏感词日志统计
|
||
message GetSensitiveWordLogStatsReq {
|
||
int64 start_time = 1;
|
||
int64 end_time = 2;
|
||
}
|
||
|
||
message GetSensitiveWordLogStatsResp {
|
||
SensitiveWordLogStatsInfo stats = 1;
|
||
}
|
||
|
||
message AddFriendReq {
|
||
string userID = 1;
|
||
}
|
||
|
||
message AddFriendResp {}
|
||
|
||
// ==================== 收藏相关消息 ====================
|
||
|
||
// 收藏信息
|
||
message FavoriteInfo {
|
||
string id = 1; // 收藏ID
|
||
string userID = 2; // 用户ID
|
||
int32 type = 3; // 收藏类型:1-文本,2-图片,3-链接,4-文件,5-语音,6-视频,7-位置
|
||
string title = 4; // 标题
|
||
string content = 5; // 内容
|
||
string description = 6; // 描述
|
||
string thumbnail = 7; // 缩略图URL
|
||
string linkURL = 8; // 链接URL
|
||
int64 fileSize = 9; // 文件大小(字节)
|
||
int32 duration = 10; // 时长(秒)
|
||
string location = 11; // 位置信息(JSON格式)
|
||
repeated string tags = 12; // 标签列表
|
||
string remark = 13; // 备注
|
||
int64 createTime = 14; // 创建时间(毫秒时间戳)
|
||
int64 updateTime = 15; // 更新时间(毫秒时间戳)
|
||
}
|
||
|
||
// 创建收藏请求
|
||
message CreateFavoriteReq {
|
||
int32 type = 1; // 收藏类型
|
||
string title = 2; // 标题
|
||
string content = 3; // 内容
|
||
string description = 4; // 描述
|
||
string thumbnail = 5; // 缩略图URL
|
||
string linkURL = 6; // 链接URL
|
||
int64 fileSize = 7; // 文件大小(字节)
|
||
int32 duration = 8; // 时长(秒)
|
||
string location = 9; // 位置信息(JSON格式)
|
||
repeated string tags = 10; // 标签列表
|
||
string remark = 11; // 备注
|
||
}
|
||
|
||
message CreateFavoriteResp {
|
||
string favoriteID = 1; // 收藏ID
|
||
}
|
||
|
||
// 获取收藏请求
|
||
message GetFavoriteReq {
|
||
string favoriteID = 1; // 收藏ID
|
||
}
|
||
|
||
message GetFavoriteResp {
|
||
FavoriteInfo favorite = 1; // 收藏信息
|
||
}
|
||
|
||
// 获取收藏列表请求
|
||
message GetFavoritesReq {
|
||
int32 type = 1; // 收藏类型(可选,0表示全部)
|
||
openim.sdkws.RequestPagination pagination = 2; // 分页信息
|
||
}
|
||
|
||
message GetFavoritesResp {
|
||
uint32 total = 1; // 总数
|
||
repeated FavoriteInfo favorites = 2; // 收藏列表
|
||
}
|
||
|
||
// 搜索收藏请求
|
||
message SearchFavoritesReq {
|
||
string keyword = 1; // 关键词
|
||
openim.sdkws.RequestPagination pagination = 2; // 分页信息
|
||
}
|
||
|
||
message SearchFavoritesResp {
|
||
uint32 total = 1; // 总数
|
||
repeated FavoriteInfo favorites = 2; // 收藏列表
|
||
}
|
||
|
||
// 更新收藏请求
|
||
message UpdateFavoriteReq {
|
||
string favoriteID = 1; // 收藏ID
|
||
string title = 2; // 标题(可选)
|
||
string description = 3; // 描述(可选)
|
||
string remark = 4; // 备注(可选)
|
||
repeated string tags = 5; // 标签列表(可选)
|
||
}
|
||
|
||
message UpdateFavoriteResp {}
|
||
|
||
// 删除收藏请求
|
||
message DeleteFavoriteReq {
|
||
repeated string favoriteIDs = 1; // 收藏ID列表
|
||
}
|
||
|
||
message DeleteFavoriteResp {}
|
||
|
||
// 根据标签获取收藏请求
|
||
message GetFavoritesByTagsReq {
|
||
repeated string tags = 1; // 标签列表
|
||
openim.sdkws.RequestPagination pagination = 2; // 分页信息
|
||
}
|
||
|
||
message GetFavoritesByTagsResp {
|
||
uint32 total = 1; // 总数
|
||
repeated FavoriteInfo favorites = 2; // 收藏列表
|
||
}
|
||
|
||
// 获取收藏数量请求
|
||
message GetFavoriteCountReq {}
|
||
|
||
message GetFavoriteCountResp {
|
||
int64 count = 1; // 收藏数量
|
||
}
|
||
|
||
// ==================== 定时任务相关消息 ====================
|
||
|
||
// 消息内容
|
||
message ScheduledTaskMessage {
|
||
int32 type = 1; // 消息类型:1-文本,2-图片,3-视频
|
||
string content = 2; // 消息内容(文本内容、图片URL、视频URL等)
|
||
string thumbnail = 3; // 缩略图URL(用于图片和视频)
|
||
int32 duration = 4; // 时长(秒,用于视频)
|
||
int64 fileSize = 5; // 文件大小(字节,用于图片和视频)
|
||
int32 width = 6; // 宽度(像素,用于图片和视频)
|
||
int32 height = 7; // 高度(像素,用于图片和视频)
|
||
}
|
||
|
||
// 定时任务信息
|
||
message ScheduledTaskInfo {
|
||
string id = 1; // 任务ID
|
||
string userID = 2; // 用户ID
|
||
string name = 3; // 任务名称
|
||
string cronExpression = 4; // Crontab表达式:分 时 日 月 周(例如:"0 9 * * *")
|
||
repeated ScheduledTaskMessage messages = 5; // 消息列表(支持多条消息一起发送)
|
||
repeated string recvIDs = 6; // 接收者ID列表(单聊,可以多个)
|
||
repeated string groupIDs = 7; // 群组ID列表(群聊,可以多个)
|
||
int32 status = 8; // 状态:0-已禁用,1-已启用
|
||
int64 createTime = 9; // 创建时间(毫秒时间戳)
|
||
int64 updateTime = 10; // 更新时间(毫秒时间戳)
|
||
}
|
||
|
||
// 创建定时任务请求
|
||
message CreateScheduledTaskReq {
|
||
string name = 1; // 任务名称
|
||
string cronExpression = 2; // Crontab表达式
|
||
repeated ScheduledTaskMessage messages = 3; // 消息列表
|
||
repeated string recvIDs = 4; // 接收者ID列表(单聊,可以多个)
|
||
repeated string groupIDs = 5; // 群组ID列表(群聊,可以多个)
|
||
int32 status = 6; // 状态:0-已禁用,1-已启用
|
||
}
|
||
|
||
message CreateScheduledTaskResp {
|
||
string taskID = 1; // 任务ID
|
||
}
|
||
|
||
// 获取定时任务请求
|
||
message GetScheduledTaskReq {
|
||
string taskID = 1; // 任务ID
|
||
}
|
||
|
||
message GetScheduledTaskResp {
|
||
ScheduledTaskInfo task = 1; // 任务信息
|
||
}
|
||
|
||
// 获取定时任务列表请求
|
||
message GetScheduledTasksReq {
|
||
openim.sdkws.RequestPagination pagination = 1; // 分页信息
|
||
}
|
||
|
||
message GetScheduledTasksResp {
|
||
uint32 total = 1; // 总数
|
||
repeated ScheduledTaskInfo tasks = 2; // 任务列表
|
||
}
|
||
|
||
// 更新定时任务请求
|
||
message UpdateScheduledTaskReq {
|
||
string taskID = 1; // 任务ID
|
||
string name = 2; // 任务名称(可选)
|
||
string cronExpression = 3; // Crontab表达式(可选)
|
||
repeated ScheduledTaskMessage messages = 4; // 消息列表(可选)
|
||
repeated string recvIDs = 5; // 接收者ID列表(可选)
|
||
repeated string groupIDs = 6; // 群组ID列表(可选)
|
||
int32 status = 7; // 状态(可选)
|
||
}
|
||
|
||
message UpdateScheduledTaskResp {}
|
||
|
||
// 删除定时任务请求
|
||
message DeleteScheduledTaskReq {
|
||
repeated string taskIDs = 1; // 任务ID列表
|
||
}
|
||
|
||
message DeleteScheduledTaskResp {}
|
||
|
||
service chat {
|
||
rpc AddFriend(AddFriendReq) returns (AddFriendResp);
|
||
// Edit personal information - called by the user or an administrator
|
||
rpc UpdateUserInfo(UpdateUserInfoReq) returns (UpdateUserInfoResp);
|
||
rpc AddUserAccount(AddUserAccountReq) returns (AddUserAccountResp);
|
||
// Get user's public information - called by strangers
|
||
rpc SearchUserPublicInfo(SearchUserPublicInfoReq) returns (SearchUserPublicInfoResp);
|
||
rpc FindUserPublicInfo(FindUserPublicInfoReq) returns (FindUserPublicInfoResp);
|
||
// Search user information - called by administrators, other users get public fields
|
||
rpc SearchUserFullInfo(SearchUserFullInfoReq) returns (SearchUserFullInfoResp);
|
||
rpc FindUserFullInfo(FindUserFullInfoReq) returns (FindUserFullInfoResp);
|
||
|
||
rpc SendVerifyCode(SendVerifyCodeReq) returns (SendVerifyCodeResp);
|
||
rpc VerifyCode(VerifyCodeReq) returns (VerifyCodeResp);
|
||
rpc GetCaptchaImage(GetCaptchaImageReq) returns (GetCaptchaImageResp);
|
||
rpc RegisterUser(RegisterUserReq) returns (RegisterUserResp);
|
||
rpc Login(LoginReq) returns (LoginResp);
|
||
rpc ResetPassword(ResetPasswordReq) returns (ResetPasswordResp);
|
||
rpc ChangePassword(ChangePasswordReq) returns (ChangePasswordResp);
|
||
rpc CheckUserExist(CheckUserExistReq) returns (CheckUserExistResp);
|
||
rpc DelUserAccount(DelUserAccountReq) returns (DelUserAccountResp);
|
||
|
||
rpc FindUserAccount(FindUserAccountReq) returns (FindUserAccountResp);
|
||
rpc FindAccountUser(FindAccountUserReq) returns (FindAccountUserResp);
|
||
rpc OpenIMCallback(OpenIMCallbackReq) returns (OpenIMCallbackResp);
|
||
|
||
// Statistics
|
||
rpc UserLoginCount(UserLoginCountReq) returns (UserLoginCountResp);
|
||
|
||
rpc SearchUserInfo(SearchUserInfoReq) returns (SearchUserInfoResp);
|
||
|
||
// Audio/video call and video meeting
|
||
rpc GetTokenForVideoMeeting(GetTokenForVideoMeetingReq) returns (GetTokenForVideoMeetingResp);
|
||
|
||
rpc SetAllowRegister(SetAllowRegisterReq) returns(SetAllowRegisterResp);
|
||
rpc GetAllowRegister(GetAllowRegisterReq) returns(GetAllowRegisterResp);
|
||
|
||
// ==================== 敏感词检测相关 RPC(用户端) ====================
|
||
|
||
// 获取敏感词列表(客户端启动时调用)
|
||
rpc GetSensitiveWords(GetSensitiveWordsReq) returns (GetSensitiveWordsResp);
|
||
|
||
// 检测敏感词(用户发送消息时调用)
|
||
rpc CheckSensitiveWords(CheckSensitiveWordsReq) returns (CheckSensitiveWordsResp);
|
||
|
||
// ==================== 敏感词管理相关 RPC(管理端) ====================
|
||
|
||
// 敏感词管理
|
||
rpc AddSensitiveWord(AddSensitiveWordReq) returns (AddSensitiveWordResp);
|
||
rpc UpdateSensitiveWord(UpdateSensitiveWordReq) returns (UpdateSensitiveWordResp);
|
||
rpc DeleteSensitiveWord(DeleteSensitiveWordReq) returns (DeleteSensitiveWordResp);
|
||
rpc GetSensitiveWord(GetSensitiveWordReq) returns (GetSensitiveWordResp);
|
||
rpc SearchSensitiveWords(SearchSensitiveWordsReq) returns (SearchSensitiveWordsResp);
|
||
rpc BatchAddSensitiveWords(BatchAddSensitiveWordsReq) returns (BatchAddSensitiveWordsResp);
|
||
rpc BatchUpdateSensitiveWords(BatchUpdateSensitiveWordsReq) returns (BatchUpdateSensitiveWordsResp);
|
||
rpc BatchDeleteSensitiveWords(BatchDeleteSensitiveWordsReq) returns (BatchDeleteSensitiveWordsResp);
|
||
|
||
// 敏感词分组管理
|
||
rpc AddSensitiveWordGroup(AddSensitiveWordGroupReq) returns (AddSensitiveWordGroupResp);
|
||
rpc UpdateSensitiveWordGroup(UpdateSensitiveWordGroupReq) returns (UpdateSensitiveWordGroupResp);
|
||
rpc DeleteSensitiveWordGroup(DeleteSensitiveWordGroupReq) returns (DeleteSensitiveWordGroupResp);
|
||
rpc GetSensitiveWordGroup(GetSensitiveWordGroupReq) returns (GetSensitiveWordGroupResp);
|
||
rpc GetAllSensitiveWordGroups(GetAllSensitiveWordGroupsReq) returns (GetAllSensitiveWordGroupsResp);
|
||
|
||
// 敏感词配置管理
|
||
rpc GetSensitiveWordConfig(GetSensitiveWordConfigReq) returns (GetSensitiveWordConfigResp);
|
||
rpc UpdateSensitiveWordConfig(UpdateSensitiveWordConfigReq) returns (UpdateSensitiveWordConfigResp);
|
||
|
||
// 敏感词日志管理
|
||
rpc GetSensitiveWordLogs(GetSensitiveWordLogsReq) returns (GetSensitiveWordLogsResp);
|
||
rpc DeleteSensitiveWordLogs(DeleteSensitiveWordLogsReq) returns (DeleteSensitiveWordLogsResp);
|
||
|
||
// 用户登录记录管理
|
||
rpc GetUserLoginRecords(GetUserLoginRecordsReq) returns (GetUserLoginRecordsResp);
|
||
|
||
// 敏感词统计
|
||
rpc GetSensitiveWordStats(GetSensitiveWordStatsReq) returns (GetSensitiveWordStatsResp);
|
||
rpc GetSensitiveWordLogStats(GetSensitiveWordLogStatsReq) returns (GetSensitiveWordLogStatsResp);
|
||
|
||
// ==================== 系统配置相关 RPC(客户端) ====================
|
||
|
||
// 获取APP端配置(返回所有 show_in_app=true 且 enabled=true 的配置)
|
||
rpc GetAppSystemConfigs(GetAppSystemConfigsReq) returns (GetAppSystemConfigsResp);
|
||
|
||
// ==================== 钱包相关 RPC(客户端) ====================
|
||
|
||
// 获取钱包余额
|
||
rpc GetWalletBalance(GetWalletBalanceReq) returns (GetWalletBalanceResp);
|
||
|
||
// 获取钱包详细信息(包括余额、提现账号、实名信息等)
|
||
rpc GetWalletInfo(GetWalletInfoReq) returns (GetWalletInfoResp);
|
||
|
||
// 获取余额明细(余额变动记录)
|
||
rpc GetWalletBalanceRecords(GetWalletBalanceRecordsReq) returns (GetWalletBalanceRecordsResp);
|
||
|
||
// 设置支付密码(首次设置或修改)
|
||
rpc SetPaymentPassword(SetPaymentPasswordReq) returns (SetPaymentPasswordResp);
|
||
|
||
// 设置提现账号
|
||
rpc SetWithdrawAccount(SetWithdrawAccountReq) returns (SetWithdrawAccountResp);
|
||
|
||
// 申请提现
|
||
rpc CreateWithdrawApplication(CreateWithdrawApplicationReq) returns (CreateWithdrawApplicationResp);
|
||
|
||
// 获取用户的提现申请列表
|
||
rpc GetWithdrawApplications(GetWithdrawApplicationsReq) returns (GetWithdrawApplicationsResp);
|
||
|
||
// 实名认证
|
||
rpc RealNameAuth(RealNameAuthReq) returns (RealNameAuthResp);
|
||
|
||
// ==================== 收藏相关 RPC ====================
|
||
|
||
// 创建收藏
|
||
rpc CreateFavorite(CreateFavoriteReq) returns (CreateFavoriteResp);
|
||
|
||
// 获取收藏详情
|
||
rpc GetFavorite(GetFavoriteReq) returns (GetFavoriteResp);
|
||
|
||
// 获取收藏列表
|
||
rpc GetFavorites(GetFavoritesReq) returns (GetFavoritesResp);
|
||
|
||
// 搜索收藏
|
||
rpc SearchFavorites(SearchFavoritesReq) returns (SearchFavoritesResp);
|
||
|
||
// 更新收藏
|
||
rpc UpdateFavorite(UpdateFavoriteReq) returns (UpdateFavoriteResp);
|
||
|
||
// 删除收藏
|
||
rpc DeleteFavorite(DeleteFavoriteReq) returns (DeleteFavoriteResp);
|
||
|
||
// 根据标签获取收藏
|
||
rpc GetFavoritesByTags(GetFavoritesByTagsReq) returns (GetFavoritesByTagsResp);
|
||
|
||
// 获取收藏数量
|
||
rpc GetFavoriteCount(GetFavoriteCountReq) returns (GetFavoriteCountResp);
|
||
|
||
// ==================== 定时任务相关 RPC ====================
|
||
|
||
// 创建定时任务
|
||
rpc CreateScheduledTask(CreateScheduledTaskReq) returns (CreateScheduledTaskResp);
|
||
|
||
// 获取定时任务详情
|
||
rpc GetScheduledTask(GetScheduledTaskReq) returns (GetScheduledTaskResp);
|
||
|
||
// 获取定时任务列表
|
||
rpc GetScheduledTasks(GetScheduledTasksReq) returns (GetScheduledTasksResp);
|
||
|
||
// 更新定时任务
|
||
rpc UpdateScheduledTask(UpdateScheduledTaskReq) returns (UpdateScheduledTaskResp);
|
||
|
||
// 删除定时任务
|
||
rpc DeleteScheduledTask(DeleteScheduledTaskReq) returns (DeleteScheduledTaskResp);
|
||
}
|
||
|
||
// ==================== 系统配置相关消息 ====================
|
||
|
||
// 系统配置信息(客户端)
|
||
message SystemConfigInfo {
|
||
string key = 1; // 配置键(唯一标识)
|
||
string title = 2; // 配置标题
|
||
string value = 3; // 配置值(根据 valueType 解析)
|
||
int32 valueType = 4; // 配置值类型:1-字符串,2-数字,3-布尔,4-JSON
|
||
string description = 5; // 配置描述
|
||
}
|
||
|
||
// 获取APP端配置请求
|
||
message GetAppSystemConfigsReq {
|
||
}
|
||
|
||
// 获取APP端配置响应
|
||
message GetAppSystemConfigsResp {
|
||
repeated SystemConfigInfo configs = 1; // 配置列表
|
||
}
|
||
|
||
// ==================== 钱包相关消息 ====================
|
||
|
||
// 实名认证信息
|
||
message RealNameAuthInfo {
|
||
string idCard = 1; // 身份证号
|
||
string idCardPhotoFront = 2; // 身份证正面照片URL
|
||
string idCardPhotoBack = 3; // 身份证反面照片URL
|
||
string name = 4; // 真实姓名
|
||
int32 auditStatus = 5; // 审核状态:0-未审核,1-审核通过,2-审核拒绝
|
||
}
|
||
|
||
// 获取钱包余额请求
|
||
message GetWalletBalanceReq {
|
||
}
|
||
|
||
// 获取钱包余额响应
|
||
message GetWalletBalanceResp {
|
||
int64 balance = 1; // 余额(单位:分)
|
||
}
|
||
|
||
// 获取钱包详细信息请求
|
||
message GetWalletInfoReq {
|
||
}
|
||
|
||
// 获取钱包详细信息响应
|
||
message GetWalletInfoResp {
|
||
int64 balance = 1; // 余额(单位:分)
|
||
string withdrawAccount = 2; // 提现账号
|
||
int32 withdrawAccountType = 3; // 提现账号类型:1-支付宝,2-微信,3-银行卡
|
||
RealNameAuthInfo realNameAuth = 4; // 实名认证信息
|
||
string withdrawReceiveAccount = 5; // 提现收款账号
|
||
bool hasPaymentPassword = 6; // 是否已设置支付密码
|
||
}
|
||
|
||
// 设置支付密码请求
|
||
message SetPaymentPasswordReq {
|
||
string newPassword = 1; // 新支付密码(必填)
|
||
string oldPassword = 2; // 旧支付密码(修改时必填,首次设置时不需要)
|
||
}
|
||
|
||
// 设置支付密码响应
|
||
message SetPaymentPasswordResp {
|
||
}
|
||
|
||
// 设置提现账号请求
|
||
message SetWithdrawAccountReq {
|
||
string account = 1; // 提现账号(必填)
|
||
int32 accountType = 2; // 账号类型(必填):1-支付宝,2-微信,3-银行卡
|
||
}
|
||
|
||
// 设置提现账号响应
|
||
message SetWithdrawAccountResp {
|
||
}
|
||
|
||
// ==================== 余额明细相关消息 ====================
|
||
|
||
// 余额变动记录信息
|
||
message WalletBalanceRecordInfo {
|
||
string id = 1; // 记录ID
|
||
string userID = 2; // 用户ID
|
||
int64 amount = 3; // 变动金额(单位:分,正数表示增加,负数表示减少)
|
||
int32 type = 4; // 变动类型:1-充值,2-提现/提款,3-消费,4-退款,5-奖励,6-后台充值,7-发红包,8-抢红包,99-其他
|
||
int64 beforeBalance = 5; // 变动前余额(单位:分)
|
||
int64 afterBalance = 6; // 变动后余额(单位:分)
|
||
string orderID = 7; // 关联订单ID(可选)
|
||
string transactionID = 8; // 交易ID(可选)
|
||
string redPacketID = 9; // 红包ID(可选)
|
||
string remark = 10; // 备注
|
||
int64 createTime = 11; // 创建时间(毫秒时间戳)
|
||
}
|
||
|
||
// 获取余额明细请求
|
||
message GetWalletBalanceRecordsReq {
|
||
openim.sdkws.RequestPagination pagination = 1; // 分页参数
|
||
int32 type = 2; // 变动类型(可选,0表示查询所有类型)
|
||
}
|
||
|
||
// 获取余额明细响应
|
||
message GetWalletBalanceRecordsResp {
|
||
uint32 total = 1; // 总数
|
||
repeated WalletBalanceRecordInfo records = 2; // 记录列表
|
||
}
|
||
|
||
// ==================== 提现申请相关消息 ====================
|
||
|
||
// 提现申请信息
|
||
message WithdrawApplicationInfo {
|
||
string id = 1; // 申请ID
|
||
string userID = 2; // 用户ID
|
||
int64 amount = 3; // 提现金额(单位:分)
|
||
string withdrawAccount = 4; // 提现账号
|
||
int32 withdrawAccountType = 5; // 提现账号类型:1-支付宝,2-微信,3-银行卡
|
||
int32 status = 6; // 申请状态:1-待审核,2-已通过,3-已拒绝,4-处理中,5-已完成
|
||
string auditorID = 7; // 审核人ID(管理员ID)
|
||
int64 auditTime = 8; // 审核时间(毫秒时间戳)
|
||
string auditRemark = 9; // 审核备注
|
||
string ip = 10; // 申请IP
|
||
string deviceID = 11; // 设备ID
|
||
string platform = 12; // 平台(iOS、Android、Web等)
|
||
string deviceModel = 13; // 设备型号
|
||
string deviceBrand = 14; // 设备品牌
|
||
string osVersion = 15; // 操作系统版本
|
||
string appVersion = 16; // 应用版本
|
||
string remark = 17; // 申请备注(由后台管理员填写)
|
||
int64 createTime = 18; // 创建时间(毫秒时间戳)
|
||
int64 updateTime = 19; // 更新时间(毫秒时间戳)
|
||
}
|
||
|
||
// 创建提现申请请求
|
||
message CreateWithdrawApplicationReq {
|
||
int64 amount = 1; // 提现金额(单位:分)
|
||
string paymentPassword = 2; // 支付密码(必填)
|
||
string ip = 3; // 申请IP
|
||
string deviceID = 4; // 设备ID
|
||
string platform = 5; // 平台
|
||
string deviceModel = 6; // 设备型号
|
||
string deviceBrand = 7; // 设备品牌
|
||
string osVersion = 8; // 操作系统版本
|
||
string appVersion = 9; // 应用版本
|
||
}
|
||
|
||
// 创建提现申请响应
|
||
message CreateWithdrawApplicationResp {
|
||
string applicationID = 1; // 申请ID
|
||
}
|
||
|
||
// 获取用户的提现申请列表请求
|
||
message GetWithdrawApplicationsReq {
|
||
openim.sdkws.RequestPagination pagination = 1; // 分页参数
|
||
}
|
||
|
||
// 获取用户的提现申请列表响应
|
||
message GetWithdrawApplicationsResp {
|
||
uint32 total = 1; // 总数
|
||
repeated WithdrawApplicationInfo applications = 2; // 申请列表
|
||
}
|
||
|
||
// ==================== 实名认证相关消息 ====================
|
||
|
||
// 实名认证请求
|
||
message RealNameAuthReq {
|
||
string idCard = 1; // 身份证号(必填)
|
||
string name = 2; // 真实姓名(必填)
|
||
string idCardPhotoFront = 3; // 身份证正面照片URL(可选)
|
||
string idCardPhotoBack = 4; // 身份证反面照片URL(可选)
|
||
}
|
||
|
||
// 实名认证响应
|
||
message RealNameAuthResp {
|
||
bool success = 1; // 是否认证成功
|
||
string message = 2; // 认证结果消息
|
||
string idCardPhotoFront = 3; // 身份证正面照片URL
|
||
string idCardPhotoBack = 4; // 身份证反面照片URL
|
||
}
|