Feat/usage stats collection (#317)
* feat: implement anonymous usage data collection Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
This commit is contained in:
parent
b25335acbd
commit
1c9b2572ae
23 changed files with 613 additions and 17 deletions
33
API/DTOs/UsageStatisticsDto.cs
Normal file
33
API/DTOs/UsageStatisticsDto.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace API.DTOs
|
||||
{
|
||||
public class UsageStatisticsDto
|
||||
{
|
||||
public UsageStatisticsDto()
|
||||
{
|
||||
MarkAsUpdatedNow();
|
||||
ClientsInfo = new List<ClientInfoDto>();
|
||||
}
|
||||
|
||||
public string InstallId { get; set; }
|
||||
public DateTime LastUpdate { get; set; }
|
||||
public UsageInfoDto UsageInfo { get; set; }
|
||||
public ServerInfoDto ServerInfo { get; set; }
|
||||
public List<ClientInfoDto> ClientsInfo { get; set; }
|
||||
|
||||
public void MarkAsUpdatedNow()
|
||||
{
|
||||
LastUpdate = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public void AddClientInfo(ClientInfoDto clientInfoDto)
|
||||
{
|
||||
if (ClientsInfo.Any(x => x.IsTheSameDevice(clientInfoDto))) return;
|
||||
|
||||
ClientsInfo.Add(clientInfoDto);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue