Files

183 lines
4.4 KiB
Protocol Buffer
Raw Permalink Normal View History

2023-07-04 11:15:20 +08:00
// Copyright © 2023 OpenIM. 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.
2023-06-29 22:35:31 +08:00
syntax = "proto3";
2023-06-30 09:45:02 +08:00
package OpenIMServer.user;
import "sdkws/sdkws.proto";
import "conversation/conversation.proto";
option go_package = "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/user";
2023-06-29 22:35:31 +08:00
2023-06-30 09:45:02 +08:00
message getAllUserIDReq{
sdkws.RequestPagination pagination = 1;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getAllUserIDResp{
int32 total = 1;
repeated string userIDs = 2;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message accountCheckReq{
repeated string checkUserIDs = 1;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message accountCheckResp{
message singleUserStatus {
2023-06-29 22:35:31 +08:00
string userID = 1;
string accountStatus = 2;
}
2023-06-30 09:45:02 +08:00
repeated singleUserStatus results = 1;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getDesignateUsersReq{
repeated string userIDs = 1;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getDesignateUsersResp{
repeated sdkws.UserInfo usersInfo = 1;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message updateUserInfoReq{
sdkws.UserInfo userInfo = 1;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message updateUserInfoResp{
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message setGlobalRecvMessageOptReq{
2022-06-16 18:59:17 +08:00
string userID = 1;
2023-07-12 15:31:24 +08:00
int32 globalRecvMsgOpt = 3;
2022-06-16 18:59:17 +08:00
}
2023-06-30 09:45:02 +08:00
message setGlobalRecvMessageOptResp{
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message setConversationReq{
OpenIMServer.conversation.Conversation conversation = 1;
2023-06-29 22:35:31 +08:00
int32 notificationType = 2;
2023-06-30 09:45:02 +08:00
string operationID = 3;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message setConversationResp{
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message setRecvMsgOptReq {
string ownerUserID = 1;
string conversationID = 2;
int32 recvMsgOpt = 3;
2023-06-29 22:35:31 +08:00
int32 notificationType = 4;
2023-06-30 09:45:02 +08:00
string operationID = 5;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message setRecvMsgOptResp {
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getConversationReq{
string conversationID = 1;
string ownerUserID = 2;
string operationID = 3;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getConversationResp{
OpenIMServer.conversation.Conversation conversation = 2;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getConversationsReq{
string ownerUserID = 1;
repeated string conversationIDs = 2;
string operationID = 3;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getConversationsResp{
repeated OpenIMServer.conversation.Conversation conversations = 2;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getAllConversationsReq{
string ownerUserID = 1;
string operationID = 2;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getAllConversationsResp{
repeated OpenIMServer.conversation.Conversation conversations = 2;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message batchSetConversationsReq{
repeated OpenIMServer.conversation.Conversation conversations = 1;
2023-06-29 22:35:31 +08:00
string OwnerUserID = 2;
int32 notificationType = 3;
string OperationID = 4;
}
2023-06-30 09:45:02 +08:00
message batchSetConversationsResp{
2022-04-20 18:06:24 +08:00
repeated string Success = 2;
repeated string Failed = 3;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getPaginationUsersReq {
sdkws.RequestPagination pagination = 2;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getPaginationUsersResp{
int32 total = 1;
repeated sdkws.UserInfo users = 2;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message userRegisterReq {
2023-06-30 23:04:28 +08:00
string secret = 1;
repeated sdkws.UserInfo users = 2;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message userRegisterResp {
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getGlobalRecvMessageOptReq{
string userID = 1;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message getGlobalRecvMessageOptResp{
int32 globalRecvMsgOpt = 1;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message userRegisterCountReq {
int64 start = 1;
int64 end = 2;
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00
message userRegisterCountResp {
int64 total = 1;
2023-07-12 15:31:24 +08:00
int64 before = 2;
map<string, int64> count = 3;
2023-06-29 22:35:31 +08:00
}
service user {
2023-06-30 09:45:02 +08:00
//获取指定的用户信息 全字段
rpc getDesignateUsers(getDesignateUsersReq) returns(getDesignateUsersResp);
//更新用户信息
rpc updateUserInfo(updateUserInfoReq) returns(updateUserInfoResp);
//设置用户消息接收选项
rpc setGlobalRecvMessageOpt(setGlobalRecvMessageOptReq) returns(setGlobalRecvMessageOptResp);
//获取用户消息接收选项 没找到不返回错误
rpc getGlobalRecvMessageOpt(getGlobalRecvMessageOptReq) returns(getGlobalRecvMessageOptResp);
//检查userID是否存在
rpc accountCheck(accountCheckReq) returns (accountCheckResp);
//翻页(或指定userID,昵称)拉取用户信息 全字段
rpc getPaginationUsers(getPaginationUsersReq) returns (getPaginationUsersResp);
//用户注册
rpc userRegister(userRegisterReq) returns (userRegisterResp);
//获取所有用户ID
rpc getAllUserID(getAllUserIDReq) returns (getAllUserIDResp);
// 获取用户总数和指定时间段内的用户增量
rpc userRegisterCount(userRegisterCountReq)returns(userRegisterCountResp);
2023-06-29 22:35:31 +08:00
}
2023-06-30 09:45:02 +08:00