cscg24-photoeditor

CSCG 2024 Challenge 'PhotoEditor'
git clone https://git.sinitax.com/sinitax/cscg24-photoeditor
Log | Files | Refs | sfeed.txt

HealthController.cs (818B)


      1using System.Diagnostics;
      2using Microsoft.AspNetCore.Mvc;
      3using PhotoEditor.Models;
      4
      5namespace PhotoEditor.Controllers;
      6
      7[ApiController]
      8[Route("api/[controller]")]
      9public class HealthController : BaseAPIController
     10{
     11    private readonly ILogger<DynamicPhotoEditorController> _logger;
     12
     13    public HealthController(ILogger<DynamicPhotoEditorController> logger)
     14    {
     15        _logger = logger;
     16    }
     17
     18
     19    [HttpGet]
     20    [Route("Version")]
     21    public IActionResult Version()
     22    {
     23        return Content("{'Version':'1.0.0'}");
     24    }
     25
     26    [HttpGet]
     27    [Route("User")]
     28    public IActionResult GetUser()
     29    {
     30        var username = GetUsername(new Dictionary<String,String> { { "PATH", "/usr/bin/" } });
     31
     32        return Content(String.Format("{{'Username':'{0}'}}", username));
     33    }
     34}