Compare commits

..

1 Commits

Author SHA1 Message Date
56334d6a64 테스트 프로젝트 추가 2025-10-15 02:04:16 +09:00
5 changed files with 5 additions and 99 deletions

View File

@@ -7,8 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WarhoundConsole", "Warhound
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WarhoundLib", "WarhoundLib\WarhoundLib.csproj", "{7E3472E9-86E9-4032-826C-0DA805C2EBCE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WarhoundTest", "WarhoundTest\WarhoundTest.csproj", "{D22BEA2A-08E9-498A-A087-FEFB8FA2AD08}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -23,10 +21,6 @@ Global
{7E3472E9-86E9-4032-826C-0DA805C2EBCE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E3472E9-86E9-4032-826C-0DA805C2EBCE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E3472E9-86E9-4032-826C-0DA805C2EBCE}.Release|Any CPU.Build.0 = Release|Any CPU
{D22BEA2A-08E9-498A-A087-FEFB8FA2AD08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D22BEA2A-08E9-498A-A087-FEFB8FA2AD08}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D22BEA2A-08E9-498A-A087-FEFB8FA2AD08}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D22BEA2A-08E9-498A-A087-FEFB8FA2AD08}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -1,52 +1,10 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace WarhoundConsole
namespace WarhoundConsole
{
public class Program
internal class Program
{
public static void Main(string[] args)
static void Main(string[] args)
{
try
{
MainInternal(args);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
private static void MainInternal(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseUrls("http://localhost:80");
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
app.UseSwagger();
app.UseSwaggerUI();
app.MapControllers();
app.UseExceptionHandler(ExceptionHandler);
app.Run();
}
private static void ExceptionHandler(IApplicationBuilder applicationBuilder)
{
applicationBuilder.Run(async context =>
{
var exceptionHandlerFeature = context.Features.Get<IExceptionHandlerFeature>();
if (exceptionHandlerFeature != null)
{
var exception = exceptionHandlerFeature.Error;
// Do something here
}
});
Console.WriteLine("Hello, World!");
}
}
}

View File

@@ -1,40 +0,0 @@
using Microsoft.AspNetCore.Mvc;
namespace WarhoundConsole
{
[ApiController]
[Route("api/test")]
public class Test : ControllerBase
{
[HttpGet("hello")]
public ActionResult<string> GetGreeting()
{
string message = "Hello!!!";
if (message.Length != 0)
{
//throw new Exception("Hello");
}
return Ok(message);
}
[HttpGet("data")]
public ActionResult<object> GetData()
{
var data = new { Id = 1, Name = "Sample Data", Timestamp = DateTime.UtcNow };
return Ok(data);
}
[HttpPost("json")]
public ActionResult<object> asd([FromBody] object obj)
{
//if (obj == null)
//{
// return BadRequest("Invalid data.");
//}
Console.Write(obj.ToString());
return Ok(new { a = 1, b = 2, c = "c" });
}
}
}

View File

@@ -9,8 +9,6 @@
<ItemGroup>
<ProjectReference Include="..\WarhoundLib\WarhoundLib.csproj" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.4" />
</ItemGroup>
</Project>

View File

@@ -12,8 +12,4 @@
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\WarhoundLib\WarhoundLib.csproj" />
</ItemGroup>
</Project>