CMIF implementiert

This commit is contained in:
Simon Martens
2024-11-18 17:25:09 +01:00
parent 822cad09de
commit 6f2a276772
9 changed files with 419 additions and 31 deletions

View File

@@ -1,4 +1,3 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using HaWeb.Models;
using HaWeb.FileHelpers;

27
HaWeb/Controllers/CMIF.cs Normal file
View File

@@ -0,0 +1,27 @@
namespace HaWeb.Controllers;
using HaWeb.CMIF;
using HaWeb.FileHelpers;
using Microsoft.AspNetCore.Mvc;
[ApiController]
public class CMIFController : Controller {
private IHaDocumentWrappper _lib;
public CMIFController(IHaDocumentWrappper lib) {
_lib = lib;
}
[Route("HKB/CMIF")]
[HttpGet]
[Produces("application/xml")]
public IActionResult CMIF() {
var lib = _lib.GetLibrary();
if (lib != null) {
var document = new TeiDocument(lib);
return Ok(document);
}
return NotFound();
}
}