mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-07-02 17:03:41 -04:00
Reorganize all observatory core projects into monorepo (#25)
* chore: move all observatory repos to core * only save journal folder on change, don't constantly re-check during monitoring * chore: monorepo project changes * chore: monorepo migration
This commit is contained in:
47
ObservatoryFramework/Files/Journal/JournalBase.cs
Normal file
47
ObservatoryFramework/Files/Journal/JournalBase.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Observatory.Framework.Files.Journal
|
||||
{
|
||||
public class JournalBase
|
||||
{
|
||||
[JsonPropertyName("timestamp")]
|
||||
public string Timestamp { get; init; }
|
||||
|
||||
[JsonIgnore]
|
||||
public DateTime TimestampDateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return DateTime.ParseExact(Timestamp, "yyyy-MM-ddTHH:mm:ssZ", null, System.Globalization.DateTimeStyles.AssumeUniversal);
|
||||
}
|
||||
}
|
||||
|
||||
[JsonPropertyName("event")]
|
||||
public string Event { get; init; }
|
||||
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, object> AdditionalProperties { get; init; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string Json
|
||||
{
|
||||
get => json;
|
||||
set
|
||||
{
|
||||
if (json == null || string.IsNullOrWhiteSpace(json))
|
||||
{
|
||||
json = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Journal property \"Json\" can only be set while empty.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string json;
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user