Replaced all EnvelopeGenerator.GeneratorAPI namespaces with EnvelopeGenerator.API across controllers, models, extensions, middleware, and annotation-related files. Updated using/import statements and namespace declarations accordingly. Added wwwroot folder to project file. Minor code adjustments made for consistency. This unifies API naming for improved clarity and maintainability.
30 lines
927 B
C#
30 lines
927 B
C#
using EnvelopeGenerator.API.Models.PsPdfKitAnnotation;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
namespace EnvelopeGenerator.API.Controllers;
|
|
|
|
/// <summary>
|
|
/// Exposes configuration data required by the client applications.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Initializes a new instance of <see cref="ConfigController"/>.
|
|
/// </remarks>
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
[Authorize]
|
|
public class ConfigController(IOptionsMonitor<AnnotationParams> annotationParamsOptions) : ControllerBase
|
|
{
|
|
private readonly AnnotationParams _annotationParams = annotationParamsOptions.CurrentValue;
|
|
|
|
/// <summary>
|
|
/// Returns annotation configuration that was previously rendered by MVC.
|
|
/// </summary>
|
|
[HttpGet("Annotations")]
|
|
public IActionResult GetAnnotationParams()
|
|
{
|
|
return Ok(_annotationParams.AnnotationJSObject);
|
|
}
|
|
}
|