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
1.3 KiB
63 lines
1.3 KiB
package group
|
|
|
|
import (
|
|
pbGroup "Open_IM/pkg/proto/group"
|
|
sdkws "Open_IM/pkg/proto/sdkws"
|
|
"time"
|
|
)
|
|
|
|
func UpdateGroupInfoMap(group *sdkws.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.SetGroupMemberInfo) 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
|
|
}
|