Seperated eventhub service from api service.

wip nbs flow.
Changed uploading a bit.
This commit is contained in:
2020-03-25 21:32:28 +01:00
parent e638370ad4
commit 691be2185e
11 changed files with 151 additions and 81 deletions

View File

@@ -55,7 +55,7 @@ namespace FarmmapsApi.Services
/// completed.
/// Caller is responsible for closing the <paramref name="contentStream"/>.
/// </remarks>
public FarmmapsUploader(ConfigurableHttpClient httpClient, Stream contentStream, FileRequest body, string contentType)
public FarmmapsUploader(ConfigurableHttpClient httpClient, Stream contentStream, FileRequest body, string contentType, string path)
: base(contentStream,
new ResumableUploadOptions
{
@@ -69,9 +69,12 @@ namespace FarmmapsApi.Services
_streamLength = ContentStream.CanSeek ? ContentStream.Length : UnknownSize;
var twoMB = 2 * 0x100000;
ChunkSize = twoMB;
body.ChunkSize = ChunkSize;
Body = body;
Path = "api/v1/file";
Path = path;
HttpClient = httpClient;
HttpMethod = HttpConsts.Post;
ContentType = contentType;