Initial resumable file upload.

Other changes.
This commit is contained in:
2020-03-25 17:31:42 +01:00
parent 2a8f4cbb8d
commit d546edaa0d
11 changed files with 462 additions and 68 deletions

View File

@@ -4,6 +4,7 @@
{
public string Authority { get; set; }
public string Endpoint { get; set; }
public string BasePath { get; set; }
public string DiscoveryEndpointUrl { get; set; }
public string RedirectUri { get; set; }
public string ClientId { get; set; }

View File

@@ -0,0 +1,45 @@
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json.Linq;
namespace FarmmapsApi.Models
{
public class FileRequest
{
/// <summary>
/// Code of the parent
/// </summary>
/// <example>41971e7ea8a446069a817e66b608dcae</example>
public string ParentCode { get; set; }
/// <summary>
/// Geometry meta data
/// </summary>
/// <example>{"type": "Point","coordinates": [5.27, 52.10]}</example>
public JObject Geometry { get; set; }
/// <summary>
/// Name of the file to upload
/// </summary>
/// <example>MyFile.tiff</example>
[Required]
public string Name { get; set; }
/// <summary>
/// Size of the file to upload
/// </summary>
/// <example>67351</example>
[Required]
public long Size { get; set; }
/// <summary>
/// If a chunked upload, the size of a single chunk
/// </summary>
/// <example>1048576</example>
public long ChunkSize { get; set; }
/// <summary>
/// Optional data for the item coupled with the file
/// </summary>
public JObject Data { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
namespace FarmmapsApi.Models
{
public class FileResponse : FileRequest
{
/// <summary>
/// Code created for the registered file, use this in subsequent calls
/// </summary>
/// <example>a00fbd18320742c787f99f952aef0dbb</example>
public string Code { get; set; }
/// <summary>
/// If a chunked upload, the number of chunks to upload
/// </summary>
/// <example>1</example>
public long Chunks { get; set; }
}
}