Browse Source

update

master
DengBiao 1 year ago
parent
commit
a8b422a631
2 changed files with 10 additions and 5 deletions
  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 View File

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


+ 1
- 1
internal/logic/domain/friend/friend_service.go View File

@@ -125,7 +125,7 @@ func (*friendService) AddFriend(ctx context.Context, userId, friendId int64, rem
if description == "社交人脉圈添加好友" { if description == "社交人脉圈添加好友" {
return FriendService.AgreeAddFriend(ctx, friendId, userId, description) return FriendService.AgreeAddFriend(ctx, friendId, userId, description)
} else if description == "客服自动添加" { } else if description == "客服自动添加" {
return FriendService.AgreeAddFriend(ctx, friendId, userId, "客服")
return FriendService.AgreeAddFriend(ctx, userId, friendId, "客服")
} else { } else {
if respFriend.User.IsAutoAddedFriends == 1 { if respFriend.User.IsAutoAddedFriends == 1 {
return FriendService.AgreeAddFriend(ctx, friendId, userId, "系统自动添加") return FriendService.AgreeAddFriend(ctx, friendId, userId, "系统自动添加")


Loading…
Cancel
Save