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)); }
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))))); }
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; }
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))); }
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; }
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; }
public GetFriendInfoMqResponse(FriendTypes friendType) { FriendType = friendType; }
public OneFriendInfo(long friendId, FriendTypes type) { FriendId = friendId; Type = type; }
public async Task UpdateFriend(long id, long friendId, FriendTypes type) { await DeleteFriend(id, friendId); await AddFriend(id, friendId, type); }