phase 1
This commit is contained in:
49
ModVersionChecker/model/App.cs
Normal file
49
ModVersionChecker/model/App.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using ModVersionChecker.enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
public class App
|
||||
{
|
||||
public App() { }
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("uid")]
|
||||
public string Uid { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
|
||||
[JsonPropertyName("source")]
|
||||
public string Source { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("params")]
|
||||
public Dictionary<string, string> Params { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
[JsonPropertyName("fields")]
|
||||
public Dictionary<string, string> Fields { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
[JsonPropertyName("downloadUrl")]
|
||||
public string DownloadUrl { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("currentVersion")]
|
||||
public string CurrentVersion { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("latestVersion")]
|
||||
public string LatestVersion { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public AppStatus Status { get; set; } = AppStatus.NONE;
|
||||
|
||||
[JsonPropertyName("lastCheckedAt")]
|
||||
public long LastCheckedAt { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("localCheckedAt ")]
|
||||
public long LocalCheckedAt { get; set; } = 0;
|
||||
|
||||
}
|
33
ModVersionChecker/model/Config.cs
Normal file
33
ModVersionChecker/model/Config.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using LiteDB;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ModVersionChecker.model
|
||||
{
|
||||
public class Config
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("intervalMinutes")]
|
||||
public int IntervalMinutes { get; set; } = 60;
|
||||
|
||||
[JsonPropertyName("checkOnStartup")]
|
||||
public bool CheckOnStartup { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("runOnStartup")]
|
||||
public bool RunOnStartup { get; set; } = false;
|
||||
|
||||
[JsonPropertyName("types")]
|
||||
public List<TypeConfig> Types { get; set; } = new List<TypeConfig>();
|
||||
|
||||
[JsonPropertyName("accessToekn")]
|
||||
public string AccessToken { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("refreshToken")]
|
||||
public string RefreshToken { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
25
ModVersionChecker/model/TypeConfig.cs
Normal file
25
ModVersionChecker/model/TypeConfig.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ModVersionChecker.model
|
||||
{
|
||||
public class TypeConfig
|
||||
|
||||
{
|
||||
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("shortName")]
|
||||
public string ShortName { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("configValues")]
|
||||
public Dictionary<string, string> ConfigValues { get; set; } = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user