You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.2 KiB
63 lines
2.2 KiB
// 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.
|
|
|
|
package group
|
|
|
|
import (
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
"github.com/OpenIMSDK/protocol/sdkws"
|
|
)
|
|
|
|
func (s *groupServer) groupDB2PB(group *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo {
|
|
return &sdkws.GroupInfo{
|
|
GroupID: group.GroupID,
|
|
GroupName: group.GroupName,
|
|
Notification: group.Notification,
|
|
Introduction: group.Introduction,
|
|
FaceURL: group.FaceURL,
|
|
OwnerUserID: ownerUserID,
|
|
CreateTime: group.CreateTime.UnixMilli(),
|
|
MemberCount: memberCount,
|
|
Ex: group.Ex,
|
|
Status: group.Status,
|
|
CreatorUserID: group.CreatorUserID,
|
|
GroupType: group.GroupType,
|
|
NeedVerification: group.NeedVerification,
|
|
LookMemberInfo: group.LookMemberInfo,
|
|
ApplyMemberFriend: group.ApplyMemberFriend,
|
|
NotificationUpdateTime: group.NotificationUpdateTime.UnixMilli(),
|
|
NotificationUserID: group.NotificationUserID,
|
|
}
|
|
}
|
|
|
|
func (s *groupServer) groupMemberDB2PB(
|
|
member *relation.GroupMemberModel,
|
|
appMangerLevel int32,
|
|
) *sdkws.GroupMemberFullInfo {
|
|
return &sdkws.GroupMemberFullInfo{
|
|
GroupID: member.GroupID,
|
|
UserID: member.UserID,
|
|
RoleLevel: member.RoleLevel,
|
|
JoinTime: member.JoinTime.UnixMilli(),
|
|
Nickname: member.Nickname,
|
|
FaceURL: member.FaceURL,
|
|
AppMangerLevel: appMangerLevel,
|
|
JoinSource: member.JoinSource,
|
|
OperatorUserID: member.OperatorUserID,
|
|
Ex: member.Ex,
|
|
MuteEndTime: member.MuteEndTime.UnixMilli(),
|
|
InviterUserID: member.InviterUserID,
|
|
}
|
|
}
|