refactor(ISignature): create to handle common properties of a signature
- implement to entity and dto
This commit is contained in:
parent
94ce416aa1
commit
bf0bd8e9e7
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Common.Dto;
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
@ -6,7 +7,7 @@ namespace EnvelopeGenerator.Application.Common.Dto;
|
|||||||
/// Data Transfer Object representing a positioned element assigned to a document receiver.
|
/// Data Transfer Object representing a positioned element assigned to a document receiver.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public class SignatureDto
|
public class SignatureDto : ISignature
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the unique identifier of the element.
|
/// Gets or sets the unique identifier of the element.
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using System.ComponentModel;
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
@ -13,7 +14,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
|
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
|
||||||
public class Signature
|
public class Signature : ISignature
|
||||||
{
|
{
|
||||||
public Signature()
|
public Signature()
|
||||||
{
|
{
|
||||||
|
|||||||
11
EnvelopeGenerator.Domain/Interfaces/ISignature.cs
Normal file
11
EnvelopeGenerator.Domain/Interfaces/ISignature.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
namespace EnvelopeGenerator.Domain.Interfaces
|
||||||
|
{
|
||||||
|
public interface ISignature
|
||||||
|
{
|
||||||
|
int Page { get; set; }
|
||||||
|
|
||||||
|
double X { get; set; }
|
||||||
|
|
||||||
|
double Y { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -226,12 +226,18 @@ public class EnvelopeController : ViewControllerBase
|
|||||||
{
|
{
|
||||||
using var pdf = Pdf.FromMemory(doc.ByteData).Design(1, canvas =>
|
using var pdf = Pdf.FromMemory(doc.ByteData).Design(1, canvas =>
|
||||||
{
|
{
|
||||||
canvas.SetStrokeColor(ColorConstants.RED);
|
canvas.SetFillColor(new DeviceRgb(135, 62, 35));
|
||||||
canvas.SetFillColor(ColorConstants.CYAN);
|
|
||||||
canvas.SetFillColorRgb(222, 220, 215);
|
|
||||||
canvas.SetLineWidth(2);
|
|
||||||
canvas.Rectangle(100, 500, 200, 100);
|
canvas.Rectangle(100, 500, 200, 100);
|
||||||
|
|
||||||
|
canvas.Fill();
|
||||||
|
|
||||||
|
canvas.SetFillColor(new DeviceRgb(222, 220, 215));
|
||||||
|
|
||||||
|
canvas.SetStrokeColor(new DeviceRgb(135, 62, 35));
|
||||||
|
canvas.Circle(300, 500, 100);
|
||||||
canvas.FillStroke();
|
canvas.FillStroke();
|
||||||
|
canvas.Fill();
|
||||||
});
|
});
|
||||||
|
|
||||||
doc.ByteData = pdf.ExportAsBytes();
|
doc.ByteData = pdf.ExportAsBytes();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user