mirror of
https://github.com/ivanch/tcc.git
synced 2025-09-13 16:01:50 +00:00
adding nginx page & simulation endpoint
This commit is contained in:
26
ASP.NET/Controllers/SimulationController.cs
Normal file
26
ASP.NET/Controllers/SimulationController.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using TCC.Services;
|
||||
|
||||
namespace TCC.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("simulation")]
|
||||
public class SimulationController : ControllerBase
|
||||
{
|
||||
public SimulationController()
|
||||
{
|
||||
}
|
||||
|
||||
[HttpGet("harmonic-progression")]
|
||||
public async Task<IActionResult> GetHarmonicProgression([FromQuery] int n)
|
||||
{
|
||||
float sum = 0;
|
||||
for (int i = 1; i <= n; i++)
|
||||
{
|
||||
sum += 1.0f / i;
|
||||
}
|
||||
|
||||
return Ok(sum);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user