Added [Obsolete] attribute to GetAnnotationParams in ConfigController to indicate that PSPDF Kit will no longer be used and the method is deprecated. This warns developers to avoid using this method in future development.
31 lines
979 B
C#
31 lines
979 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")]
|
|
[Obsolete("PSPDF Kit will no longer be used.")]
|
|
public IActionResult GetAnnotationParams()
|
|
{
|
|
return Ok(_annotationParams.AnnotationJSObject);
|
|
}
|
|
}
|