Merge branch 'master' of https://gitea.nxsir.cn/nanxun/IM_NEW
This commit is contained in:
@@ -9,26 +9,42 @@ option csharp_namespace = "IM.Protocols.Grpc.User";
|
||||
package User;
|
||||
|
||||
service UserInternal {
|
||||
// 获取用户信息
|
||||
// 获取单个用户信息
|
||||
rpc GetUserInfoAsync (GetUserInfoRequest) returns (UserResponse);
|
||||
|
||||
// 批量获取用户信息
|
||||
rpc GetUserListAsync (GetUserListRequest) returns (GetUserListResponse);
|
||||
}
|
||||
|
||||
// 请求参数:Guid 在 proto 中通常传 string 格式
|
||||
// ======================== 请求 ========================
|
||||
|
||||
// 获取单个用户
|
||||
message GetUserInfoRequest {
|
||||
string userId = 1;
|
||||
string userId = 1;
|
||||
}
|
||||
|
||||
// 批量获取用户
|
||||
message GetUserListRequest {
|
||||
repeated string userIds = 1;
|
||||
}
|
||||
|
||||
// ======================== 响应 ========================
|
||||
|
||||
message UserResponse {
|
||||
string id = 1; // Guid 映射为 string
|
||||
string id = 1;
|
||||
string userName = 2;
|
||||
string nickName = 3;
|
||||
optional string email = 4; // 使用 optional 对应 string?
|
||||
optional string email = 4;
|
||||
optional string phone = 5;
|
||||
string region = 6;
|
||||
string description = 7;
|
||||
optional string avatar = 8;
|
||||
|
||||
// 使用官方时间戳类型
|
||||
google.protobuf.Timestamp creationTime = 9;
|
||||
|
||||
google.protobuf.Timestamp creationTime = 9;
|
||||
optional google.protobuf.Timestamp deletion = 10;
|
||||
}
|
||||
|
||||
// 批量返回
|
||||
message GetUserListResponse {
|
||||
repeated UserResponse users = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user