-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from tekgator/dev
v1.1.0
- Loading branch information
Showing
11 changed files
with
70 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using ServerJarsAPI.Models; | ||
|
||
namespace ServerJarsAPI.Extensions; | ||
|
||
public static class JarTypesExtensions | ||
{ | ||
public static List<JarTypeItem> ToList(this JarTypes jarTypes) | ||
{ | ||
List<JarTypeItem> list = new(); | ||
|
||
list.AddRange(jarTypes.Vanilla.Select(v => new JarTypeItem() { Category = nameof(jarTypes.Vanilla).ToLower(), Type = v })); | ||
list.AddRange(jarTypes.Bedrock.Select(v => new JarTypeItem() { Category = nameof(jarTypes.Bedrock).ToLower(), Type = v })); | ||
list.AddRange(jarTypes.Servers.Select(v => new JarTypeItem() { Category = nameof(jarTypes.Servers).ToLower(), Type = v })); | ||
list.AddRange(jarTypes.Modded.Select(v => new JarTypeItem() { Category = nameof(jarTypes.Modded).ToLower(), Type = v })); | ||
list.AddRange(jarTypes.Proxies.Select(v => new JarTypeItem() { Category = nameof(jarTypes.Proxies).ToLower(), Type = v })); | ||
|
||
return list; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ServerJarsAPI.Models; | ||
namespace ServerJarsAPI.Models; | ||
|
||
internal class ApiError | ||
{ | ||
[JsonPropertyName("message")] | ||
public string Message { get; set; } = string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,23 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ServerJarsAPI.Models; | ||
namespace ServerJarsAPI.Models; | ||
|
||
public class JarDetails | ||
{ | ||
[JsonPropertyName("version")] | ||
public string Version { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("file")] | ||
public string File { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("size")] | ||
public Size Size { get; set; } = new(); | ||
|
||
[JsonPropertyName("md5")] | ||
public string Md5 { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("built")] | ||
//public long Built { get; set; } = 0; | ||
public DateTime Built { get; set; } = DateTime.MinValue; | ||
|
||
[JsonPropertyName("stability")] | ||
public string Stability { get; set; } = string.Empty; | ||
} | ||
|
||
public class Size | ||
{ | ||
[JsonPropertyName("display")] | ||
public string Display { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("bytes")] | ||
public uint Bytes { get; set; } = 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace ServerJarsAPI.Models; | ||
|
||
public class JarTypeItem | ||
{ | ||
public string Category { get; set; } = string.Empty; | ||
public string Type { get; set; } = string.Empty; | ||
|
||
public override string ToString() => $"{Category}:{Type}"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ServerJarsAPI.Models; | ||
namespace ServerJarsAPI.Models; | ||
|
||
public class JarTypes | ||
{ | ||
[JsonPropertyName("bedrock")] | ||
public List<string> Bedrock { get; set; } = new(); | ||
|
||
[JsonPropertyName("modded")] | ||
public List<string> Modded { get; set; } = new(); | ||
|
||
[JsonPropertyName("proxies")] | ||
public List<string> Proxies { get; set; } = new(); | ||
|
||
[JsonPropertyName("servers")] | ||
public List<string> Servers { get; set; } = new(); | ||
|
||
[JsonPropertyName("vanilla")] | ||
public List<string> Vanilla { get; set; } = new(); | ||
} |