Files
secure-core/SecureCore/Controllers/EmployeeController.cs
T

49 lines
1.2 KiB
C#

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SecureCore.Services;
using SecureCore.Authentication;
namespace SecureCore.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class EmployeeController : Controller
{
private readonly IDataService DataService;
public EmployeeController(IDataService dataService)
{
DataService = dataService;
}
[HttpGet]
public IActionResult Get()
{
//if (Authentication.IsAllowed(HttpContext))
return Ok(DataService.Get());
//else
// return Unauthorized();
}
[HttpGet("{id}", Name = "Get")]
public IActionResult Get(int id)
{
//if (Authentication.IsAllowed(HttpContext))
return Ok(DataService.GetById(id));
//else
// return Unauthorized();
}
}
public class AuthenticatedUser
{
public string UserName { get; set; }
public string SessionToken { get; set; }
}
}