DengBiao 1 rok temu
rodzic
commit
a8b422a631
2 zmienionych plików z 10 dodań i 5 usunięć
  1. +9
    -4
      internal/logic/app/group_app.go
  2. +1
    -1
      internal/logic/domain/friend/friend_service.go

+ 9
- 4
internal/logic/app/group_app.go Wyświetl plik

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


+ 1
- 1
internal/logic/domain/friend/friend_service.go Wyświetl plik

@@ -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, "系统自动添加")


Ładowanie…
Anuluj
Zapisz