WIP: ZugferdRESTService
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ZUGFeRDRESTService.Controllers
|
||||
{
|
||||
public class ZugferdValidationResponse
|
||||
{
|
||||
public string status;
|
||||
public string message;
|
||||
public List<string> errors;
|
||||
|
||||
public static string RESPONSE_OK = "OK";
|
||||
public static string RESPONSE_ERROR = "ERROR";
|
||||
|
||||
public ZugferdValidationResponse()
|
||||
{
|
||||
status = RESPONSE_OK;
|
||||
message = String.Empty;
|
||||
errors = new List<string>();
|
||||
}
|
||||
}
|
||||
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class ZugferdValidationController : ControllerBase
|
||||
{
|
||||
private readonly IZugferdValidationDataService _dataService;
|
||||
|
||||
public ZugferdValidationController(IZugferdValidationDataService dataService)
|
||||
{
|
||||
_dataService = dataService;
|
||||
}
|
||||
|
||||
// POST: api/ZugferdValidation
|
||||
[HttpPost]
|
||||
public ZugferdValidationResponse Post(List<IFormFile> files)
|
||||
{
|
||||
var oFiles = files;
|
||||
var oResponse = new ZugferdValidationResponse
|
||||
{
|
||||
message = "You uploaded " + oFiles.Count + " files."
|
||||
};
|
||||
|
||||
return oResponse;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user