LabelTemplatePreviewDto.cs 1.49 KB
using System.Collections.Generic;
using System.Text.Json.Serialization;
using FoodLabeling.Application.Contracts.Dtos.LabelTemplate;

namespace FoodLabeling.Application.Contracts.Dtos.Label;

/// <summary>
/// Preview payload aligned with frontend LabelCanvas / LabelPreviewOnly template shape.
/// </summary>
public class LabelTemplatePreviewDto
{
    [JsonPropertyName("id")]
    public string Id { get; set; } = string.Empty;

    [JsonPropertyName("name")]
    public string Name { get; set; } = string.Empty;

    [JsonPropertyName("labelType")]
    public string LabelType { get; set; } = string.Empty;

    [JsonPropertyName("unit")]
    public string Unit { get; set; } = string.Empty;

    [JsonPropertyName("width")]
    public decimal Width { get; set; }

    [JsonPropertyName("height")]
    public decimal Height { get; set; }

    /// <summary>打印方向:vertical / horizontal</summary>
    [JsonPropertyName("printOrientation")]
    public string PrintOrientation { get; set; } = "vertical";

    [JsonPropertyName("appliedLocation")]
    public string AppliedLocation { get; set; } = "ALL";

    [JsonPropertyName("showRuler")]
    public bool ShowRuler { get; set; }

    [JsonPropertyName("showGrid")]
    public bool ShowGrid { get; set; }

    /// <summary>Label outer border: none / line / dotted</summary>
    [JsonPropertyName("border")]
    public string Border { get; set; } = "none";

    [JsonPropertyName("elements")]
    public List<LabelTemplateElementDto> Elements { get; set; } = new();
}