DengBiao pirms 1 gada
vecāks
revīzija
7aac55987a
2 mainītis faili ar 26 papildinājumiem un 10 dzēšanām
  1. +21
    -9
      internal/logic/domain/group/model/group.go
  2. +5
    -1
      pkg/urlwhitelist/urlwhitelist.go

+ 21
- 9
internal/logic/domain/group/model/group.go Parādīt failu

@@ -494,7 +494,7 @@ func (g *Group) PushGroupMemberBanned(ctx context.Context, optId, userId int64,
if err != nil {
return err
}
if !isAllMemberBanned {
if !isAllMemberBanned && userId > 0 {
bannedUserResp, err := rpc.GetBusinessIntClient().GetUser(ctx, &pb.GetUserReq{UserId: userId})
if err != nil {
return err
@@ -510,14 +510,26 @@ func (g *Group) PushGroupMemberBanned(ctx context.Context, optId, userId int64,
}
return nil
} else {
err = g.PushMessage(ctx, pb.PushCode_PC_BANNED_GROUP_MEMBER, &pb.BannedGroupMemberPush{
OptId: optId,
OptName: userResp.User.Nickname,
BannedUserId: userId,
BannedUserName: fmt.Sprintf("管理员\"%s\"设置了禁言", userResp.User.Nickname),
}, true)
if err != nil {
return err
if userId == 0 {
err = g.PushMessage(ctx, pb.PushCode_PC_BANNED_GROUP_MEMBER, &pb.BannedGroupMemberPush{
OptId: optId,
OptName: userResp.User.Nickname,
BannedUserId: userId,
BannedUserName: fmt.Sprintf("管理员\"%s\"设置群禁言", userResp.User.Nickname),
}, true)
if err != nil {
return err
}
} else {
err = g.PushMessage(ctx, pb.PushCode_PC_BANNED_GROUP_MEMBER, &pb.BannedGroupMemberPush{
OptId: optId,
OptName: userResp.User.Nickname,
BannedUserId: userId,
BannedUserName: fmt.Sprintf("管理员\"%s\"取消群禁言", userResp.User.Nickname),
}, true)
if err != nil {
return err
}
}
return nil
}


+ 5
- 1
pkg/urlwhitelist/urlwhitelist.go Parādīt failu

@@ -8,5 +8,9 @@ var Business = map[string]int{
}

var Logic = map[string]int{
"/pb.LogicExt/RegisterDevice": 0,
"/pb.LogicExt/RegisterDevice": 0,
"/pb.LogicExt/GetGroup": 1,
"/pb.LogicExt/GetGroupBannedMembers": 2,
"/pb.LogicExt/SetGroupBannedMembers": 3,
"/pb.LogicExt/SendMessage": 4,
}

Notiek ielāde…
Atcelt
Saglabāt