Refactor project structure in solution

Replaced "EnvelopeGenerator.WebUI" with "EnvelopeGenerator.Server" and "EnvelopeGenerator.WebUI.Client" with "EnvelopeGenerator.Server.Client". Updated project entries, solution configuration platforms, and nested projects to reflect these changes.
This commit is contained in:
2026-06-22 15:17:34 +02:00
parent e776c2edb4
commit 27940f5d34
126 changed files with 13 additions and 13 deletions

View File

@@ -0,0 +1,24 @@
using System.Net.Http.Json;
using System.Text.Json;
using EnvelopeGenerator.WebUI.Client.Models;
using EnvelopeGenerator.WebUI.Client.Options;
using Microsoft.Extensions.Options;
namespace EnvelopeGenerator.WebUI.Client.Services;
public class SignatureService(HttpClient http, IOptions<ApiOptions> apiOptions)
{
private static readonly JsonSerializerOptions _jsonOptions = new(JsonSerializerDefaults.Web);
public async Task<IReadOnlyList<SignatureDto>> GetAsync(string envelopeKey, CancellationToken cancel = default)
{
var url = $"{apiOptions.Value.BaseUrl}/api/Signature/{Uri.EscapeDataString(envelopeKey)}";
var response = await http.GetAsync(url, cancel);
if (!response.IsSuccessStatusCode)
throw new HttpRequestException($"Failed to retrieve signatures for envelope {envelopeKey}: {response.StatusCode} {response.ReasonPhrase}");
var result = await response.Content.ReadFromJsonAsync<List<SignatureDto>>(_jsonOptions, cancel);
return result ?? [];
}
}