66 lines
1.5 KiB
C#
66 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace YD_Event.Core.Certificate;
|
|
|
|
/// <summary>
|
|
/// 证书模型
|
|
/// </summary>
|
|
public class CertificateModel
|
|
{
|
|
/// <summary>
|
|
/// 证书名称
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// 证书编号
|
|
/// </summary>
|
|
public string Code { get; set; }
|
|
|
|
/// <summary>
|
|
/// 背景图片URL
|
|
/// </summary>
|
|
public string BackgroundImageUrl { get; set; }
|
|
|
|
/// <summary>
|
|
/// 宽度
|
|
/// </summary>
|
|
public int Width { get; set; }
|
|
|
|
/// <summary>
|
|
/// 高度
|
|
/// </summary>
|
|
public int Height { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 证书文档
|
|
/// </summary>
|
|
public class CertificateDocument
|
|
{
|
|
private readonly CertificateModel _model;
|
|
private readonly List<YD_Event.Core.Entities.CertificateElement> _elements;
|
|
private readonly Dictionary<string, string> _data;
|
|
private readonly string _qrCodeUrl;
|
|
|
|
public CertificateDocument(CertificateModel model, List<YD_Event.Core.Entities.CertificateElement> elements,
|
|
Dictionary<string, string> data, string qrCodeUrl)
|
|
{
|
|
_model = model;
|
|
_elements = elements;
|
|
_data = data;
|
|
_qrCodeUrl = qrCodeUrl;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 生成PDF
|
|
/// </summary>
|
|
/// <returns>PDF字节数组</returns>
|
|
public byte[] GeneratePdf()
|
|
{
|
|
// 这里应该使用QuestPDF生成PDF
|
|
// 暂时返回空字节数组,实际项目中需要实现
|
|
return new byte[0];
|
|
}
|
|
}
|