This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,36 @@
using System;
namespace Kreta.Client.FileService.Request
{
public class DKT_FileUploadRequest : IFileUploadRequest
{
public DKT_FileUploadRequest(string fileName, byte[] content, string contentType, string path)
{
if (string.IsNullOrWhiteSpace(fileName))
{
throw new ArgumentNullException(nameof(fileName));
}
if (content?.Length == 0)
{
throw new ArgumentNullException(nameof(content));
}
if (string.IsNullOrWhiteSpace(contentType))
{
throw new ArgumentNullException(nameof(contentType));
}
FileName = fileName;
Path = path;
Content = content;
ContentType = contentType;
}
public string FileName { get; }
public string Path { get; }
public byte[] Content { get; }
public string ContentType { get; }
}
}

View file

@ -0,0 +1,34 @@
using System;
using Kreta.Client.FileService.Constant;
using Newtonsoft.Json;
namespace Kreta.Client.FileService.Request
{
public class FileDeleteRequest
{
public FileDeleteRequest(string utvonal, Guid fajlAzonosito)
{
if (string.IsNullOrWhiteSpace(utvonal))
{
throw new ArgumentNullException(nameof(utvonal));
}
if (fajlAzonosito == Guid.Empty)
{
throw new ArgumentException(nameof(fajlAzonosito));
}
Utvonal = utvonal;
FajlAzonosito = fajlAzonosito;
}
[JsonProperty(PropertyName = "konyvtar")]
public string Konyvtar => Folder.HaziFeladatok;
[JsonProperty(PropertyName = "utvonal")]
public string Utvonal { get; set; }
[JsonProperty(PropertyName = "fajlAzonosito")]
public Guid FajlAzonosito { get; set; }
}
}

View file

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using Kreta.Client.FileService.Constant;
using Kreta.Client.FileService.Model;
using Newtonsoft.Json;
namespace Kreta.Client.FileService.Request
{
public class FileFinalizeRequest
{
public FileFinalizeRequest(List<FileData> fajlok)
{
if (fajlok?.Count == 0)
{
throw new ArgumentNullException(nameof(fajlok));
}
Fajlok = fajlok;
}
[JsonProperty(PropertyName = "konyvtar")]
public string Konyvtar => Folder.HaziFeladatok;
[JsonProperty(PropertyName = "fajlok")]
public List<FileData> Fajlok { get; }
}
}

View file

@ -0,0 +1,15 @@
using System;
using Newtonsoft.Json;
namespace Kreta.Client.FileService.Request
{
public class FileFinalizeRequestV3
{
[JsonProperty(PropertyName = "fajlId")]
public Guid FajlId { get; set; }
[JsonProperty(PropertyName = "utvonal")]
public string Utvonal { get; }
}
}

View file

@ -0,0 +1,34 @@
using System;
namespace Kreta.Client.FileService.Request
{
public class FileUploadRequest : IFileUploadRequest
{
public FileUploadRequest(string fileName, byte[] content, string contentType, string path)
{
if (string.IsNullOrWhiteSpace(fileName))
{
throw new ArgumentNullException(nameof(fileName));
}
if (content?.Length == 0)
{
throw new ArgumentNullException(nameof(content));
}
if (string.IsNullOrWhiteSpace(contentType))
{
throw new ArgumentNullException(nameof(contentType));
}
Path = path;
FileName = fileName;
Content = content;
ContentType = contentType;
}
public string Path { get; }
public string FileName { get; }
public byte[] Content { get; }
public string ContentType { get; }
}
}

View file

@ -0,0 +1,38 @@
using System;
using Kreta.Client.FileService.Constant;
namespace Kreta.Client.FileService.Request
{
public class GetUrlRequest
{
public GetUrlRequest(string utvonal, Guid fajlAzonosito, string fajlNev)
{
if (string.IsNullOrWhiteSpace(utvonal))
{
throw new ArgumentNullException(nameof(utvonal));
}
if (fajlAzonosito == Guid.Empty)
{
throw new ArgumentException(nameof(fajlAzonosito));
}
if (string.IsNullOrWhiteSpace(fajlNev))
{
throw new ArgumentNullException(nameof(fajlNev));
}
Utvonal = utvonal;
FajlAzonosito = fajlAzonosito;
FajlNev = fajlNev;
}
public string Konyvtar => Folder.HaziFeladatok;
public string Utvonal { get; set; }
public Guid FajlAzonosito { get; }
public string FajlNev { get; }
}
}

View file

@ -0,0 +1,11 @@
namespace Kreta.Client.FileService.Request
{
public interface IFileUploadRequest
{
string FileName { get; }
string Path { get; }
byte[] Content { get; }
string ContentType { get; }
}
}