|
@@ -54,14 +54,16 @@ func (*groupApp) GetGroup(ctx context.Context, groupId int64) (*pb.Group, error) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
utils.FilePutContents("GetGroup", utils.SerializeStr(map[string]interface{}{ |
|
|
|
|
|
"resp": group.ToProto(), |
|
|
|
|
|
})) |
|
|
|
|
|
return group.ToProto(), nil |
|
|
return group.ToProto(), nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// GetUserGroups 获取用户加入的群组列表 |
|
|
// GetUserGroups 获取用户加入的群组列表 |
|
|
func (*groupApp) GetUserGroups(ctx context.Context, userId int64) ([]*pb.Group, error) { |
|
|
func (*groupApp) GetUserGroups(ctx context.Context, userId int64) ([]*pb.Group, error) { |
|
|
|
|
|
masterId, err := grpclib.GetCtxMasterId(ctx) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
groups, err := repo.GroupUserRepo.ListByUserId(userId) |
|
|
groups, err := repo.GroupUserRepo.ListByUserId(userId) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, err |
|
|
return nil, err |
|
@@ -70,6 +72,9 @@ 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].Name, "官方") && !strings.Contains(pbGroups[i].Name, "运营中心") && masterId == "68823769" { |
|
|
|
|
|
pbGroups[i].Name = "我的推荐人群" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
return pbGroups, nil |
|
|
return pbGroups, nil |
|
|
} |
|
|
} |
|
@@ -117,7 +122,7 @@ func (*groupApp) AddMembers(ctx context.Context, userId, groupId int64, userIds |
|
|
return nil, err |
|
|
return nil, err |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
err = group.PushAddMember(ctx, userId, addedIds, false) |
|
|
|
|
|
|
|
|
err = group.PushAddMember(ctx, userId, addedIds, true) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, err |
|
|
return nil, err |
|
|
} |
|
|
} |
|
|