phase 1
This commit is contained in:
81
ModVersionChecker/repository/api/dto/AppResponse.cs
Normal file
81
ModVersionChecker/repository/api/dto/AppResponse.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using ModVersionChecker.enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ModVersionChecker.repository.api.dto
|
||||
{
|
||||
public class AppResponse
|
||||
{
|
||||
public AppResponse() { }
|
||||
|
||||
[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("createdAt")]
|
||||
public long CreatedAt { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("updatedAt")]
|
||||
public long UpdatedAt { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("lastCheckedAt")]
|
||||
public long LastCheckedAt { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("active")]
|
||||
public bool Active { get; set; } = false;
|
||||
|
||||
public static App toModel(AppResponse appResponse)
|
||||
{
|
||||
if (appResponse == null)
|
||||
{
|
||||
return new App();
|
||||
}
|
||||
return new App()
|
||||
{
|
||||
Id = appResponse.Id,
|
||||
Uid = appResponse.Uid,
|
||||
Name = appResponse.Name,
|
||||
Type = appResponse.Type,
|
||||
Source = appResponse.Source,
|
||||
Params = appResponse.Params,
|
||||
Fields = appResponse.Fields,
|
||||
DownloadUrl = appResponse.DownloadUrl,
|
||||
CurrentVersion = appResponse.CurrentVersion,
|
||||
LatestVersion = appResponse.LatestVersion,
|
||||
Status = appResponse.Status,
|
||||
LastCheckedAt = appResponse.LastCheckedAt,
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
15
ModVersionChecker/repository/api/dto/AppVersionsResponse.cs
Normal file
15
ModVersionChecker/repository/api/dto/AppVersionsResponse.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ModVersionChecker.repository.api.dto
|
||||
{
|
||||
public class AppVersionsResponse
|
||||
{
|
||||
public AppVersionsResponse() { }
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("latestVersion")]
|
||||
public string LatestVersion { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ModVersionChecker.repository.api.dto
|
||||
{
|
||||
public class AuthenticationResponse
|
||||
{
|
||||
[JsonPropertyName("accessToken")]
|
||||
public string AccessToken { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("refreshToken")]
|
||||
public string RefreshToken { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
32
ModVersionChecker/repository/api/dto/FieldResponse.cs
Normal file
32
ModVersionChecker/repository/api/dto/FieldResponse.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ModVersionChecker.repository.api.dto
|
||||
{
|
||||
public class FieldResponse
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("label")]
|
||||
public string Label { get; set; } = string.Empty;
|
||||
[JsonPropertyName("description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("required")]
|
||||
public bool Required { get; set; } = false;
|
||||
|
||||
[JsonPropertyName("controlType")]
|
||||
public string ControlType { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("defaultValue")]
|
||||
public string DefaultValue { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
26
ModVersionChecker/repository/api/dto/JwtTokenResponse.cs
Normal file
26
ModVersionChecker/repository/api/dto/JwtTokenResponse.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ModVersionChecker.repository.api.dto
|
||||
{
|
||||
public class JwtTokenResponse
|
||||
{
|
||||
public JwtTokenResponse() { }
|
||||
public string Token { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("exp")]
|
||||
public long ExpireAt { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("iat")]
|
||||
public long IssuedAt { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("sub")]
|
||||
public string Subject { get; set; } = string.Empty;
|
||||
|
||||
|
||||
}
|
||||
}
|
19
ModVersionChecker/repository/api/dto/SourceResponse.cs
Normal file
19
ModVersionChecker/repository/api/dto/SourceResponse.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ModVersionChecker.repository.api.dto
|
||||
{
|
||||
public class SourceResponse
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("defaults")]
|
||||
public Dictionary<string, string> Defaults { get; set; } = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
27
ModVersionChecker/repository/api/dto/TypeResponse.cs
Normal file
27
ModVersionChecker/repository/api/dto/TypeResponse.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ModVersionChecker.repository.api.dto
|
||||
{
|
||||
public class TypeResponse
|
||||
{
|
||||
|
||||
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("configFields")]
|
||||
public List<FieldResponse> ConfigFields { get; set; } = new List<FieldResponse>();
|
||||
|
||||
[JsonPropertyName("appFields")]
|
||||
public List<FieldResponse> AppFields { get; set; } = new List<FieldResponse>();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user