Finished playerdata endpoint aside from donation stuff and bug testing, moved what controllers use out to services

This commit is contained in:
2021-10-31 11:38:52 -04:00
parent aa68670221
commit a3a50a5e07
7 changed files with 92 additions and 22 deletions

View File

@@ -29,6 +29,16 @@ namespace TOOHUCardAPI.Data.Services
_logger.LogInformation($"User with steamid {user.SteamId} was given {points} points. New total: {user.Point}");
}
public async Task<User> SaveKeyTotal(string steamId, int keyTotal, int keyUseCount)
{
User user = await _userRepository.GetUser(steamId);
_logger.LogInformation($"User {user.SteamId} just stored some key total data, previous total and use: ({user.KeyTotal},{user.KeyUseCount}). new ({keyTotal},{keyUseCount})");
user.KeyTotal = keyTotal;
user.KeyUseCount = keyUseCount;
await _userRepository.UpdateUser(user);
return user;
}
public async Task<int> ChangePowerMaxTotal(string steamId, int amt)
{
User user = await _userRepository.GetUser(steamId);