feat: Neue Update- und Download-Methoden zu DocumentsRouteService hinzugefügt

This commit is contained in:
Developer 02 2024-09-13 12:04:35 +02:00
parent b1834c3417
commit 8249c99132
2 changed files with 31 additions and 3 deletions

View File

@ -60,6 +60,32 @@ namespace WindreamHub.Legacy.Client.Routes
} }
} }
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>());
}
} }
} }

View File

@ -127,6 +127,8 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<Folder Include="Models\Documents\Request\Delete\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>