|
|
|
package group
|
|
|
|
|
|
|
|
import (
|
|
|
|
"Open_IM/pkg/common/db/table/relation"
|
|
|
|
pbGroup "Open_IM/pkg/proto/group"
|
|
|
|
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func DbToPbGroupInfo(m *relation.GroupModel, ownerUserID string, memberCount uint32) *open_im_sdk.GroupInfo {
|
|
|
|
return &open_im_sdk.GroupInfo{
|
|
|
|
GroupID: m.GroupID,
|
|
|
|
GroupName: m.GroupName,
|
|
|
|
Notification: m.Notification,
|
|
|
|
Introduction: m.Introduction,
|
|
|
|
FaceURL: m.FaceURL,
|
|
|
|
OwnerUserID: ownerUserID,
|
|
|
|
CreateTime: m.CreateTime.UnixMilli(),
|
|
|
|
MemberCount: memberCount,
|
|
|
|
Ex: m.Ex,
|
|
|
|
Status: m.Status,
|
|
|
|
CreatorUserID: m.CreatorUserID,
|
|
|
|
GroupType: m.GroupType,
|
|
|
|
NeedVerification: m.NeedVerification,
|
|
|
|
LookMemberInfo: m.LookMemberInfo,
|
|
|
|
ApplyMemberFriend: m.ApplyMemberFriend,
|
|
|
|
NotificationUpdateTime: m.NotificationUpdateTime.UnixMilli(),
|
|
|
|
NotificationUserID: m.NotificationUserID,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func PbToDbGroupRequest(req *pbGroup.GroupApplicationResponseReq, handleUserID string) *relation.GroupRequestModel {
|
|
|
|
return &relation.GroupRequestModel{
|
|
|
|
UserID: req.FromUserID,
|
|
|
|
GroupID: req.GroupID,
|
|
|
|
HandleResult: req.HandleResult,
|
|
|
|
HandledMsg: req.HandledMsg,
|
|
|
|
HandleUserID: handleUserID,
|
|
|
|
HandledTime: time.Now(),
|
|
|
|
}
|
|
|
|
}
|