You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
853 B
26 lines
853 B
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using PaymentServer.Models;
|
|
using PaymentServer.Services;
|
|
|
|
namespace PaymentServer.Controllers
|
|
{
|
|
[Route("[controller]")]
|
|
[ApiController]
|
|
public class NewPaymentsController : ControllerBase
|
|
{
|
|
[HttpGet("{timestamp}")]
|
|
public ActionResult<string> Get(string timestamp)
|
|
{
|
|
DateTime dateTime = DateTime.Parse(timestamp);
|
|
List<VendorPayment>? payments = PaymentDataService.GetNew(dateTime);
|
|
if (payments == null)
|
|
return NotFound();
|
|
ContractData contractData = new ContractData();
|
|
contractData.AddPayments(payments);
|
|
string contractJson = contractData.ToJson();
|
|
Console.WriteLine(contractJson);
|
|
return Ok(contractJson);
|
|
}
|
|
}
|
|
}
|
|
|