Browse Source

update

master
DengBiao 1 year ago
parent
commit
8ac443e72d
1 changed files with 15 additions and 7 deletions
  1. +15
    -7
      internal/logic/app/group_app.go

+ 15
- 7
internal/logic/app/group_app.go View File

@@ -5,7 +5,6 @@ import (
"database/sql" "database/sql"
"errors" "errors"
"gim/internal/business/comm/utils" "gim/internal/business/comm/utils"
repo2 "gim/internal/business/domain/user/repo"
"gim/internal/logic/domain/group/model" "gim/internal/logic/domain/group/model"
"gim/internal/logic/domain/group/repo" "gim/internal/logic/domain/group/repo"
"gim/pkg/db" "gim/pkg/db"
@@ -72,10 +71,10 @@ func (*groupApp) GetUserGroups(ctx context.Context, userId int64) ([]*pb.Group,
if err != nil { if err != nil {
return nil, err return nil, err
} }
user, err := repo2.UserRepo.Get(userId)
if err != nil {
return nil, err
}
//user, err := repo2.UserRepo.Get(userId)
//if err != nil {
// return nil, err
//}


groups, err := repo.GroupUserRepo.ListByUserId(userId) groups, err := repo.GroupUserRepo.ListByUserId(userId)
if err != nil { if err != nil {
@@ -85,8 +84,17 @@ func (*groupApp) GetUserGroups(ctx context.Context, userId int64) ([]*pb.Group,
pbGroups := make([]*pb.Group, len(groups)) pbGroups := make([]*pb.Group, len(groups))
for i := range groups { for i := range groups {
pbGroups[i] = groups[i].ToProto() pbGroups[i] = groups[i].ToProto()
if !strings.Contains(pbGroups[i].Introduction, user.PhoneNumber) && !strings.Contains(pbGroups[i].Name, "官方") && !strings.Contains(pbGroups[i].Name, "运营中心") && masterId == "68823769" {
pbGroups[i].Name = "我的推荐人群"
//if !strings.Contains(pbGroups[i].Introduction, user.PhoneNumber) && !strings.Contains(pbGroups[i].Name, "官方") && !strings.Contains(pbGroups[i].Name, "运营中心") && masterId == "68823769" {
// pbGroups[i].Name = "我的推荐人群"
//}
groupUser, err := repo.GroupUserRepo.Get(pbGroups[i].GroupId, userId)
if err != nil {
return nil, err
}
if !strings.Contains(pbGroups[i].Name, "官方") && !strings.Contains(pbGroups[i].Name, "运营中心") && masterId == "68823769" {
if groupUser.MemberType != int(pb.MemberType_GMT_ADMIN) {
pbGroups[i].Name = "我的推荐人群"
}
} }
} }
return pbGroups, nil return pbGroups, nil


Loading…
Cancel
Save