Upload server files

This commit is contained in:
BreadDEV 2024-01-21 11:18:08 +07:00
parent 23f1a470f4
commit 0d5cabe7ab
8 changed files with 120 additions and 0 deletions

View file

@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Http.HttpResults;
using Supercell.Soil.SDK.Models.Environment;
namespace Supercell.Soil.SDK.Handlers;
public static class EnvironmentHandler
{
public static JsonHttpResult<EnvironmentSettings> OnEnvironmentSettings()
{
return TypedResults.Json(new EnvironmentSettings()
{
Environment = "production",
AssetUrl = "",
ServerHost = "",
UpdateUrl = "",
Status = "",
Update = ""
});
}
}

View file

@ -0,0 +1,24 @@
using System.Text.Json.Serialization;
namespace Supercell.Soil.SDK.Models.Environment;
public record EnvironmentSettings
{
[JsonPropertyName("environment")]
public required string Environment { get; set; }
[JsonPropertyName("assetUrl")]
public string? AssetUrl { get; set; }
[JsonPropertyName("serverHost")]
public string? ServerHost { get; set; }
[JsonPropertyName("updateUrl")]
public string? UpdateUrl { get; set; }
[JsonPropertyName("status")]
public string? Status { get; set; }
[JsonPropertyName("update")]
public required string Update { get; set; }
}

View file

@ -0,0 +1,21 @@
using Supercell.Soil.SDK.Handlers;
namespace Supercell.Soil.SDK;
internal static class Program
{
private static async Task Main(string[] args)
{
Console.Title = "Supercell.Soil | SDK";
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseUrls("http://*:8080");
WebApplication app = builder.Build();
app.MapGet("/env_settings", EnvironmentHandler.OnEnvironmentSettings);
await app.RunAsync();
}
}

View file

@ -0,0 +1,12 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"Supercell.Soil.SDK": {
"commandName": "Project",
"applicationUrl": "http://*:8080",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View file

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View file

@ -0,0 +1 @@
{}

25
Supercell.Soil.sln Normal file
View file

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34316.72
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Supercell.Soil.SDK", "Supercell.Soil.SDK\Supercell.Soil.SDK.csproj", "{D7836B7D-C192-4824-94AC-79EF57FB4AC2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D7836B7D-C192-4824-94AC-79EF57FB4AC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7836B7D-C192-4824-94AC-79EF57FB4AC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7836B7D-C192-4824-94AC-79EF57FB4AC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7836B7D-C192-4824-94AC-79EF57FB4AC2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AFC5BCA6-AA78-4B23-9DAC-4FFFE7A9873F}
EndGlobalSection
EndGlobal