init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,95 @@
|
|||
namespace Kreta.Naplo.BusinessLogic.V2.Service
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Kreta.Core.Client.MessageInvoker;
|
||||
using Kreta.Naplo.Domain.V2.Model;
|
||||
using Kreta.Naplo.Domain.V2.Model.Get.OpenBoard;
|
||||
using Kreta.Naplo.Domain.V2.Model.Get.Orarend;
|
||||
using Kreta.Naplo.Domain.V2.Model.Get.Tanmenet;
|
||||
using Kreta.Naplo.Domain.V2.Model.Get.Tanulo;
|
||||
using Kreta.Naplo.Domain.V2.Model.Post.Naplozas;
|
||||
using Kreta.Naplo.Domain.V2.Model.Post.OpenBoard;
|
||||
using Kreta.Naplo.Domain.V2.Service;
|
||||
using OrarendiOra = Kreta.Naplo.Domain.V2.Model.Get.Ora.OrarendiOra.JavasoltJelenlet;
|
||||
using TanitasiOra = Kreta.Naplo.Domain.V2.Model.Get.Ora.TanitasiOra.JavasoltJelenlet;
|
||||
|
||||
internal class CommonService : VersionedService, ICommonService
|
||||
{
|
||||
public CommonService(IHttpMessageInvokerFactory invokerFactory) : base(invokerFactory, "")
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<ResponseWrapper<List<OraGetResponse>>> GetOraListaAsync(OraGetRequest request)
|
||||
{
|
||||
return await GetAsync<ResponseWrapper<List<OraGetResponse>>>("Orarend/OraLista", request);
|
||||
}
|
||||
|
||||
public async Task<ResponseWrapper<List<object>>> ListJavasoltJelenletTemplateAsync(object request)
|
||||
{
|
||||
return await GetAsync<ResponseWrapper<List<object>>>("Ora/JavasoltJelenletTemplate", request);
|
||||
}
|
||||
|
||||
public async Task<List<object>> ListTanmenetAsync(TanmenetGetRequest request)
|
||||
{
|
||||
var size = request.Key.GetType().GetProperties().Length;
|
||||
var parameters = new KeyValuePair<string, object>?[request.Key.Length * size];
|
||||
|
||||
for (int i = 0; i < request.Key.Length; i++)
|
||||
{
|
||||
parameters[i * size] = new KeyValuePair<string, object>($"{nameof(TanmenetGetRequest.Key)}[{i}].{nameof(TanmenetKeyGetRequest.OsztalyCsoportId)}", request.Key[i].OsztalyCsoportId);
|
||||
parameters[(i * size) + 1] = new KeyValuePair<string, object>($"{nameof(TanmenetGetRequest.Key)}[{i}].{nameof(TanmenetKeyGetRequest.TantargyId)}", request.Key[i].TantargyId);
|
||||
parameters[(i * size) + 2] = new KeyValuePair<string, object>($"{nameof(TanmenetGetRequest.Key)}[{i}].{nameof(TanmenetKeyGetRequest.FeltoltoTanarId)}", request.Key[i].FeltoltoTanarId);
|
||||
}
|
||||
|
||||
return await GetAsync<List<object>>("Tanmenet", null, null, parameters);
|
||||
}
|
||||
|
||||
public async Task<List<object>> ListJavasoltJelenletAsync(OrarendiOra.JavasoltJelenletGetRequest request)
|
||||
{
|
||||
var size = request.Key.GetType().GetProperties().Length;
|
||||
var parameters = new KeyValuePair<string, object>?[request.Key.Length * size];
|
||||
|
||||
for (int i = 0; i < request.Key.Length; i++)
|
||||
{
|
||||
parameters[i * size] = new KeyValuePair<string, object>($"{nameof(OrarendiOra.JavasoltJelenletGetRequest.Key)}[{i}].{nameof(OrarendiOra.JavasoltJelenletKeyGetRequest.OrarendiOraId)}", request.Key[i].OrarendiOraId);
|
||||
parameters[(i * size) + 1] = new KeyValuePair<string, object>($"{nameof(OrarendiOra.JavasoltJelenletGetRequest.Key)}[{i}].{nameof(OrarendiOra.JavasoltJelenletKeyGetRequest.OraKezdetDatumaUtc)}", request.Key[i].OraKezdetDatumaUtc);
|
||||
parameters[(i * size) + 2] = new KeyValuePair<string, object>($"{nameof(OrarendiOra.JavasoltJelenletGetRequest.Key)}[{i}].{nameof(OrarendiOra.JavasoltJelenletKeyGetRequest.OraVegDatumaUtc)}", request.Key[i].OraVegDatumaUtc);
|
||||
}
|
||||
|
||||
return await GetAsync<List<object>>("Ora/OrarendiOra/JavasoltJelenlet", null, null, parameters);
|
||||
}
|
||||
|
||||
public async Task<List<object>> ListJavasoltJelenletAsync(TanitasiOra.JavasoltJelenletGetRequest request)
|
||||
{
|
||||
var size = request.Key.GetType().GetProperties().Length;
|
||||
var parameters = new KeyValuePair<string, object>?[request.Key.Length * size];
|
||||
|
||||
for (int i = 0; i < request.Key.Length; i++)
|
||||
{
|
||||
parameters[i * size] = new KeyValuePair<string, object>($"{nameof(TanitasiOra.JavasoltJelenletGetRequest.Key)}[{i}].{nameof(TanitasiOra.JavasoltJelenletKeyGetRequest.TanitasiOraId)}", request.Key[i].TanitasiOraId);
|
||||
}
|
||||
|
||||
return await GetAsync<List<object>>("Ora/TanitasiOra/JavasoltJelenlet", null, null, parameters);
|
||||
}
|
||||
public async Task<List<OraNaplozasResponse>> OraNaplozasAsync(List<OraNaplozasRequest> request)
|
||||
{
|
||||
return await PostAsync<List<OraNaplozasResponse>>("Orarend/OraNaplozas", request);
|
||||
}
|
||||
|
||||
public async Task<FeltoltottFajlResponse> PostFajlFeltoltesAsync(FeltoltottFajlRequest request)
|
||||
{
|
||||
return await PostAsync<FeltoltottFajlResponse>("OpenBoard/FajlFeltoltes", request);
|
||||
}
|
||||
|
||||
public async Task<FeltolthetoFajlokSzamaResponse> GetFeltolthetoFajlokSzamaAsync(FeltolthetoFajlokSzamaRequest request)
|
||||
{
|
||||
return await GetAsync<FeltolthetoFajlokSzamaResponse>("OpenBoard/FeltolthetoFajlokSzama", request);
|
||||
}
|
||||
|
||||
public async Task<List<ErtekelesGetResponse>> GetTanuloErtekeleseiAsync(ErtekelesGetRequest request)
|
||||
{
|
||||
return await GetAsync<List<ErtekelesGetResponse>>("Tanulo/Ertekeles", request);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Kreta.Core.Client.MessageInvoker;
|
||||
using Kreta.Naplo.Domain.V2.Model;
|
||||
using Kreta.Naplo.Domain.V2.Model.CustomEnum;
|
||||
using Kreta.Naplo.Domain.V2.Model.Get.Enum;
|
||||
using Kreta.Naplo.Domain.V2.Service;
|
||||
|
||||
namespace Kreta.Naplo.BusinessLogic.V2.Service
|
||||
{
|
||||
class EnumService : VersionedService, IEnumService
|
||||
{
|
||||
public async Task<ResponseWrapper<List<NaploEnumListItem>>> GetNaploEnumAsync(EnumRequest request)
|
||||
{
|
||||
return await GetAsync<ResponseWrapper<List<NaploEnumListItem>>>("NaploEnum", request);
|
||||
}
|
||||
|
||||
public EnumService(IHttpMessageInvokerFactory invokerFactory) : base(invokerFactory, "Enum")
|
||||
{ }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Kreta.Core.Client.MessageInvoker;
|
||||
using Kreta.Naplo.Domain.V2.Model.Post.Ertekeles;
|
||||
using Kreta.Naplo.Domain.V2.Service;
|
||||
|
||||
namespace Kreta.Naplo.BusinessLogic.V2.Service
|
||||
{
|
||||
class ErtekelesService : VersionedService, IErtekelesService
|
||||
{
|
||||
public async Task<List<ErtekelesResponse>> PostOsztalyCsoportErtekelesAsync(List<OsztalyCsoportErtekelesRequest> request)
|
||||
{
|
||||
return await PostAsync<List<ErtekelesResponse>>("OsztalyCsoportErtekeles", request);
|
||||
}
|
||||
public ErtekelesService(IHttpMessageInvokerFactory invokerFactory) : base(invokerFactory, "Ertekeles")
|
||||
{ }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Kreta.Core.Client.MessageInvoker;
|
||||
using Kreta.Naplo.Domain.V2.Model;
|
||||
using Kreta.Naplo.Domain.V2.Model.Get.Tanar;
|
||||
using Kreta.Naplo.Domain.V2.Service;
|
||||
|
||||
namespace Kreta.Naplo.BusinessLogic.V2.Service
|
||||
{
|
||||
class IskolaorService : VersionedService, IIskolaorService
|
||||
{
|
||||
public IskolaorService(IHttpMessageInvokerFactory invokerFactory) : base(invokerFactory, "")
|
||||
{
|
||||
}
|
||||
public async Task<ResponseWrapper<List<IskolaorResponse>>> GetIskolaorAsync(IskolaorRequest request)
|
||||
{
|
||||
return await GetAsync<ResponseWrapper<List<IskolaorResponse>>>("Iskolaor", request);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Kreta.Core.Client.MessageInvoker;
|
||||
using Kreta.Naplo.Domain.V2.Model;
|
||||
using Kreta.Naplo.Domain.V2.Model.Get.Tanulo;
|
||||
using Kreta.Naplo.Domain.V2.Service;
|
||||
|
||||
namespace Kreta.Naplo.BusinessLogic.V2.Service
|
||||
{
|
||||
class OraService : VersionedService, IOraService
|
||||
{
|
||||
public async Task<ResponseWrapper<List<MulasztasResponse>>> GetMulasztasAsync(MulasztasRequest request)
|
||||
=> await GetAsync<ResponseWrapper<List<MulasztasResponse>>>("Mulasztas", request);
|
||||
|
||||
public async Task<ResponseWrapper<List<FeljegyzesResponse>>> GetFeljegyzesAsync(FeljegyzesRequest request)
|
||||
=> await GetAsync<ResponseWrapper<List<FeljegyzesResponse>>>("Feljegyzes", request);
|
||||
|
||||
public async Task<ResponseWrapper<OsztalyTanuloiResponse>> GetOsztalyTanuloiAsync(OsztalyTanuloiRequest request)
|
||||
=> await GetAsync<ResponseWrapper<OsztalyTanuloiResponse>>("OsztalyTanuloi", request);
|
||||
public OraService(IHttpMessageInvokerFactory invokerFactory) : base(invokerFactory, "Ora")
|
||||
{ }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
using System.Threading.Tasks;
|
||||
using Kreta.Core.Client.MessageInvoker;
|
||||
using Kreta.Naplo.Domain.V2.Model;
|
||||
using Kreta.Naplo.Domain.V2.Model.Get.Tanar;
|
||||
using Kreta.Naplo.Domain.V2.Service;
|
||||
|
||||
namespace Kreta.Naplo.BusinessLogic.V2.Service
|
||||
{
|
||||
class TanarService : VersionedService, ITanarService
|
||||
{
|
||||
public async Task<ResponseWrapper<ProfilResponse>> GetProfilAsync(ProfilRequest request)
|
||||
{
|
||||
return await GetAsync<ResponseWrapper<ProfilResponse>>("Profil", request);
|
||||
}
|
||||
|
||||
public TanarService(IHttpMessageInvokerFactory invokerFactory) : base(invokerFactory, "Tanar")
|
||||
{ }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
using Kreta.Core.Client.MessageInvoker;
|
||||
|
||||
namespace Kreta.Naplo.BusinessLogic.V2
|
||||
{
|
||||
/// <summary>
|
||||
/// Versioned service
|
||||
/// </summary>
|
||||
class VersionedService : BusinessLogic.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// Get base url
|
||||
/// </summary>
|
||||
protected override string BaseUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return Infrastructure.Helpers.Http.CombineUrl(string.Format($"{this.Context.BaseUrl}/Naplo/V2", this.Context.InstituteCode), this.RelativeUrl);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TeacherClientProxy"/> class.
|
||||
/// </summary>
|
||||
/// <param name="invoker">Message invoker</param>
|
||||
/// <param name="relativeUrl">The relative URL.</param>
|
||||
public VersionedService(IHttpMessageInvokerFactory invokerFactory, string relativeUrl) : base(invokerFactory, relativeUrl) { }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue