|
@@ -10,6 +10,7 @@ import ( |
|
|
"gim/pkg/db" |
|
|
"gim/pkg/db" |
|
|
"gim/pkg/grpclib" |
|
|
"gim/pkg/grpclib" |
|
|
"gim/pkg/pb" |
|
|
"gim/pkg/pb" |
|
|
|
|
|
"strings" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
type groupApp struct{} |
|
|
type groupApp struct{} |
|
@@ -38,13 +39,19 @@ func (*groupApp) GetGroup(ctx context.Context, groupId int64) (*pb.Group, error) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, err |
|
|
return nil, err |
|
|
} |
|
|
} |
|
|
|
|
|
masterId, err := grpclib.GetCtxMasterId(ctx) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
userId, _, err := grpclib.GetCtxData(ctx) |
|
|
userId, _, err := grpclib.GetCtxData(ctx) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, err |
|
|
return nil, err |
|
|
} |
|
|
} |
|
|
for _, member := range group.Members { |
|
|
|
|
|
if member.UserId == userId && member.MemberType != int(pb.MemberType_GMT_ADMIN) { |
|
|
|
|
|
group.Name = "我的推荐人群" |
|
|
|
|
|
|
|
|
if !strings.Contains(group.Name, "官方") && masterId == "68823769" { |
|
|
|
|
|
for _, member := range group.Members { |
|
|
|
|
|
if member.UserId == userId && member.MemberType != int(pb.MemberType_GMT_ADMIN) { |
|
|
|
|
|
group.Name = "我的推荐人群" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return group.ToProto(), nil |
|
|
return group.ToProto(), nil |
|
|