Show time passed since ban instead of "forever"

reworked event api to include all events (sans unknown)
This commit is contained in:
RaidMax
2018-06-16 21:11:25 -05:00
parent 5be6b75ccf
commit e7c7145da1
19 changed files with 861 additions and 128 deletions

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SharedLibraryCore.Dtos
{
/// <summary>
/// This class holds the basic info for api entities
/// </summary>
public class EntityInfo
{
public int Id { get; set; }
public string Name { get; set; }
}
}

View File

@ -1,39 +1,19 @@
using System;
using static SharedLibraryCore.GameEvent;
namespace SharedLibraryCore.Dtos
{
/// <summary>
/// This class wraps the information related to a generated event for the API
/// </summary>
public class EventInfo
{
public EventInfo(EventType Ty, EventVersion V, string M, string T, string O, string Ta)
{
Type = Ty;
Version = V;
Message = System.Web.HttpUtility.HtmlEncode(M);
Title = T;
Origin = System.Web.HttpUtility.HtmlEncode(O);
Target = System.Web.HttpUtility.HtmlEncode(Ta);
ID = Math.Abs(DateTime.Now.GetHashCode());
}
public enum EventType
{
NOTIFICATION,
STATUS,
ALERT,
}
public enum EventVersion
{
IW4MAdmin
}
public EventType Type;
public EventVersion Version;
public string Message;
public string Title;
public string Origin;
public string Target;
public int ID;
public EntityInfo OriginEntity { get; set; }
public EntityInfo TargetEntity { get; set; }
public EntityInfo EventType { get; set; }
public EntityInfo OwnerEntity { get; set; }
public DateTime EventTime { get; set; }
public string ExtraInfo { get; set; }
public string Id { get; private set; } = Guid.NewGuid().ToString();
}
}