Fixed RegistrationDto
This commit is contained in:
@@ -1,2 +1,35 @@
|
|||||||
// Get Methoden um Metrics abzugreifen
|
// Get Methoden um Metrics abzugreifen
|
||||||
// Get Methden um Informationen über den Status des Servers einzuholen
|
// Get Methden um Informationen über den Status des Servers einzuholen
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using watcher_monitoring.Models;
|
||||||
|
|
||||||
|
using watcher_monitoring.Data;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace watcher_monitoring.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Route("[controller]")]
|
||||||
|
public class APIController : Controller
|
||||||
|
{
|
||||||
|
private readonly WatcherDbContext _context;
|
||||||
|
|
||||||
|
private readonly ILogger<APIController> _logger;
|
||||||
|
|
||||||
|
public APIController(WatcherDbContext context, ILogger<APIController> logger)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("servers")]
|
||||||
|
public async Task<IActionResult> Servers()
|
||||||
|
{
|
||||||
|
List<Server> servers = await _context.Servers.ToListAsync();
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace watcher_monitoring.Payloads;
|
namespace watcher_monitoring.Payloads;
|
||||||
|
|
||||||
public class RegistrationDto
|
public class RegistrationDto
|
||||||
{
|
{
|
||||||
public required string IpAddress;
|
[Required]
|
||||||
public required string Key;
|
public required string IpAddress { get; set; }
|
||||||
|
[Required]
|
||||||
|
public required string Key { get; set; }
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user