Add updatetime to rank entries

This commit is contained in:
2021-11-07 00:43:38 -04:00
parent 6f591af5ae
commit aa3a2cb4f4
6 changed files with 1160 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
@@ -9,12 +10,20 @@ namespace TOOHUCardAPI.DTO.RankData
{
[JsonProperty("rank_type")]
public string RankType { get; set; }
[JsonProperty("steamid")]
public long SteamId { get; set; }
[JsonProperty("userid")]
public long UserId { get; set; }
[JsonProperty("username")]
public string Username { get; set; }
[JsonProperty("version")]
public string Version { get; set; }
[JsonProperty("wave")]
public int Wave { get; set; }
[JsonProperty("damage")]
public long Damage { get; set; }
[JsonProperty("updatetime")]
public DateTime UpdateTime { get; set; }
[JsonIgnore]
public Dictionary<string, string> Cards { get; set; }
}
@@ -32,6 +41,7 @@ namespace TOOHUCardAPI.DTO.RankData
Version = rankEntry.Version,
Wave = rankEntry.Wave,
Damage = rankEntry.Damage,
UpdateTime = rankEntry.UpdateTime,
Cards = rankEntry.TowersUsed.Select(tower => KeyValuePair.Create(tower.TowerKey, tower.EncodedData))
.ToDictionary(kv => kv.Key, kv => kv.Value)
};