using System.Text.Json.Serialization; namespace FoodLabeling.Application.Contracts.Dtos.LabelTemplate; public class LabelTemplateCreateInputVo { /// /// editor JSON 里的 id,对应数据库 fl_label_template.TemplateCode /// [JsonPropertyName("id")] public string TemplateCode { get; set; } = string.Empty; /// /// editor JSON 里的 name,对应数据库 fl_label_template.TemplateName /// [JsonPropertyName("name")] public string TemplateName { get; set; } = string.Empty; [JsonPropertyName("labelType")] public string? LabelType { get; set; } [JsonPropertyName("unit")] public string Unit { get; set; } = "inch"; [JsonPropertyName("width")] public decimal Width { get; set; } [JsonPropertyName("height")] public decimal Height { get; set; } /// /// editor JSON 里的 appliedLocation(ALL / SPECIFIED,Location 维度) /// [JsonPropertyName("appliedLocation")] public string AppliedLocationType { get; set; } = "ALL"; /// 适用 Company:ALL / SPECIFIED [JsonPropertyName("appliedPartnerType")] public string? AppliedPartnerType { get; set; } /// 适用 Company(与 合并) [JsonPropertyName("partnerIds")] public List? PartnerIds { get; set; } /// 适用 Company(fl_partner.Id,与 相同) [JsonPropertyName("companyIds")] public List? CompanyIds { get; set; } /// 适用 Region:ALL / SPECIFIED [JsonPropertyName("appliedRegionType")] public string? AppliedRegionType { get; set; } [JsonPropertyName("showRuler")] public bool ShowRuler { get; set; } = true; [JsonPropertyName("showGrid")] public bool ShowGrid { get; set; } = true; /// 整标签外框:none / line / dotted [JsonPropertyName("border")] public string BorderType { get; set; } = "none"; /// 打印方向:vertical / horizontal [JsonPropertyName("printOrientation")] public string PrintOrientationType { get; set; } = "vertical"; /// /// 预留:前端可能不传;如果不传则默认 true /// [JsonPropertyName("state")] public bool State { get; set; } = true; /// /// elements(前端 editor 的 elements[],会全量重建) /// [JsonPropertyName("elements")] public List Elements { get; set; } = new(); /// /// 当 AppliedLocationType=SPECIFIED 时生效(与 合并去重) /// [JsonPropertyName("appliedLocationIds")] public List? AppliedLocationIds { get; set; } /// /// 适用 Region 多选(fl_group.Id);与 合并去重 /// [JsonPropertyName("regionIds")] public List? RegionIds { get; set; } /// /// 适用 Region 多选,与 相同 /// [JsonPropertyName("groupIds")] public List? GroupIds { get; set; } /// /// 适用门店多选(location.Id);与 Region 合并后写入 fl_label_template_location /// [JsonPropertyName("locationIds")] public List? LocationIds { get; set; } /// /// 模板与产品/标签类型绑定默认值 /// [JsonPropertyName("templateProductDefaults")] public List? TemplateProductDefaults { get; set; } }