feat: Neue Update- und Download-Methoden zu DocumentsRouteService hinzugefügt
This commit is contained in:
parent
b1834c3417
commit
8249c99132
@ -59,7 +59,33 @@ namespace WindreamHub.Legacy.Client.Routes
|
||||
return await FetchAsync(route: $"/Upload?{query}", method: HttpMethod.Post, body: fileContent).ThenAsync(res => res.Simplify<DocResponse, DocResponse>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<SimplifiedResponse<DocResponse, DocResponse>> Update(DocBody docUpdateBody)
|
||||
=> await FetchAsync(route: "/Update", method: HttpMethod.Post, body: docUpdateBody.Stringify())
|
||||
.ThenAsync(res => res.Simplify<DocResponse, DocResponse>());
|
||||
|
||||
public async Task<SimplifiedResponse<DocResponse, DocResponse>> Download(long? item_id = null, string item_location = null, string item_name = null, object stream_identity = null, params Flag[] flags)
|
||||
{
|
||||
var query = HttpUtility.ParseQueryString(string.Empty);
|
||||
|
||||
if (item_id != null)
|
||||
query["parameter.item.id"] = item_id.ToString();
|
||||
|
||||
if (item_location != null)
|
||||
query["parameter.item.location"] = item_location;
|
||||
|
||||
if (item_name != null)
|
||||
query["parameter.item.name"] = item_name;
|
||||
|
||||
if (flags != null && flags.Length > 0)
|
||||
query["parameter.flags"] = string.Join(",", flags.Select(flag => (int)flag));
|
||||
|
||||
if (stream_identity != null)
|
||||
query["parameter.stream.__identity"] = stream_identity.ToString();
|
||||
|
||||
|
||||
|
||||
return await FetchAsync(route: $"/Download?{query}", method: HttpMethod.Get).ThenAsync(res => res.Simplify<DocResponse, DocResponse>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -127,6 +127,8 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\Documents\Request\Delete\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
Loading…
x
Reference in New Issue
Block a user