DengBiao преди 1 година
родител
ревизия
7aac55987a
променени са 2 файла, в които са добавени 26 реда и са изтрити 10 реда
  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 Целия файл

@@ -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 Целия файл

@@ -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,
}

Зареждане…
Отказ
Запис