using DOCGEN; using EDOKA_Database; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Model; using System.Runtime.Serialization; namespace EDOOKAAPI.Controllers { [Route("api/[controller]")] [ApiController] public class Dokumente : ControllerBase { [HttpGet("GetDoc{DocID}", Name = "GetDoc")] public IActionResult GetDoc(string DocID) { DOCGEN.clsGetDoc gd = new DOCGEN.clsGetDoc(AppParams.connectionstring); clsdok dok = new clsdok("", "", ""); dok = gd.GetDoc(DocID); if (dok.doktype == "") { //dok.doktype = Get_FileType(dok.dokument); } gd = null; return Ok(dok); } [HttpGet("GetDoc/PDF{DocID}", Name = "GetPDF")] public IActionResult GetDocAsPDF(string DocID) { DOCGEN.clsGetDoc gd = new DOCGEN.clsGetDoc(AppParams.connectionstring); clsdok dok = new clsdok("", "", ""); dok.dokument= gd.GetDocAsPDF(DocID); dok.doktype = "P"; dok.extension = "pdf"; return Ok(dok); } } }