mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 20:30:40 +08:00
Merge remote-tracking branch 'origin/errcode' into errcode
# Conflicts: # pkg/proto/sdk_ws/ws.proto
This commit is contained in:
commit
0e1982083e
@ -138,9 +138,9 @@ func syncPeerUserConversation(conversation *pbConversation.Conversation, operati
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *userServer) GetUserInfo(ctx context.Context, req *pbUser.GetUserInfoReq) (*pbUser.GetUserInfoResp, error) {
|
||||
resp := &pbUser.GetUserInfoResp{}
|
||||
users, err := s.Find(ctx, req.UserIDList)
|
||||
func (s *userServer) GetUsersInfo(ctx context.Context, req *pbUser.GetUsersInfoReq) (*pbUser.GetUsersInfoResp, error) {
|
||||
resp := &pbUser.GetUsersInfoResp{}
|
||||
users, err := s.Find(ctx, req.UserIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -149,7 +149,7 @@ func (s *userServer) GetUserInfo(ctx context.Context, req *pbUser.GetUserInfoReq
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.UserInfoList = append(resp.UserInfoList, n)
|
||||
resp.UsersInfo = append(resp.UsersInfo, n)
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
@ -23,10 +23,18 @@ type DBFriend struct {
|
||||
*relation.Friend
|
||||
}
|
||||
|
||||
func NewDBFriend(friend *relation.Friend) *DBFriend {
|
||||
return &DBFriend{Friend: friend}
|
||||
}
|
||||
|
||||
type PBFriend struct {
|
||||
*sdk.FriendInfo
|
||||
}
|
||||
|
||||
func NewPBFriend(friendInfo *sdk.FriendInfo) *PBFriend {
|
||||
return &PBFriend{FriendInfo: friendInfo}
|
||||
}
|
||||
|
||||
func (db *DBFriend) convert() (*sdk.FriendInfo, error) {
|
||||
pbFriend := &sdk.FriendInfo{FriendUser: &sdk.UserInfo{}}
|
||||
utils.CopyStructFields(pbFriend, db)
|
||||
@ -53,10 +61,18 @@ type DBFriendRequest struct {
|
||||
*relation.FriendRequest
|
||||
}
|
||||
|
||||
func NewDBFriendRequest(friendRequest *relation.FriendRequest) *DBFriendRequest {
|
||||
return &DBFriendRequest{FriendRequest: friendRequest}
|
||||
}
|
||||
|
||||
type PBFriendRequest struct {
|
||||
*sdk.FriendRequest
|
||||
}
|
||||
|
||||
func NewPBFriendRequest(friendRequest *sdk.FriendRequest) *PBFriendRequest {
|
||||
return &PBFriendRequest{FriendRequest: friendRequest}
|
||||
}
|
||||
|
||||
func (pb *PBFriendRequest) Convert() (*relation.FriendRequest, error) {
|
||||
dbFriendRequest := &relation.FriendRequest{}
|
||||
utils.CopyStructFields(dbFriendRequest, pb)
|
||||
@ -90,10 +106,18 @@ type DBBlack struct {
|
||||
*relation.Black
|
||||
}
|
||||
|
||||
func NewDBBlack(black *relation.Black) *DBBlack {
|
||||
return &DBBlack{Black: black}
|
||||
}
|
||||
|
||||
type PBBlack struct {
|
||||
*sdk.BlackInfo
|
||||
}
|
||||
|
||||
func NewPBBlack(blackInfo *sdk.BlackInfo) *PBBlack {
|
||||
return &PBBlack{BlackInfo: blackInfo}
|
||||
}
|
||||
|
||||
func (pb *PBBlack) Convert() (*relation.Black, error) {
|
||||
dbBlack := &relation.Black{}
|
||||
dbBlack.BlockUserID = pb.BlackUserInfo.UserID
|
||||
@ -116,10 +140,18 @@ type DBGroup struct {
|
||||
*relation.Group
|
||||
}
|
||||
|
||||
func NewDBGroup(group *relation.Group) *DBGroup {
|
||||
return &DBGroup{Group: group}
|
||||
}
|
||||
|
||||
type PBGroup struct {
|
||||
*sdk.GroupInfo
|
||||
}
|
||||
|
||||
func NewPBGroup(groupInfo *sdk.GroupInfo) *PBGroup {
|
||||
return &PBGroup{GroupInfo: groupInfo}
|
||||
}
|
||||
|
||||
func (pb *PBGroup) Convert() *relation.Group {
|
||||
dst := &relation.Group{}
|
||||
_ = utils.CopyStructFields(dst, pb)
|
||||
@ -151,10 +183,18 @@ type DBGroupMember struct {
|
||||
*relation.GroupMember
|
||||
}
|
||||
|
||||
func NewDBGroupMember(groupMember *relation.GroupMember) *DBGroupMember {
|
||||
return &DBGroupMember{GroupMember: groupMember}
|
||||
}
|
||||
|
||||
type PBGroupMember struct {
|
||||
*sdk.GroupMemberFullInfo
|
||||
}
|
||||
|
||||
func NewPBGroupMember(groupMemberFullInfo *sdk.GroupMemberFullInfo) *PBGroupMember {
|
||||
return &PBGroupMember{GroupMemberFullInfo: groupMemberFullInfo}
|
||||
}
|
||||
|
||||
func (pb *PBGroupMember) Convert() (*relation.GroupMember, error) {
|
||||
dst := &relation.GroupMember{}
|
||||
utils.CopyStructFields(dst, pb)
|
||||
@ -187,10 +227,18 @@ type DBGroupRequest struct {
|
||||
*relation.GroupRequest
|
||||
}
|
||||
|
||||
func NewDBGroupRequest(groupRequest *relation.GroupRequest) *DBGroupRequest {
|
||||
return &DBGroupRequest{GroupRequest: groupRequest}
|
||||
}
|
||||
|
||||
type PBGroupRequest struct {
|
||||
*sdk.GroupRequest
|
||||
}
|
||||
|
||||
func NewPBGroupRequest(groupRequest *sdk.GroupRequest) *PBGroupRequest {
|
||||
return &PBGroupRequest{GroupRequest: groupRequest}
|
||||
}
|
||||
|
||||
func (pb *PBGroupRequest) Convert() (*relation.GroupRequest, error) {
|
||||
dst := &relation.GroupRequest{}
|
||||
utils.CopyStructFields(dst, pb)
|
||||
@ -210,10 +258,18 @@ type DBUser struct {
|
||||
*relation.User
|
||||
}
|
||||
|
||||
func NewDBUser(user *relation.User) *DBUser {
|
||||
return &DBUser{User: user}
|
||||
}
|
||||
|
||||
type PBUser struct {
|
||||
*sdk.UserInfo
|
||||
}
|
||||
|
||||
func NewPBUser(userInfo *sdk.UserInfo) *PBUser {
|
||||
return &PBUser{UserInfo: userInfo}
|
||||
}
|
||||
|
||||
func (pb *PBUser) Convert() (*relation.User, error) {
|
||||
dst := &relation.User{}
|
||||
utils.CopyStructFields(dst, pb)
|
||||
|
@ -14,48 +14,6 @@ message AdminLoginResp {
|
||||
string faceURL = 3;
|
||||
}
|
||||
|
||||
message GetUserTokenReq {
|
||||
string operationID = 1;
|
||||
string userID = 2;
|
||||
int32 platformID = 3;
|
||||
}
|
||||
|
||||
message GetUserTokenResp {
|
||||
CommonResp commonResp = 1;
|
||||
string token = 2;
|
||||
int64 expTime = 3;
|
||||
}
|
||||
|
||||
message AddUserRegisterAddFriendIDListReq {
|
||||
string operationID = 1;
|
||||
repeated string userIDList = 2;
|
||||
}
|
||||
|
||||
message AddUserRegisterAddFriendIDListResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message ReduceUserRegisterAddFriendIDListReq {
|
||||
string operationID = 1;
|
||||
int32 operation = 2;
|
||||
repeated string userIDList = 3;
|
||||
}
|
||||
|
||||
message ReduceUserRegisterAddFriendIDListResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message GetUserRegisterAddFriendIDListReq {
|
||||
string operationID = 1;
|
||||
server_api_params.RequestPagination pagination = 2;
|
||||
}
|
||||
|
||||
message GetUserRegisterAddFriendIDListResp {
|
||||
repeated server_api_params.UserInfo userInfoList = 1;
|
||||
server_api_params.ResponsePagination pagination = 2;
|
||||
CommonResp commonResp = 3;
|
||||
}
|
||||
|
||||
message GetChatLogsReq {
|
||||
string content = 1;
|
||||
string sendID = 2;
|
||||
@ -64,8 +22,6 @@ message GetChatLogsReq {
|
||||
int32 sessionType = 5;
|
||||
int32 contentType = 6;
|
||||
server_api_params.RequestPagination pagination = 7;
|
||||
string operationID = 8;
|
||||
string opUserID = 9;
|
||||
}
|
||||
|
||||
message ChatLog {
|
||||
@ -91,9 +47,7 @@ message ChatLog {
|
||||
|
||||
message GetChatLogsResp {
|
||||
repeated ChatLog chatLogs = 1;
|
||||
server_api_params.ResponsePagination pagination = 2;
|
||||
int32 chatLogsNum = 3;
|
||||
CommonResp commonResp = 4;
|
||||
int32 chatLogsNum = 2;
|
||||
}
|
||||
|
||||
|
||||
@ -104,7 +58,6 @@ message StatisticsReq {
|
||||
|
||||
message GetActiveUserReq{
|
||||
StatisticsReq statisticsReq = 1;
|
||||
string operationID = 2;
|
||||
}
|
||||
|
||||
message UserResp{
|
||||
@ -115,24 +68,20 @@ message UserResp{
|
||||
|
||||
message GetActiveUserResp {
|
||||
repeated UserResp Users = 1;
|
||||
CommonResp commonResp = 2;
|
||||
}
|
||||
|
||||
message GetActiveGroupReq{
|
||||
StatisticsReq statisticsReq = 1;
|
||||
string operationID = 2;
|
||||
}
|
||||
|
||||
message GroupResp {
|
||||
string GroupName = 1;
|
||||
string GroupId = 2;
|
||||
string GroupID = 2;
|
||||
int32 MessageNum = 3;
|
||||
CommonResp commonResp = 4;
|
||||
}
|
||||
|
||||
message GetActiveGroupResp {
|
||||
repeated GroupResp Groups = 1;
|
||||
CommonResp commonResp = 2;
|
||||
}
|
||||
|
||||
message DateNumList {
|
||||
@ -181,124 +130,8 @@ message GetUserStatisticsResp {
|
||||
repeated DateNumList IncreaseUserNumList = 4;
|
||||
repeated DateNumList ActiveUserNumList = 5;
|
||||
repeated DateNumList TotalUserNumList = 6;
|
||||
CommonResp commonResp = 7;
|
||||
}
|
||||
|
||||
message GenerateInvitationCodeReq {
|
||||
string operationID = 1;
|
||||
int32 codeLen = 2;
|
||||
int32 codeNum = 3;
|
||||
}
|
||||
|
||||
message GenerateInvitationCodeResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message GetInvitationCodesReq {
|
||||
string operationID = 1;
|
||||
string code = 2;
|
||||
int32 status = 3;
|
||||
server_api_params.RequestPagination pagination = 4;
|
||||
}
|
||||
|
||||
message invitationCode {
|
||||
string invitationCode = 1;
|
||||
int32 createTime = 2;
|
||||
int32 lastTime = 3;
|
||||
string userID = 4;
|
||||
int32 status = 5;
|
||||
}
|
||||
|
||||
message GetInvitationCodesResp {
|
||||
repeated invitationCode invitationCodes = 1;
|
||||
server_api_params.ResponsePagination Pagination = 2;
|
||||
CommonResp commonResp = 3;
|
||||
}
|
||||
|
||||
message QueryIPRegisterReq {
|
||||
string operationID = 1;
|
||||
string IP = 2;
|
||||
}
|
||||
|
||||
message QueryIPRegisterResp {
|
||||
string IP = 1;
|
||||
int32 RegisterNum = 2;
|
||||
int32 Status = 3;
|
||||
repeated string userIDList = 4;
|
||||
CommonResp commonResp = 5;
|
||||
}
|
||||
|
||||
message AddIPLimitReq {
|
||||
string operationID = 1;
|
||||
string IP = 2;
|
||||
int32 limitTime = 3;
|
||||
}
|
||||
|
||||
message AddIPLimitResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message RemoveIPLimitReq {
|
||||
string operationID = 1;
|
||||
string IP = 2;
|
||||
}
|
||||
|
||||
message RemoveIPLimitResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message QueryUserIDIPLimitLoginReq {
|
||||
string operationID = 1;
|
||||
string userID = 2;
|
||||
}
|
||||
|
||||
message UserIPLimit {
|
||||
string userID = 1;
|
||||
string IP = 2;
|
||||
int32 createTime = 3;
|
||||
}
|
||||
|
||||
message QueryUserIDIPLimitLoginResp {
|
||||
repeated UserIPLimit UserIPLimits = 1;
|
||||
CommonResp commonResp = 2;
|
||||
}
|
||||
|
||||
message AddUserIPLimitLoginReq {
|
||||
string userID = 1;
|
||||
string operationID = 2;
|
||||
string IP = 3;
|
||||
}
|
||||
|
||||
message AddUserIPLimitLoginResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message RemoveUserIPLimitReq {
|
||||
string userID = 1;
|
||||
string operationID = 2;
|
||||
string IP = 3;
|
||||
}
|
||||
|
||||
message RemoveUserIPLimitResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message GetClientInitConfigReq {
|
||||
string operationID = 1;
|
||||
}
|
||||
|
||||
message GetClientInitConfigResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message SetClientInitConfigReq {
|
||||
string operationID = 1;
|
||||
string discoverPageURL = 2;
|
||||
}
|
||||
|
||||
message SetClientInitConfigResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message GetUserFriendsReq {
|
||||
string operationID = 1;
|
||||
@ -308,59 +141,39 @@ message GetUserFriendsReq {
|
||||
server_api_params.RequestPagination pagination = 5;
|
||||
}
|
||||
|
||||
|
||||
message GetUserFriendsResp {
|
||||
server_api_params.ResponsePagination pagination = 1;
|
||||
repeated server_api_params.FriendInfo friendInfoList = 2;
|
||||
int32 friendNums = 3;
|
||||
CommonResp commonResp = 4;
|
||||
}
|
||||
|
||||
message GetUserIDByEmailAndPhoneNumberReq{
|
||||
string operationID = 1;
|
||||
string email = 2;
|
||||
string phoneNumber = 3;
|
||||
}
|
||||
|
||||
message GetUserIDByEmailAndPhoneNumberResp{
|
||||
repeated string userIDList = 1;
|
||||
CommonResp commonResp = 2;
|
||||
}
|
||||
|
||||
message GetUserTokenReq {
|
||||
string userID = 1;
|
||||
int32 platformID = 2;
|
||||
}
|
||||
|
||||
message GetUserTokenResp {
|
||||
string token = 1;
|
||||
int64 expTime = 2;
|
||||
}
|
||||
|
||||
service adminCMS {
|
||||
rpc AdminLogin(AdminLoginReq) returns(AdminLoginResp);
|
||||
|
||||
rpc AddUserRegisterAddFriendIDList(AddUserRegisterAddFriendIDListReq) returns(AddUserRegisterAddFriendIDListResp);
|
||||
rpc ReduceUserRegisterAddFriendIDList(ReduceUserRegisterAddFriendIDListReq) returns(ReduceUserRegisterAddFriendIDListResp);
|
||||
rpc GetUserRegisterAddFriendIDList(GetUserRegisterAddFriendIDListReq) returns(GetUserRegisterAddFriendIDListResp);
|
||||
|
||||
|
||||
rpc GetChatLogs(GetChatLogsReq) returns(GetChatLogsResp);
|
||||
|
||||
rpc GetActiveUser(GetActiveUserReq) returns(GetActiveUserResp);
|
||||
rpc GetActiveGroup(GetActiveGroupReq) returns(GetActiveGroupResp);
|
||||
rpc GetMessageStatistics(GetMessageStatisticsReq) returns(GetMessageStatisticsResp);
|
||||
rpc GetGroupStatistics(GetGroupStatisticsReq) returns(GetGroupStatisticsResp);
|
||||
rpc GetUserStatistics(GetUserStatisticsReq) returns(GetUserStatisticsResp);
|
||||
|
||||
rpc GenerateInvitationCode(GenerateInvitationCodeReq) returns(GenerateInvitationCodeResp);
|
||||
rpc GetInvitationCodes(GetInvitationCodesReq) returns(GetInvitationCodesResp);
|
||||
|
||||
rpc QueryIPRegister(QueryIPRegisterReq) returns(QueryIPRegisterResp);
|
||||
rpc AddIPLimit(AddIPLimitReq) returns(AddIPLimitResp);
|
||||
rpc RemoveIPLimit(RemoveIPLimitReq) returns(RemoveIPLimitResp);
|
||||
rpc QueryUserIDIPLimitLogin(QueryUserIDIPLimitLoginReq) returns(QueryUserIDIPLimitLoginResp);
|
||||
rpc AddUserIPLimitLogin(AddUserIPLimitLoginReq) returns(AddUserIPLimitLoginResp);
|
||||
rpc RemoveUserIPLimit(RemoveUserIPLimitReq) returns(RemoveUserIPLimitResp);
|
||||
|
||||
rpc GetClientInitConfig(GetClientInitConfigReq) returns(GetClientInitConfigResp);
|
||||
rpc SetClientInitConfig(SetClientInitConfigReq) returns(SetClientInitConfigResp);
|
||||
|
||||
rpc GetUserFriends(GetUserFriendsReq) returns(GetUserFriendsResp);
|
||||
|
||||
rpc GetUserIDByEmailAndPhoneNumber(GetUserIDByEmailAndPhoneNumberReq) returns(GetUserIDByEmailAndPhoneNumberResp);
|
||||
|
||||
rpc GetUserToken(GetUserTokenReq) returns(GetUserTokenResp);
|
||||
}
|
||||
|
@ -5,11 +5,6 @@ package server_api_params;
|
||||
|
||||
|
||||
////////////////////////////////base///////////////////////////////
|
||||
message CommonResp{
|
||||
int32 errCode = 1;
|
||||
string errMsg = 2;
|
||||
string detailErrMsg =3;
|
||||
}
|
||||
|
||||
message GroupInfo{
|
||||
string groupID = 1;
|
||||
@ -562,7 +557,7 @@ message InvitationInfo {
|
||||
string mediaType = 7;
|
||||
int32 platformID = 8;
|
||||
int32 sessionType = 9;
|
||||
int64 initiateTime = 10;
|
||||
int32 initiateTime = 10;
|
||||
repeated string busyLineUserIDList = 11;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -124,55 +124,6 @@ message GetUsersResp{
|
||||
repeated server_api_params.UserInfo users = 2;
|
||||
}
|
||||
|
||||
message AddUserReq{
|
||||
server_api_params.UserInfo userInfo = 1;
|
||||
string operationID = 2;
|
||||
}
|
||||
|
||||
message AddUserResp{
|
||||
}
|
||||
|
||||
|
||||
message BlockUserReq{
|
||||
string userID = 1;
|
||||
string endDisableTime = 2;
|
||||
string operationID = 3;
|
||||
string opUserID = 4;
|
||||
}
|
||||
|
||||
message BlockUserResp{
|
||||
CommonResp CommonResp = 1;
|
||||
}
|
||||
|
||||
message UnBlockUserReq{
|
||||
string userID = 1;
|
||||
string operationID = 2;
|
||||
string opUserID = 3;
|
||||
}
|
||||
|
||||
message UnBlockUserResp{
|
||||
CommonResp CommonResp = 1;
|
||||
}
|
||||
|
||||
message GetBlockUsersReq{
|
||||
server_api_params.RequestPagination pagination = 1;
|
||||
string operationID = 2;
|
||||
string userID = 3;
|
||||
int32 totalBlockUserNum = 4;
|
||||
}
|
||||
|
||||
message BlockUser {
|
||||
server_api_params.UserInfo UserInfo = 1;
|
||||
string BeginDisableTime = 2;
|
||||
string EndDisableTime = 3;
|
||||
}
|
||||
|
||||
message GetBlockUsersResp{
|
||||
repeated BlockUser BlockUsers = 2;
|
||||
server_api_params.ResponsePagination Pagination = 3;
|
||||
int32 UserNums = 4;
|
||||
}
|
||||
|
||||
|
||||
service user {
|
||||
//获取指定的用户信息 全字段
|
||||
|
Loading…
x
Reference in New Issue
Block a user