More additions, lucky card based on day, redo of migrations because i messed up
This commit is contained in:
@@ -4,6 +4,8 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TOOHUCardAPI.Data.Services;
|
||||
using TOOHUCardAPI.DTO;
|
||||
|
||||
namespace TOOHUCardAPI.Controllers
|
||||
@@ -12,10 +14,21 @@ namespace TOOHUCardAPI.Controllers
|
||||
[ApiController]
|
||||
public class GameConfigController : ControllerBase
|
||||
{
|
||||
private readonly GameConfigurationService _gameConfigurationService;
|
||||
private readonly ILogger<GameConfigController> _logger;
|
||||
|
||||
public GameConfigController(GameConfigurationService gameConfigurationService, ILogger<GameConfigController> logger)
|
||||
{
|
||||
_gameConfigurationService = gameConfigurationService;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<GameConfigResponse> GetGameConfig()
|
||||
{
|
||||
return new GameConfigResponse();
|
||||
var response = await _gameConfigurationService.GetGameConfiguration();
|
||||
_logger.LogInformation("Game config fetched");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace TOOHUCardAPI.Controllers
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> Get(string id)
|
||||
public async Task<IActionResult> Get(long id)
|
||||
{
|
||||
User user = await _userRepository.GetUser(id);
|
||||
|
||||
|
||||
@@ -115,15 +115,15 @@ namespace TOOHUCardAPI.Controllers
|
||||
{
|
||||
PlayerDataGetRequestObject requestObject = JsonConvert.DeserializeObject<PlayerDataGetRequestObject>(body);
|
||||
IEnumerable<User> users = await Task.WhenAll(requestObject.Ids.Values.Select(val => _userService.LoginUser(val)));
|
||||
IEnumerable<string> queriedUserSteamIds = requestObject.Ids.Select(i => i.Value);
|
||||
IEnumerable<long> queriedUserSteamIds = requestObject.Ids.Select(i => i.Value);
|
||||
IEnumerable<PlayerDataGetResponseObjectPlayer> responsePlayers = users
|
||||
.Where(user => queriedUserSteamIds.Contains(user.SteamId))
|
||||
.Select(user => user.ToGetResponse(_mapper));
|
||||
Dictionary<string, PlayerDataGetResponseObjectPlayer> playersStatic = requestObject.Ids
|
||||
Dictionary<int, PlayerDataGetResponseObjectPlayer> playersStatic = requestObject.Ids
|
||||
.Select(pair =>
|
||||
KeyValuePair.Create(pair.Key, responsePlayers.FirstOrDefault(resp => resp.SteamId == pair.Value)))
|
||||
.ToDictionary(kv => kv.Key, kv => kv.Value);
|
||||
Dictionary<string, Dictionary<string, object>> dynamicResponses = playersStatic
|
||||
Dictionary<int, Dictionary<string, object>> dynamicResponses = playersStatic
|
||||
.Select(kv =>
|
||||
{
|
||||
var obj = JsonConvert.DeserializeObject<Dictionary<string, object>>(JsonConvert.SerializeObject(kv.Value));
|
||||
|
||||
@@ -4,6 +4,10 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TOOHUCardAPI.Data.Enums;
|
||||
using TOOHUCardAPI.Data.Services;
|
||||
using TOOHUCardAPI.DTO;
|
||||
|
||||
namespace TOOHUCardAPI.Controllers
|
||||
{
|
||||
@@ -11,8 +15,46 @@ namespace TOOHUCardAPI.Controllers
|
||||
[ApiController]
|
||||
public class RankDataController : MethodBasedController<RankDataController>
|
||||
{
|
||||
public RankDataController()
|
||||
private readonly ILogger<RankDataController> _logger;
|
||||
private readonly RankService _rankService;
|
||||
private readonly StoreService _storeService;
|
||||
private readonly UserService _userService;
|
||||
|
||||
public RankDataController(ILogger<RankDataController> logger, RankService rankService, StoreService storeService, UserService userService)
|
||||
{
|
||||
_logger = logger;
|
||||
_rankService = rankService;
|
||||
_storeService = storeService;
|
||||
_userService = userService;
|
||||
}
|
||||
|
||||
private RankType ParseRankType(string rankType)
|
||||
{
|
||||
if (rankType == null || rankType.Length > 1)
|
||||
{
|
||||
return RankType.All;
|
||||
}
|
||||
|
||||
char identifier = rankType.ToCharArray()[0];
|
||||
if (identifier == (char) RankType.Single)
|
||||
{
|
||||
return RankType.Single;
|
||||
}
|
||||
|
||||
if (identifier == (char) RankType.Team)
|
||||
{
|
||||
return RankType.Team;
|
||||
}
|
||||
|
||||
return RankType.All;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetRankData(string rank_type)
|
||||
{
|
||||
RankType parsedRankType = ParseRankType(rank_type);
|
||||
|
||||
return Ok(new OkResponse());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace TOOHUCardAPI.DTO
|
||||
{
|
||||
public abstract class AbstractPlayerTargetedRequest : AbstractRequest
|
||||
{
|
||||
public string SteamId { get; set; }
|
||||
public string UserId { get; set; }
|
||||
public long SteamId { get; set; }
|
||||
public long UserId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using TOOHUCardAPI.Data.Repositories;
|
||||
|
||||
namespace TOOHUCardAPI.DTO
|
||||
{
|
||||
@@ -25,11 +26,15 @@ namespace TOOHUCardAPI.DTO
|
||||
[JsonProperty("game_code")] public string GameCode { get; set; } = string.Empty;
|
||||
[JsonProperty("game_msg")] public string GameMessage { get; set; } = DEFAULT_GAME_MESSAGE;
|
||||
[JsonProperty("luck_card")] public string LuckCard { get; set; } = string.Empty;
|
||||
[JsonProperty("luck_crit")] public float LuckCrit { get; set; }
|
||||
[JsonProperty("luck_crit")] public float LuckCrit { get; set; } = .25f;
|
||||
[JsonProperty("new_card_list")] public string NewCardList { get; set; } = string.Empty;
|
||||
[JsonProperty("open_day_list")] public string OpenDayList { get; set; } = string.Empty;
|
||||
[JsonProperty("is_open_day")] public int IsOpenDay { get; set; } = 1;
|
||||
[JsonProperty("server_time")] public string ServerTime { get; set; } = string.Empty;
|
||||
|
||||
public GameConfigResponse()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@ namespace TOOHUCardAPI.DTO.PlayerData
|
||||
{
|
||||
public class PlayerDataGetRequestObject : AbstractRequest
|
||||
{
|
||||
public Dictionary<string, string> Ids;
|
||||
public Dictionary<int, long> Ids;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace TOOHUCardAPI.DTO.PlayerData
|
||||
{
|
||||
// Instead of using a defined object, use a dictionary so we can add the necessary cardgroup items. I dont want to make 20 of them in the class
|
||||
[JsonProperty("bo")]
|
||||
public Dictionary<string, Dictionary<string, object>> Players { get; set; }
|
||||
public Dictionary<int, Dictionary<string, object>> Players { get; set; }
|
||||
|
||||
}
|
||||
/**
|
||||
@@ -22,7 +22,7 @@ namespace TOOHUCardAPI.DTO.PlayerData
|
||||
public class PlayerDataGetResponseObjectPlayer: OkResponse
|
||||
{
|
||||
[JsonProperty("steamid")]
|
||||
public string SteamId { get; set; }
|
||||
public long SteamId { get; set; }
|
||||
[JsonProperty("max_wave")] public int MaxWave { get; set; } = 0;
|
||||
[JsonProperty("max_team_wave")] public int MaxTeamWave { get; set; } = 0;
|
||||
[JsonProperty("pet_level")] public int PetLevel { get; set; } = 1;
|
||||
|
||||
7
TOOHUCardAPI/DTO/RankData/RankDataGetResponse.cs
Normal file
7
TOOHUCardAPI/DTO/RankData/RankDataGetResponse.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace TOOHUCardAPI.DTO.RankData
|
||||
{
|
||||
public class RankDataGetResponse : OkResponse
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
7
TOOHUCardAPI/DTO/RankData/RankDataResetRequest.cs
Normal file
7
TOOHUCardAPI/DTO/RankData/RankDataResetRequest.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace TOOHUCardAPI.DTO.RankData
|
||||
{
|
||||
public class RankDataResetRequest: AbstractPlayerTargetedRequest
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
7
TOOHUCardAPI/DTO/RankData/RankDataResetResponse.cs
Normal file
7
TOOHUCardAPI/DTO/RankData/RankDataResetResponse.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace TOOHUCardAPI.DTO.RankData
|
||||
{
|
||||
public class RankDataResetResponse : OkResponse
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
7
TOOHUCardAPI/DTO/RankData/RankDataUploadRequest.cs
Normal file
7
TOOHUCardAPI/DTO/RankData/RankDataUploadRequest.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace TOOHUCardAPI.DTO.RankData
|
||||
{
|
||||
public class RankDataUploadRequest : AbstractPlayerTargetedRequest
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
7
TOOHUCardAPI/DTO/RankData/RankDataUploadResponse.cs
Normal file
7
TOOHUCardAPI/DTO/RankData/RankDataUploadResponse.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace TOOHUCardAPI.DTO.RankData
|
||||
{
|
||||
public class RankDataUploadResponse : OkResponse
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ namespace TOOHUCardAPI.Data
|
||||
{
|
||||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<Card> Cards { get; set; }
|
||||
public DbSet<RankEntry> RankEntries { get; set; }
|
||||
|
||||
private readonly IEnumerable<ISeeder> _seeders = new List<ISeeder>
|
||||
{
|
||||
|
||||
9
TOOHUCardAPI/Data/Enums/RankType.cs
Normal file
9
TOOHUCardAPI/Data/Enums/RankType.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace TOOHUCardAPI.Data.Enums
|
||||
{
|
||||
public enum RankType
|
||||
{
|
||||
Single = 'S',
|
||||
Team = 'D',
|
||||
All = 'T'
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@ namespace TOOHUCardAPI.Data.Enums
|
||||
{
|
||||
public enum Rarity
|
||||
{
|
||||
NORMAL = 1,
|
||||
RARE = 2,
|
||||
SUPER_RARE = 3,
|
||||
SUPER_SECRET_RARE = 4
|
||||
Normal = 1,
|
||||
Rare = 2,
|
||||
SuperRare = 3,
|
||||
SuperSecretRare = 4
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace TOOHUCardAPI.Data.Models
|
||||
{
|
||||
public class CardLevel
|
||||
{
|
||||
public string UserSteamId { get; set; }
|
||||
public long UserSteamId { get; set; }
|
||||
public string CardItemCode { get; set; }
|
||||
public Card Card { get; set; }
|
||||
public int Level { get; set; }
|
||||
|
||||
20
TOOHUCardAPI/Data/Models/RankEntry.cs
Normal file
20
TOOHUCardAPI/Data/Models/RankEntry.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using TOOHUCardAPI.Data.Enums;
|
||||
|
||||
namespace TOOHUCardAPI.Data.Models
|
||||
{
|
||||
public class RankEntry
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public RankType RankType { get; set; }
|
||||
public User User { get; set; }
|
||||
public string Version { get; set; }
|
||||
public int Wave { get; set; }
|
||||
public long Damage { get; set; }
|
||||
public List<RankTowerEntry> TowersUsed { get; set; }
|
||||
}
|
||||
}
|
||||
19
TOOHUCardAPI/Data/Models/RankTowerEntry.cs
Normal file
19
TOOHUCardAPI/Data/Models/RankTowerEntry.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace TOOHUCardAPI.Data.Models
|
||||
{
|
||||
public class RankTowerEntry
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public Card BaseUnit { get; set; }
|
||||
public int Star { get; set; }
|
||||
public int Damage { get; set; }
|
||||
public int Attack { get; set; }
|
||||
public int Power { get; set; }
|
||||
public List<Card> Equipment { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace TOOHUCardAPI.Data.Models
|
||||
public class User
|
||||
{
|
||||
[Key]
|
||||
public string SteamId { get; set; }
|
||||
public long SteamId { get; set; }
|
||||
public int MaxWave { get; set; }
|
||||
public int MaxTeamWave { get; set; }
|
||||
public int PetLevel { get; set; }
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TOOHUCardAPI.Data.Models;
|
||||
@@ -23,5 +24,10 @@ namespace TOOHUCardAPI.Data.Repositories
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Card>> GetAllCards()
|
||||
{
|
||||
return await _context.Cards.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ namespace TOOHUCardAPI.Data.Repositories
|
||||
.AsQueryable();
|
||||
}
|
||||
|
||||
public async Task<User> GetUser(string steamId, bool allowNull = false)
|
||||
public async Task<User> GetUser(long steamId, bool allowNull = false)
|
||||
{
|
||||
User user = await GetAllUsersQuery().FirstOrDefaultAsync(user => user.SteamId.Equals(steamId));
|
||||
if (user == null && !allowNull)
|
||||
@@ -40,7 +40,7 @@ namespace TOOHUCardAPI.Data.Repositories
|
||||
return user;
|
||||
}
|
||||
|
||||
public async Task<User> CreateUser(string steamId)
|
||||
public async Task<User> CreateUser(long steamId)
|
||||
{
|
||||
User user = new User
|
||||
{
|
||||
@@ -77,7 +77,7 @@ namespace TOOHUCardAPI.Data.Repositories
|
||||
return user;
|
||||
}
|
||||
|
||||
public async Task<User> GetOrCreateUser(string steamId)
|
||||
public async Task<User> GetOrCreateUser(long steamId)
|
||||
{
|
||||
User user = await GetUser(steamId, true) ?? await CreateUser(steamId);
|
||||
return user;
|
||||
|
||||
42
TOOHUCardAPI/Data/Services/GameConfigurationService.cs
Normal file
42
TOOHUCardAPI/Data/Services/GameConfigurationService.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TOOHUCardAPI.Data.Repositories;
|
||||
using TOOHUCardAPI.DTO;
|
||||
|
||||
namespace TOOHUCardAPI.Data.Services
|
||||
{
|
||||
public class GameConfigurationService
|
||||
{
|
||||
private readonly ILogger<GameConfigurationService> _logger;
|
||||
private readonly CardRepository _cardRepository;
|
||||
|
||||
private List<string> _cardBlacklist = new()
|
||||
{
|
||||
"_",
|
||||
"BonusEgg"
|
||||
};
|
||||
|
||||
public GameConfigurationService(ILogger<GameConfigurationService> logger, CardRepository cardRepository)
|
||||
{
|
||||
_logger = logger;
|
||||
_cardRepository = cardRepository;
|
||||
}
|
||||
|
||||
public async Task<GameConfigResponse> GetGameConfiguration()
|
||||
{
|
||||
var random = new Random(DateTime.Now.Date.GetHashCode());
|
||||
GameConfigResponse response = new GameConfigResponse();
|
||||
var cards = await _cardRepository.GetAllCards();
|
||||
var validCards =
|
||||
cards.Where(card => _cardBlacklist.Select(bl => !card.CardName.Contains(bl)).All(res => res))
|
||||
.Select(card => card.CardName).Append("all");
|
||||
var enumerable = validCards as string[] ?? validCards.ToArray();
|
||||
var index = random.Next(0, enumerable.Length);
|
||||
response.LuckCard = enumerable.ElementAt(index);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
||||
10
TOOHUCardAPI/Data/Services/RankService.cs
Normal file
10
TOOHUCardAPI/Data/Services/RankService.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace TOOHUCardAPI.Data.Services
|
||||
{
|
||||
public class RankService
|
||||
{
|
||||
private readonly ILogger<RankService> _logger;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -26,28 +26,29 @@ namespace TOOHUCardAPI.Data.Services
|
||||
{
|
||||
user.Point = Math.Max(0, user.Point + points);
|
||||
await _userRepository.UpdateUser(user);
|
||||
_logger.LogInformation($"User with steamid {user.SteamId} was given {points} points. New total: {user.Point}");
|
||||
_logger.LogInformation("User with steamid {SteamId} was given {PointsGiven} points. New total: {PointsTotal}", user.SteamId, points, user.Point);
|
||||
}
|
||||
|
||||
public async Task<User> SaveKeyTotal(string steamId, int keyTotal, int keyUseCount)
|
||||
public async Task<User> SaveKeyTotal(long 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})");
|
||||
_logger.LogInformation("User {SteamId} just stored some key total data, previous total and use: ({OldKeyTotal},{OldKeyUseCount}). new ({NewKeyTotal},{NewKeyUseCount})", user.SteamId, user.KeyTotal, user.KeyUseCount, keyTotal, keyUseCount);
|
||||
user.KeyTotal = keyTotal;
|
||||
user.KeyUseCount = keyUseCount;
|
||||
await _userRepository.UpdateUser(user);
|
||||
return user;
|
||||
}
|
||||
|
||||
public async Task<int> ChangePowerMaxTotal(string steamId, int amt)
|
||||
public async Task<int> ChangePowerMaxTotal(long steamId, int amt)
|
||||
{
|
||||
User user = await _userRepository.GetUser(steamId);
|
||||
user.PowerMaxTotal = Math.Clamp(user.PowerMaxTotal + amt, 0, int.MaxValue);
|
||||
await _userRepository.UpdateUser(user);
|
||||
_logger.LogInformation("User {SteamId} changed the number of MaxPower items they had by {Amount}", user.SteamId, amt);
|
||||
return user.PowerMaxTotal;
|
||||
}
|
||||
|
||||
public async Task<int> LevelUpCard(string steamId, string itemName, int levelIncrease)
|
||||
public async Task<int> LevelUpCard(long steamId, string itemName, int levelIncrease)
|
||||
{
|
||||
User user = await _userRepository.GetUser(steamId);
|
||||
Card card = await _cardRepository.GetCardByItemCode(itemName);
|
||||
@@ -57,7 +58,7 @@ namespace TOOHUCardAPI.Data.Services
|
||||
Level = 0
|
||||
};
|
||||
int totalCost =
|
||||
(card.Quality == Rarity.NORMAL ? AppSettings.PointsPerLevelNormal : AppSettings.PointsPerLevel) *
|
||||
(card.Quality == Rarity.Normal ? AppSettings.PointsPerLevelNormal : AppSettings.PointsPerLevel) *
|
||||
levelIncrease;
|
||||
if (user.Point < totalCost)
|
||||
{
|
||||
@@ -70,11 +71,11 @@ namespace TOOHUCardAPI.Data.Services
|
||||
await AddPoints(-totalCost, user);
|
||||
userCardLevel.Level += levelIncrease;
|
||||
await _userRepository.UpdateUser(user);
|
||||
_logger.LogInformation($"User with steamid {user.SteamId} leveled up card {card.CardName} to level {userCardLevel.Level}");
|
||||
_logger.LogInformation("User with steamid {SteamId} leveled up card {CardName} to level {Level}", user.SteamId, card.CardName, userCardLevel.Level);
|
||||
return totalCost;
|
||||
}
|
||||
|
||||
public async Task<int> PurchaseMagicKey(int amt, string steamId)
|
||||
public async Task<int> PurchaseMagicKey(int amt, long steamId)
|
||||
{
|
||||
int totalCost = AppSettings.PointsPerKey * amt;
|
||||
amt = Math.Clamp(amt, 0, AppSettings.MaxKeyPurchaseAmount);
|
||||
@@ -87,11 +88,11 @@ namespace TOOHUCardAPI.Data.Services
|
||||
await AddPoints(-totalCost, user);
|
||||
user.KeyTotal += amt;
|
||||
await _userRepository.UpdateUser(user);
|
||||
_logger.LogInformation($"User with steamid {user.SteamId} purchased {amt} keys for {totalCost} points. New point value is {user.Point}");
|
||||
_logger.LogInformation("User with steamid {SteamId} purchased {NumberKeys} keys for {TotalCost} points. New point value is {NewPoints}", user.SteamId, amt, totalCost, user.Point);
|
||||
return totalCost;
|
||||
}
|
||||
|
||||
public async Task<int> GiveFirstWinBonus(string steamId)
|
||||
public async Task<int> GiveFirstWinBonus(long steamId)
|
||||
{
|
||||
User user = await _userRepository.GetUser(steamId);
|
||||
|
||||
@@ -104,7 +105,7 @@ namespace TOOHUCardAPI.Data.Services
|
||||
await AddPoints(points, user);
|
||||
user.LastFirstWin = DateTime.Now;
|
||||
await _userRepository.UpdateUser(user);
|
||||
_logger.LogInformation($"User with steamid {user.SteamId} received first win of the day bonus, earning {points} points. New value: {user.Point}");
|
||||
_logger.LogInformation("User with steamid {SteamId} received first win of the day bonus, earning {BonusPoints} points. New value: {UserPoints}", user.SteamId, points, user.Point);
|
||||
return points;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ namespace TOOHUCardAPI.Data.Services
|
||||
_userRepository = userRepository;
|
||||
}
|
||||
|
||||
public async Task<User> LoginUser(string steamId)
|
||||
public async Task<User> LoginUser(long steamId)
|
||||
{
|
||||
_logger.LogInformation($"User {steamId} just logged in");
|
||||
_logger.LogInformation("User {SteamId} just logged in", steamId);
|
||||
User user = await _userRepository.GetOrCreateUser(steamId);
|
||||
if (user.LastDailyLoginBonus.AddDays(1) <= DateTime.Now)
|
||||
{
|
||||
@@ -35,11 +35,11 @@ namespace TOOHUCardAPI.Data.Services
|
||||
user.KeyTotal += AppSettings.DailyKeyBonus;
|
||||
user.LastDailyLoginBonus = DateTime.Now;;
|
||||
await _userRepository.UpdateUser(user);
|
||||
_logger.LogInformation($"User {user.SteamId} received a daily login bonus. Keys earned: {AppSettings.DailyKeyBonus}. New Key total: {user.KeyTotal}");
|
||||
_logger.LogInformation("User {SteamId} received a daily login bonus. Keys earned: {DailyKeyBonus}. New Key total: {KeyTotal}", user.SteamId, AppSettings.DailyKeyBonus, user.KeyTotal);
|
||||
return user;
|
||||
}
|
||||
|
||||
public async Task SaveCardGroup(string steamId, string groupKey, string groupData)
|
||||
public async Task SaveCardGroup(long steamId, string groupKey, string groupData)
|
||||
{
|
||||
User user = await _userRepository.GetUser(steamId);
|
||||
|
||||
@@ -49,17 +49,17 @@ namespace TOOHUCardAPI.Data.Services
|
||||
};
|
||||
group.EncodedString = groupData;
|
||||
user.EncodedCardGroups = user.EncodedCardGroups.Where(group2 => group.Id != group2.Id).Append(group).ToList();
|
||||
_logger.LogInformation($"{user.SteamId} just stored a card group");
|
||||
_logger.LogInformation("{SteamId} just stored a card group", user.SteamId);
|
||||
await _userRepository.UpdateUser(user);
|
||||
}
|
||||
|
||||
public async Task SavePetData(string steamId, string petModel, string petEffect)
|
||||
public async Task SavePetData(long steamId, string petModel, string petEffect)
|
||||
{
|
||||
User user = await _userRepository.GetUser(steamId);
|
||||
user.PetModel = petModel;
|
||||
user.PetEffect = petEffect;
|
||||
await _userRepository.UpdateUser(user);
|
||||
_logger.LogInformation($"User {user.SteamId} saved new pet data with model: {petModel} and effect {petEffect}");
|
||||
_logger.LogInformation("User {SteamId} saved new pet data with model: {PetModel} and effect {PetEffect}", user.SteamId, petModel, petEffect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TOOHUCardAPI.Data;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20211028202203_initial")]
|
||||
partial class initial
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.11");
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("EncodedString")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserSteamId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserSteamId");
|
||||
|
||||
b.ToTable("EncodedCardGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b =>
|
||||
{
|
||||
b.Property<string>("SteamId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("EndTime")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("KeySaveDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("KeyTotal")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LevelList")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("MaxTeamWave")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MaxWave")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PetLevel")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Point")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("Vip")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("SteamId");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b =>
|
||||
{
|
||||
b.HasOne("TOOHUCardAPI.Data.Models.User", null)
|
||||
.WithMany("EncodedCardGroups")
|
||||
.HasForeignKey("UserSteamId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b =>
|
||||
{
|
||||
b.Navigation("EncodedCardGroups");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
public partial class initial : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
SteamId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
MaxWave = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
MaxTeamWave = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
PetLevel = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
EndTime = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
KeyTotal = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
KeySaveDate = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
Vip = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
Point = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
LevelList = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.SteamId);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EncodedCardGroup",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
EncodedString = table.Column<string>(type: "TEXT", nullable: true),
|
||||
UserSteamId = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EncodedCardGroup", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EncodedCardGroup_Users_UserSteamId",
|
||||
column: x => x.UserSteamId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "SteamId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EncodedCardGroup_UserSteamId",
|
||||
table: "EncodedCardGroup",
|
||||
column: "UserSteamId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "EncodedCardGroup");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TOOHUCardAPI.Data;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20211029035809_groupid for encoded card group")]
|
||||
partial class groupidforencodedcardgroup
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.11");
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("CardGroupNumber")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("EncodedString")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserSteamId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserSteamId");
|
||||
|
||||
b.ToTable("EncodedCardGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b =>
|
||||
{
|
||||
b.Property<string>("SteamId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("Ban")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("EndTime")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("KeySaveDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("KeyTotal")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LevelList")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("MaxTeamWave")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MaxWave")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PetLevel")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Point")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("Vip")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("SteamId");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b =>
|
||||
{
|
||||
b.HasOne("TOOHUCardAPI.Data.Models.User", null)
|
||||
.WithMany("EncodedCardGroups")
|
||||
.HasForeignKey("UserSteamId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b =>
|
||||
{
|
||||
b.Navigation("EncodedCardGroups");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
public partial class groupidforencodedcardgroup : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Ban",
|
||||
table: "Users",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CardGroupNumber",
|
||||
table: "EncodedCardGroup",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Ban",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CardGroupNumber",
|
||||
table: "EncodedCardGroup");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TOOHUCardAPI.Data;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20211029043842_fix groupkey, they send full string")]
|
||||
partial class fixgroupkeytheysendfullstring
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.11");
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("EncodedString")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("GroupKey")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserSteamId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserSteamId");
|
||||
|
||||
b.ToTable("EncodedCardGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b =>
|
||||
{
|
||||
b.Property<string>("SteamId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("Ban")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("EndTime")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("KeySaveDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("KeyTotal")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LevelList")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("MaxTeamWave")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MaxWave")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PetLevel")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Point")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("Vip")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("SteamId");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b =>
|
||||
{
|
||||
b.HasOne("TOOHUCardAPI.Data.Models.User", null)
|
||||
.WithMany("EncodedCardGroups")
|
||||
.HasForeignKey("UserSteamId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b =>
|
||||
{
|
||||
b.Navigation("EncodedCardGroups");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
public partial class fixgroupkeytheysendfullstring : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CardGroupNumber",
|
||||
table: "EncodedCardGroup");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "GroupKey",
|
||||
table: "EncodedCardGroup",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GroupKey",
|
||||
table: "EncodedCardGroup");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CardGroupNumber",
|
||||
table: "EncodedCardGroup",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TOOHUCardAPI.Data;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20211030045834_more columns")]
|
||||
partial class morecolumns
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.11");
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("EncodedString")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("GroupKey")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserSteamId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserSteamId");
|
||||
|
||||
b.ToTable("EncodedCardGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b =>
|
||||
{
|
||||
b.Property<string>("SteamId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("Ban")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("EndTime")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("KeySaveDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("KeyTotal")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("KeyUseCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("LastFirstWin")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LevelList")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("MaxTeamWave")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MaxWave")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PetLevel")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Point")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("Vip")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("SteamId");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b =>
|
||||
{
|
||||
b.HasOne("TOOHUCardAPI.Data.Models.User", null)
|
||||
.WithMany("EncodedCardGroups")
|
||||
.HasForeignKey("UserSteamId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b =>
|
||||
{
|
||||
b.Navigation("EncodedCardGroups");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
public partial class morecolumns : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "KeyUseCount",
|
||||
table: "Users",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "LastFirstWin",
|
||||
table: "Users",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "KeyUseCount",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastFirstWin",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,983 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TOOHUCardAPI.Data;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20211030200856_more fields and seeder")]
|
||||
partial class morefieldsandseeder
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.11");
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.Card", b =>
|
||||
{
|
||||
b.Property<string>("ItemCode")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CardName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("HasPortrait")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("HasVoice")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Quality")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("ItemCode");
|
||||
|
||||
b.ToTable("Cards");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0026",
|
||||
CardName = "rin",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0043",
|
||||
CardName = "hatate",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0014",
|
||||
CardName = "merlin",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0007",
|
||||
CardName = "hanadayousei",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2002",
|
||||
CardName = "item_2002",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0055",
|
||||
CardName = "suika",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0002",
|
||||
CardName = "nazrin",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0061",
|
||||
CardName = "keine",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0069",
|
||||
CardName = "toramaru",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0042",
|
||||
CardName = "aya",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_1011",
|
||||
CardName = "BonusEgg",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0015",
|
||||
CardName = "rumia",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0030",
|
||||
CardName = "remilia",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0028",
|
||||
CardName = "reimu",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0045",
|
||||
CardName = "kagerou",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0019",
|
||||
CardName = "marisa",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0075",
|
||||
CardName = "clownpiece",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0050",
|
||||
CardName = "nue",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0044",
|
||||
CardName = "momiji",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0011",
|
||||
CardName = "letty",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_1003",
|
||||
CardName = "BonusEgg",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0022",
|
||||
CardName = "sakuya",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0003",
|
||||
CardName = "minoriko",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2022",
|
||||
CardName = "item_2022",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2020",
|
||||
CardName = "item_2020",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2016",
|
||||
CardName = "item_2016",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2018",
|
||||
CardName = "item_2018",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2006",
|
||||
CardName = "item_2006",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2019",
|
||||
CardName = "item_2019",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2015",
|
||||
CardName = "item_2015",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2014",
|
||||
CardName = "item_2014",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0009",
|
||||
CardName = "cirno",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0038",
|
||||
CardName = "chen",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0074",
|
||||
CardName = "hecatia",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0080",
|
||||
CardName = "shinki",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0051",
|
||||
CardName = "byakuren",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_1012",
|
||||
CardName = "BonusEgg",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0029",
|
||||
CardName = "daiyousei",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0073",
|
||||
CardName = "junko",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0063",
|
||||
CardName = "kisume",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2007",
|
||||
CardName = "item_2007",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0025",
|
||||
CardName = "youmu",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0004",
|
||||
CardName = "mugiyousei",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0096",
|
||||
CardName = "seiga",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0034",
|
||||
CardName = "meirin",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2011",
|
||||
CardName = "item_2011",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2010",
|
||||
CardName = "item_2010",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2008",
|
||||
CardName = "item_2008",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0036",
|
||||
CardName = "yukari",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0018",
|
||||
CardName = "mystia",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2009",
|
||||
CardName = "item_2009",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0046",
|
||||
CardName = "sanae",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2017",
|
||||
CardName = "item_2017",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2005",
|
||||
CardName = "item_2005",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0052",
|
||||
CardName = "miko",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0023",
|
||||
CardName = "reisen",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0049",
|
||||
CardName = "minamitsu",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2004",
|
||||
CardName = "item_2004",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2003",
|
||||
CardName = "item_2003",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0056",
|
||||
CardName = "star",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0006",
|
||||
CardName = "hourainingyou",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0057",
|
||||
CardName = "sunny",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0095",
|
||||
CardName = "futo",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2001",
|
||||
CardName = "item_2001",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_1013",
|
||||
CardName = "BonusEgg",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0097",
|
||||
CardName = "yoshika",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0027",
|
||||
CardName = "utsuho",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0068",
|
||||
CardName = "komachi",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0047",
|
||||
CardName = "kanako",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0058",
|
||||
CardName = "luna",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2013",
|
||||
CardName = "item_2013",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0024",
|
||||
CardName = "yuyuko",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0093",
|
||||
CardName = "kyouko",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0005",
|
||||
CardName = "shanghainingyou",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_1006",
|
||||
CardName = "BonusEgg",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0064",
|
||||
CardName = "shikieiki",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0092",
|
||||
CardName = "medicine",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0017",
|
||||
CardName = "iku",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0013",
|
||||
CardName = "lunasa",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0091",
|
||||
CardName = "hina",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_1004",
|
||||
CardName = "BonusEgg",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0040",
|
||||
CardName = "mokou",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0088",
|
||||
CardName = "sizuha",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_2012",
|
||||
CardName = "item_2012",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0010",
|
||||
CardName = "kogasa",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0062",
|
||||
CardName = "inaba",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0001",
|
||||
CardName = "lily",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_1005",
|
||||
CardName = "BonusEgg",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0060",
|
||||
CardName = "wriggle",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0059",
|
||||
CardName = "alice",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0054",
|
||||
CardName = "yuugi",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0032",
|
||||
CardName = "flandre",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0033",
|
||||
CardName = "koakuma",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0041",
|
||||
CardName = "kaguya",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0039",
|
||||
CardName = "eirin",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0037",
|
||||
CardName = "ran",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0035",
|
||||
CardName = "yuuka",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0048",
|
||||
CardName = "suwako",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0016",
|
||||
CardName = "satori",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0053",
|
||||
CardName = "kokoro",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0008",
|
||||
CardName = "maidyousei",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0012",
|
||||
CardName = "lyrica",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0031",
|
||||
CardName = "koishi",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0094",
|
||||
CardName = "soga",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0021",
|
||||
CardName = "patchouli",
|
||||
HasPortrait = true,
|
||||
HasVoice = true,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_0020",
|
||||
CardName = "tenshi",
|
||||
HasPortrait = true,
|
||||
HasVoice = false,
|
||||
Quality = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
ItemCode = "item_1014",
|
||||
CardName = "BonusEgg",
|
||||
HasPortrait = false,
|
||||
HasVoice = false,
|
||||
Quality = 4
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("EncodedString")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("GroupKey")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserSteamId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserSteamId");
|
||||
|
||||
b.ToTable("EncodedCardGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b =>
|
||||
{
|
||||
b.Property<string>("SteamId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("Ban")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("EndTime")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("KeySaveDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("KeyTotal")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("KeyUseCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("LastFirstWin")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LevelList")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("MaxTeamWave")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MaxWave")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PetLevel")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Point")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("Vip")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("SteamId");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b =>
|
||||
{
|
||||
b.HasOne("TOOHUCardAPI.Data.Models.User", null)
|
||||
.WithMany("EncodedCardGroups")
|
||||
.HasForeignKey("UserSteamId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b =>
|
||||
{
|
||||
b.Navigation("EncodedCardGroups");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,566 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
public partial class morefieldsandseeder : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Cards",
|
||||
columns: table => new
|
||||
{
|
||||
ItemCode = table.Column<string>(type: "TEXT", nullable: false),
|
||||
CardName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Quality = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
HasVoice = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
HasPortrait = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Cards", x => x.ItemCode);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0026", "rin", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0017", "iku", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0092", "medicine", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0064", "shikieiki", true, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_1006", "BonusEgg", false, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0005", "shanghainingyou", false, false, 1 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0093", "kyouko", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0024", "yuyuko", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2013", "item_2013", false, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0058", "luna", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0047", "kanako", true, true, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0068", "komachi", true, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0027", "utsuho", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0097", "yoshika", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_1013", "BonusEgg", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2001", "item_2001", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0095", "futo", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0057", "sunny", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0006", "hourainingyou", false, false, 1 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0056", "star", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2003", "item_2003", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2004", "item_2004", false, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0049", "minamitsu", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0023", "reisen", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0013", "lunasa", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0052", "miko", true, true, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0091", "hina", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0040", "mokou", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0021", "patchouli", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0094", "soga", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0031", "koishi", true, true, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0012", "lyrica", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0008", "maidyousei", false, false, 1 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0053", "kokoro", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0016", "satori", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0048", "suwako", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0035", "yuuka", true, true, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0037", "ran", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0039", "eirin", true, true, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0041", "kaguya", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0033", "koakuma", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0032", "flandre", true, true, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0054", "yuugi", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0059", "alice", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0060", "wriggle", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_1005", "BonusEgg", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0001", "lily", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0062", "inaba", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0010", "kogasa", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2012", "item_2012", false, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0088", "sizuha", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_1004", "BonusEgg", false, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0020", "tenshi", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2005", "item_2005", false, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0046", "sanae", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2022", "item_2022", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0003", "minoriko", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0022", "sakuya", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_1003", "BonusEgg", false, false, 1 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0011", "letty", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0044", "momiji", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0050", "nue", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0075", "clownpiece", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0019", "marisa", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0045", "kagerou", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0028", "reimu", true, true, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0030", "remilia", true, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0015", "rumia", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_1011", "BonusEgg", false, false, 1 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0042", "aya", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0069", "toramaru", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0061", "keine", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0002", "nazrin", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0055", "suika", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2002", "item_2002", false, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0007", "hanadayousei", false, false, 1 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0014", "merlin", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0043", "hatate", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2020", "item_2020", false, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2017", "item_2017", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2016", "item_2016", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2006", "item_2006", false, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2009", "item_2009", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0018", "mystia", true, true, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0036", "yukari", true, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2008", "item_2008", false, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2010", "item_2010", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2011", "item_2011", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0034", "meirin", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0096", "seiga", true, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0004", "mugiyousei", false, false, 1 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0025", "youmu", true, true, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2007", "item_2007", false, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0063", "kisume", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0073", "junko", true, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0029", "daiyousei", true, true, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_1012", "BonusEgg", false, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0051", "byakuren", true, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0080", "shinki", true, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0074", "hecatia", true, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0038", "chen", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_0009", "cirno", true, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2014", "item_2014", false, false, 4 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2015", "item_2015", false, false, 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2019", "item_2019", false, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_2018", "item_2018", false, false, 2 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Cards",
|
||||
columns: new[] { "ItemCode", "CardName", "HasPortrait", "HasVoice", "Quality" },
|
||||
values: new object[] { "item_1014", "BonusEgg", false, false, 4 });
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Cards");
|
||||
}
|
||||
}
|
||||
}
|
||||
1017
TOOHUCardAPI/Migrations/20211031004851_cardlevel.Designer.cs
generated
1017
TOOHUCardAPI/Migrations/20211031004851_cardlevel.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -1,56 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
public partial class cardlevel : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LevelList",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CardLevel",
|
||||
columns: table => new
|
||||
{
|
||||
UserSteamId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
CardItemCode = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Level = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CardLevel", x => new { x.UserSteamId, x.CardItemCode });
|
||||
table.ForeignKey(
|
||||
name: "FK_CardLevel_Cards_CardItemCode",
|
||||
column: x => x.CardItemCode,
|
||||
principalTable: "Cards",
|
||||
principalColumn: "ItemCode",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_CardLevel_Users_UserSteamId",
|
||||
column: x => x.UserSteamId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "SteamId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CardLevel_CardItemCode",
|
||||
table: "CardLevel",
|
||||
column: "CardItemCode");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CardLevel");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "LevelList",
|
||||
table: "Users",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,24 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
public partial class maxpowerstuff : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PowerMaxTotal",
|
||||
table: "Users",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PowerMaxTotal",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,33 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
public partial class playerdatadoneforfrontfacing : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "PetEffect",
|
||||
table: "Users",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "PetModel",
|
||||
table: "Users",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PetEffect",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PetModel",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
public partial class dailyloginchange : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "LastDailyLoginBonus",
|
||||
table: "Users",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastDailyLoginBonus",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using NLog.Extensions.Logging;
|
||||
using TOOHUCardAPI.Data;
|
||||
using TOOHUCardAPI.Data.Repositories;
|
||||
using TOOHUCardAPI.Data.Services;
|
||||
@@ -40,6 +41,14 @@ namespace TOOHUCardAPI
|
||||
services.AddScoped<StoreService>();
|
||||
services.AddScoped<CardRepository>();
|
||||
services.AddScoped<UserService>();
|
||||
services.AddScoped<RankService>();
|
||||
services.AddScoped<GameConfigurationService>();
|
||||
services.AddLogging(opt =>
|
||||
{
|
||||
opt.ClearProviders();
|
||||
opt.AddNLog();
|
||||
});
|
||||
|
||||
services.AddAutoMapper(typeof(AutomapProfile));
|
||||
services.AddSwaggerGen(c =>
|
||||
{
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.11" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
|
||||
<PackageReference Include="NLog" Version="4.7.12" />
|
||||
<PackageReference Include="NLog.Extensions.Logging" Version="1.7.4" />
|
||||
<PackageReference Include="NLog.Schema" Version="4.7.12" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
29
TOOHUCardAPI/nlog.config
Normal file
29
TOOHUCardAPI/nlog.config
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
autoReload="true"
|
||||
internalLogToConsole="true"
|
||||
throwConfigExceptions="true"
|
||||
internalLogLevel="Info" >
|
||||
<variable name="MicrosoftLevel" value="${level:lowercase=true:truncate=4:when=level==LogLevel.Info or level==LogLevel.Warn}${when:when=level==LogLevel.Error:inner=fail}${when:when=level==LogLevel.Fatal:inner=crit}${when:when=level==LogLevel.Debug:inner=dbug}${when:when=level==LogLevel.Trace:inner=trce}" />
|
||||
<variable name="MicrosoftLayout" value="${MicrosoftLevel}: ${logger}[${event-properties:EventId_Id:whenEmpty=0}]${newline} ${message}${onexception:inner=${newline}${exception:format=tostring}}" />
|
||||
|
||||
|
||||
<!-- the targets to write to -->
|
||||
<targets async="true">
|
||||
<target xsi:type="ColoredConsole" name="logconsole"
|
||||
layout="${MicrosoftLayout}"
|
||||
useDefaultRowHighlightingRules="false"
|
||||
>
|
||||
<highlight-word foregroundColor="DarkGreen" regex="^info" />
|
||||
<highlight-word foregroundColor="Yellow" regex="^warn" />
|
||||
<highlight-word foregroundColor="Black" backgroundColor="Red" regex="^fail" />
|
||||
<highlight-word foregroundColor="White" backgroundColor="Red" regex="^crit" />
|
||||
</target>
|
||||
</targets>
|
||||
|
||||
<!-- rules to map from logger name to target -->
|
||||
<rules>
|
||||
<logger name="*" minlevel="Trace" writeTo="logconsole" />
|
||||
</rules>
|
||||
</nlog>
|
||||
Reference in New Issue
Block a user