Пример #1
0
        public async Task AddFriend(long id, long friendId, FriendTypes type)
        {
            await LoadToRedis(id);
            await LoadToRedis(friendId);

            await Task.WhenAll(_redis.AddFriend(id, friendId, type),
                               _friendRepository.AddFriend(id, friendId, type));
        }
Пример #2
0
 public Task AddFriend(long id, long friendId, FriendTypes type)
 {
     //Builders<FriendInfo>.Update.Set(x => x.Id == id && x._friends.TryGetValue(friendId, out var value))
     return(Task.WhenAll(_dbCol.UpdateOneAsync(x => x.Id == id,
                                               Builders <FriendInfo> .Update.AddToSet
                                                   (x => x._friends.Select(y => y.Value), new OneFriendInfo(friendId, type))),
                         _dbCol.UpdateOneAsync(x => x.Id == friendId,
                                               Builders <FriendInfo> .Update.AddToSet
                                                   (x => x._friends.Select(y => y.Value), new OneFriendInfo(id, type)))));
 }
Пример #3
0
 public OneFriendVM(long id, string platformAccount,
                    string userName, int sex, string headUrl, int type, FriendTypes friendType)
 {
     Id = id;
     PlatformAccount = platformAccount;
     UserName        = userName;
     Sex             = sex;
     HeadUrl         = headUrl;
     Type            = type;
     FriendType      = friendType;
 }
Пример #4
0
        public async Task AddFriend(long id, long friendId, FriendTypes type)
        {
            await Task.WhenAll(_redis.AddHashValueAsync(KeyGenHelper.GenUserKey(id, "FriendInfo"),
                                                        friendId.ToString(), new OneFriendInfo(friendId, type)),

                               _redis.DeleteSetValueAsync(KeyGenHelper.GenUserKey(id, "ApplyedFriendInfo"),
                                                          friendId.ToString()),

                               _redis.DeleteSetValueAsync(KeyGenHelper.GenUserKey(friendId, "ApplyedFriendInfo"),
                                                          friendId.ToString()),

                               _redis.AddHashValueAsync(KeyGenHelper.GenUserKey(friendId, "FriendInfo"), id.ToString(),
                                                        new OneFriendInfo(id, type)));
        }
Пример #5
0
 public OtherAccountDetaiVM(string platformAccount, string userName,
                            int sex, string headUrl, AccountType type,
                            LevelInfoVM levelInfo, GameInfoVM gameInfo,
                            MoneyInfo moneyInfo, FriendTypes friendType)
 {
     PlatformAccount = platformAccount;
     UserName        = userName;
     Sex             = sex;
     HeadUrl         = headUrl;
     Type            = type;
     LevelInfo       = levelInfo;
     GameInfo        = gameInfo;
     MoneyInfo       = moneyInfo;
     FriendType      = friendType;
 }
Пример #6
0
 public OtherAccountDetail(long id, string platformAccount, string userName,
                           int sex, string headUrl, int type,
                           LevelInfo levelInfo, GameInfo gameInfo,
                           MoneyInfo moneyInfo, FriendTypes friendType)
 {
     Id = id;
     PlatformAccount = platformAccount;
     UserName        = userName;
     Sex             = sex;
     HeadUrl         = headUrl;
     Type            = type;
     LevelInfo       = levelInfo;
     GameInfo        = gameInfo;
     MoneyInfo       = moneyInfo;
     FriendType      = friendType;
 }
Пример #7
0
 public GetFriendInfoMqResponse(FriendTypes friendType)
 {
     FriendType = friendType;
 }
Пример #8
0
 public OneFriendInfo(long friendId, FriendTypes type)
 {
     FriendId = friendId;
     Type     = type;
 }
Пример #9
0
 public async Task UpdateFriend(long id, long friendId, FriendTypes type)
 {
     await DeleteFriend(id, friendId);
     await AddFriend(id, friendId, type);
 }