diff --git a/internal/logic/app/group_app.go b/internal/logic/app/group_app.go index a46c1df..70f1bde 100644 --- a/internal/logic/app/group_app.go +++ b/internal/logic/app/group_app.go @@ -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 } // GetUserGroups 获取用户加入的群组列表 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) if err != nil { return nil, err @@ -70,6 +72,9 @@ func (*groupApp) GetUserGroups(ctx context.Context, userId int64) ([]*pb.Group, pbGroups := make([]*pb.Group, len(groups)) for i := range groups { pbGroups[i] = groups[i].ToProto() + if !strings.Contains(pbGroups[i].Name, "官方") && !strings.Contains(pbGroups[i].Name, "运营中心") && masterId == "68823769" { + pbGroups[i].Name = "我的推荐人群" + } } return pbGroups, nil } @@ -117,7 +122,7 @@ func (*groupApp) AddMembers(ctx context.Context, userId, groupId int64, userIds return nil, err } - err = group.PushAddMember(ctx, userId, addedIds, false) + err = group.PushAddMember(ctx, userId, addedIds, true) if err != nil { return nil, err } diff --git a/internal/logic/domain/friend/friend_service.go b/internal/logic/domain/friend/friend_service.go index f00fab9..723f731 100644 --- a/internal/logic/domain/friend/friend_service.go +++ b/internal/logic/domain/friend/friend_service.go @@ -125,7 +125,7 @@ func (*friendService) AddFriend(ctx context.Context, userId, friendId int64, rem if description == "社交人脉圈添加好友" { return FriendService.AgreeAddFriend(ctx, friendId, userId, description) } else if description == "客服自动添加" { - return FriendService.AgreeAddFriend(ctx, friendId, userId, "客服") + return FriendService.AgreeAddFriend(ctx, userId, friendId, "客服") } else { if respFriend.User.IsAutoAddedFriends == 1 { return FriendService.AgreeAddFriend(ctx, friendId, userId, "系统自动添加")