mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-08 19:16:35 +08:00
realization group rpc
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package group
|
||||
|
||||
import (
|
||||
pbGroup "Open_IM/pkg/proto/group"
|
||||
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||
"time"
|
||||
)
|
||||
|
||||
func UpdateGroupInfoMap(group *open_im_sdk.GroupInfoForSet) map[string]any {
|
||||
m := make(map[string]any)
|
||||
if group.GroupName != "" {
|
||||
m["group_name"] = group.GroupName
|
||||
}
|
||||
if group.Notification != "" {
|
||||
m["notification"] = group.Notification
|
||||
}
|
||||
if group.Introduction != "" {
|
||||
m["introduction"] = group.Introduction
|
||||
}
|
||||
if group.FaceURL != "" {
|
||||
m["face_url"] = group.FaceURL
|
||||
}
|
||||
if group.NeedVerification != nil {
|
||||
m["need_verification"] = group.NeedVerification.Value
|
||||
}
|
||||
if group.LookMemberInfo != nil {
|
||||
m["look_member_info"] = group.LookMemberInfo.Value
|
||||
}
|
||||
if group.ApplyMemberFriend != nil {
|
||||
m["apply_member_friend"] = group.ApplyMemberFriend.Value
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
func UpdateGroupStatusMap(status int) map[string]any {
|
||||
return map[string]any{
|
||||
"status": status,
|
||||
}
|
||||
}
|
||||
|
||||
func UpdateGroupMemberMutedTimeMap(t time.Time) map[string]any {
|
||||
return map[string]any{
|
||||
"mute_end_time": t,
|
||||
}
|
||||
}
|
||||
|
||||
func UpdateGroupMemberMap(req *pbGroup.SetGroupMemberInfoReq) map[string]any {
|
||||
m := make(map[string]any)
|
||||
if req.Nickname != nil {
|
||||
m["nickname"] = req.Nickname.Value
|
||||
}
|
||||
if req.FaceURL != nil {
|
||||
m["face_url"] = req.FaceURL.Value
|
||||
}
|
||||
if req.RoleLevel != nil {
|
||||
m["role_level"] = req.RoleLevel.Value
|
||||
}
|
||||
if req.Ex != nil {
|
||||
m["ex"] = req.Ex.Value
|
||||
}
|
||||
return m
|
||||
}
|
||||
Reference in New Issue
Block a user