init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,8 @@
|
|||
namespace Kreta.Client.SzirApi.Configuration
|
||||
{
|
||||
public interface ISzirApiClientConfiguration
|
||||
{
|
||||
string ApiUrl { get; }
|
||||
string ApiKey { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Client.SzirApi.Configuration
|
||||
{
|
||||
public class SzirApiClientConfiguration : ConfigurationSection, ISzirApiClientConfiguration
|
||||
{
|
||||
[ConfigurationProperty(nameof(ApiUrl), IsRequired = true)]
|
||||
public string ApiUrl => (string)base[nameof(ApiUrl)];
|
||||
|
||||
[ConfigurationProperty(nameof(ApiKey), IsRequired = true)]
|
||||
public string ApiKey => (string)base[nameof(ApiKey)];
|
||||
}
|
||||
}
|
11
Kreta.Client/SzirApi/ISzirApiClient.cs
Normal file
11
Kreta.Client/SzirApi/ISzirApiClient.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using Kreta.Client.SzirApi.Request;
|
||||
using Kreta.Client.SzirApi.Response;
|
||||
|
||||
namespace Kreta.Client.SzirApi
|
||||
{
|
||||
public interface ISzirApiClient
|
||||
{
|
||||
StatuszResponse GetStatusz(StatuszRequest request);
|
||||
AdatszolgResponse SendAdatszolg(AdatszolgRequest request);
|
||||
}
|
||||
}
|
12
Kreta.Client/SzirApi/Request/AdatszolgRequest.cs
Normal file
12
Kreta.Client/SzirApi/Request/AdatszolgRequest.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Client.SzirApi.Request
|
||||
{
|
||||
public class AdatszolgRequest
|
||||
{
|
||||
public string IntezmenyAzonosito { get; set; }
|
||||
public int TanevId { get; set; }
|
||||
public int StatuszAllapot { get; set; }
|
||||
public List<FeladatEllatasiHelyRequest> FeladatEllatasiHelyek { get; set; }
|
||||
}
|
||||
}
|
32
Kreta.Client/SzirApi/Request/FeladatEllatasiHelyRequest.cs
Normal file
32
Kreta.Client/SzirApi/Request/FeladatEllatasiHelyRequest.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
namespace Kreta.Client.SzirApi.Request
|
||||
{
|
||||
public class FeladatEllatasiHelyRequest
|
||||
{
|
||||
public int FeladatellatasiHelyId { get; set; }
|
||||
public float AllamiTamogatasOsszesen { get; set; }
|
||||
public float AllamiTamogatasEtkezesiDij { get; set; }
|
||||
public float BefizetettOsszesen { get; set; }
|
||||
public float BefizetettTeritesiDij { get; set; }
|
||||
public float BefizetettTeritesiErtkezesiDij { get; set; }
|
||||
public float BefizetettTandij { get; set; }
|
||||
public float BefizetettEgyeb { get; set; }
|
||||
public float FenntartoiHozzajarulas { get; set; }
|
||||
public float SajatBevetelek { get; set; }
|
||||
public float SzemelyiJelleguBerkoltseg { get; set; }
|
||||
public float SzemelyiJelleguBerkoltsegPedOktato { get; set; }
|
||||
public float SzemelyiJelleguBerkoltsegNoks { get; set; }
|
||||
public float SzemelyiJelleguBerkoltsegEgyeb { get; set; }
|
||||
public float SzemelyiJelleguJarulek { get; set; }
|
||||
public float SzemelyiJelleguJarulekPedOktato { get; set; }
|
||||
public float SzemelyiJelleguJarulekNoks { get; set; }
|
||||
public float SzemelyiJelleguJarulekEgyeb { get; set; }
|
||||
public float SzemelyiJelleguSzemelyiEgyebKifizetes { get; set; }
|
||||
public float SzemelyiJelleguSzemelyiEgyebKifizetesPedOktato { get; set; }
|
||||
public float SzemelyiJelleguEgyebKifizetes { get; set; }
|
||||
public float OraadoKifizetesek { get; set; }
|
||||
public float DologiKifizetesek { get; set; }
|
||||
public float FejlesztesiKifizetesek { get; set; }
|
||||
public float FelujitasiKiadasok { get; set; }
|
||||
public float BeruhazasiKiadasok { get; set; }
|
||||
}
|
||||
}
|
8
Kreta.Client/SzirApi/Request/StatuszRequest.cs
Normal file
8
Kreta.Client/SzirApi/Request/StatuszRequest.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
namespace Kreta.Client.SzirApi.Request
|
||||
{
|
||||
public class StatuszRequest
|
||||
{
|
||||
public string IntezmenyAzonosito { get; set; }
|
||||
public int TanevId { get; set; }
|
||||
}
|
||||
}
|
12
Kreta.Client/SzirApi/Response/AdatszolgResponse.cs
Normal file
12
Kreta.Client/SzirApi/Response/AdatszolgResponse.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Kreta.Client.SzirApi.Response
|
||||
{
|
||||
public class AdatszolgResponse : StatuszResponse
|
||||
{
|
||||
}
|
||||
}
|
33
Kreta.Client/SzirApi/Response/StatuszResponse.cs
Normal file
33
Kreta.Client/SzirApi/Response/StatuszResponse.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Client.SzirApi.Response
|
||||
{
|
||||
public class StatuszResponse
|
||||
{
|
||||
public TechnikaiResponse Technikai { get; set; }
|
||||
public List<AdatResponse> Adat { get; set; }
|
||||
}
|
||||
|
||||
public class TechnikaiResponse
|
||||
{
|
||||
public string Verzio { get; set; }
|
||||
public string Forras { get; set; }
|
||||
public string ForrasUrl { get; set; }
|
||||
public Guid Azonosito { get; set; }
|
||||
public string EllenorzoKod { get; set; }
|
||||
public DateTime Idopont { get; set; }
|
||||
public string KeresAzonosito { get; set; }
|
||||
}
|
||||
|
||||
public class AdatResponse
|
||||
{
|
||||
public string IntezmenyAzonosito { get; set; }
|
||||
public int TanevId { get; set; }
|
||||
public bool Zarolt { get; set; }
|
||||
public int StatuszKod { get; set; }
|
||||
public string StatuszNev { get; set; }
|
||||
public string StatuszSzoveg { get; set; }
|
||||
}
|
||||
}
|
||||
|
61
Kreta.Client/SzirApi/SzirApiClient.cs
Normal file
61
Kreta.Client/SzirApi/SzirApiClient.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using Kreta.Client.ClientBase;
|
||||
using Kreta.Client.SzirApi.Configuration;
|
||||
using Kreta.Client.SzirApi.Request;
|
||||
using Kreta.Client.SzirApi.Response;
|
||||
using Kreta.Resources;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.SzirApi
|
||||
{
|
||||
internal class SzirApiClient : RestSharpClientBase, ISzirApiClient
|
||||
{
|
||||
private readonly ISzirApiClientConfiguration _szirApiClientConfiguration;
|
||||
|
||||
public SzirApiClient(ISzirApiClientConfiguration szirApiClientConfiguration)
|
||||
{
|
||||
_szirApiClientConfiguration = szirApiClientConfiguration ?? throw new ArgumentNullException(nameof(szirApiClientConfiguration));
|
||||
}
|
||||
|
||||
public StatuszResponse GetStatusz(StatuszRequest request)
|
||||
{
|
||||
BaseUrl = _szirApiClientConfiguration.ApiUrl;
|
||||
|
||||
var relativeUri = $"szirstat/external/ksh2535/statusz";
|
||||
var response = Post(relativeUri, GetHeaders(), body: request);
|
||||
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<StatuszResponse>(response.Result);
|
||||
}
|
||||
|
||||
throw new ApplicationException(SZIRAdatszolgResource.SikertelenKSH2535SikertelenStatuszLekeres);
|
||||
}
|
||||
|
||||
public AdatszolgResponse SendAdatszolg(AdatszolgRequest request)
|
||||
{
|
||||
BaseUrl = _szirApiClientConfiguration.ApiUrl;
|
||||
|
||||
var relativeUri = $"szirstat/external/ksh2535/adatszolg";
|
||||
var response = Post(relativeUri, GetHeaders(), body: request);
|
||||
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<AdatszolgResponse>(response.Result);
|
||||
}
|
||||
|
||||
throw new ApplicationException(SZIRAdatszolgResource.SikertelenKSH2535SikertelenAdatszolgaltatas);
|
||||
}
|
||||
|
||||
private Dictionary<string, string> GetHeaders()
|
||||
{
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "apiKey", _szirApiClientConfiguration.ApiKey },
|
||||
{ "Content-Type", "application/json" },
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue