UsAppLabelPreviewDto.cs 1.82 KB
using System;
using System.Collections.Generic;
using FoodLabeling.Application.Contracts.Dtos.Label;

namespace FoodLabeling.Application.Contracts.Dtos.UsAppLabeling;

/// <summary>
/// App 标签预览出参(顶部信息 + 预览模板结构)
/// </summary>
public class UsAppLabelPreviewDto
{
    /// <summary>
    /// 预览 Label ID:门店当日下一个打印序号(<c>yyyyMMdd-n</c>,如 <c>20260513-1</c>),非 <c>fl_label.Id</c>。
    /// </summary>
    public string LabelId { get; set; } = string.Empty;

    /// <summary>
    /// 模板含 Label ID 控件时返回:门店当日打印序号(yyyyMMdd-n),供 App 画布预览/出纸。
    /// </summary>
    public string? PrintLabelDisplayId { get; set; }

    public string LocationId { get; set; } = string.Empty;

    public string LabelCode { get; set; } = string.Empty;

    public string? TemplateCode { get; set; }

    public string? LabelSizeText { get; set; }

    public string? TypeName { get; set; }

    public string? ProductName { get; set; }

    public string? ProductCategoryName { get; set; }

    public string? LabelCategoryName { get; set; }

    public DateTime? LabelLastEdited { get; set; }

    /// <summary>
    /// 预览图(base64 png,可空;若为空,客户端可用 Template 自行渲染)
    /// </summary>
    public string? PreviewImageBase64Png { get; set; }

    /// <summary>
    /// 预览模板结构(与 LabelCanvas/LabelPreviewOnly 结构尽量一致)
    /// </summary>
    public LabelTemplatePreviewDto Template { get; set; } = new();

    /// <summary>
    /// 当前预览上下文(模板+产品+标签类型)命中的默认值配置。
    /// 数据来源:fl_label_template_product_default.DefaultValuesJson
    /// </summary>
    public Dictionary<string, object?>? TemplateProductDefaultValues { get; set; }
}