You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
5.5 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// ============================================================================
// 【文件说明】HwPortalConfig.cs - 门户配置实体类
// ============================================================================
// 这个实体类对应数据库表 hw_portal_config用于存储门户的配置信息。
//
// 【业务场景】
// 门户配置是官网的核心配置数据,包括:
// - 首页轮播图配置
// - 导航菜单配置
// - 页面区块配置
// - 按钮和路由配置
//
// 这个表支持树形结构parent_id + ancestors可以形成层级配置。
// ============================================================================
namespace Admin.NET.Plugin.HwPortal;
/// <summary>
/// 门户配置实体类。
/// <para>
/// 【业务说明】
/// 门户配置用于管理官网的各种配置项,支持:
/// 1. 树形结构parent_id + ancestors 实现层级配置
/// 2. 分类管理portal_config_type 区分不同类型的配置
/// 3. 排序控制portal_config_order 控制展示顺序
/// 4. 路由配置router_address 配置跳转地址
/// </para>
/// </summary>
[SugarTable("hw_portal_config")]
public class HwPortalConfig : HwPortalBaseEntity
{
/// <summary>
/// 配置主键ID。
/// </summary>
[SugarColumn(ColumnName = "portal_config_id", IsPrimaryKey = true, IsIdentity = true)]
public long? PortalConfigId { get; set; }
/// <summary>
/// 配置类型。
/// <para>
/// 【业务说明】
/// 用于区分不同类型的配置,如:
/// - "1": 首页配置
/// - "2": 产品配置
/// - "3": 案例配置
/// </para>
/// </summary>
[SugarColumn(ColumnName = "portal_config_type")]
public string PortalConfigType { get; set; }
/// <summary>
/// 配置类型ID。
/// <para>
/// 【业务说明】
/// 关联 hw_portal_config_type 表的主键。
/// </para>
/// </summary>
[SugarColumn(ColumnName = "portal_config_type_id")]
public long? PortalConfigTypeId { get; set; }
/// <summary>
/// 配置标题。
/// </summary>
[SugarColumn(ColumnName = "portal_config_title")]
public string PortalConfigTitle { get; set; }
/// <summary>
/// 排序号。
/// </summary>
[SugarColumn(ColumnName = "portal_config_order")]
public long? PortalConfigOrder { get; set; }
/// <summary>
/// 配置描述。
/// </summary>
[SugarColumn(ColumnName = "portal_config_desc")]
public string PortalConfigDesc { get; set; }
/// <summary>
/// 按钮名称。
/// <para>
/// 【业务说明】
/// 如果这个配置项需要展示按钮,这里配置按钮的文字。
/// 例如:"了解更多"、"立即咨询"。
/// </para>
/// </summary>
[SugarColumn(ColumnName = "button_name")]
public string ButtonName { get; set; }
/// <summary>
/// 路由地址。
/// <para>
/// 【业务说明】
/// 点击配置项后跳转的路由地址。
/// 例如:"/product/detail"、"http://external.com"。
/// </para>
/// </summary>
[SugarColumn(ColumnName = "router_address")]
public string RouterAddress { get; set; }
/// <summary>
/// 配置图片。
/// <para>
/// 【业务说明】
/// 配置项的图片URL用于轮播图、缩略图等。
/// </para>
/// </summary>
[SugarColumn(ColumnName = "portal_config_pic")]
public string PortalConfigPic { get; set; }
/// <summary>
/// 配置类型名称(冗余字段)。
/// </summary>
[SugarColumn(ColumnName = "config_type_name")]
public string ConfigTypeName { get; set; }
/// <summary>
/// 首页配置类型图片。
/// </summary>
[SugarColumn(ColumnName = "home_config_type_pic")]
public string HomeConfigTypePic { get; set; }
/// <summary>
/// 首页配置类型图标。
/// </summary>
[SugarColumn(ColumnName = "config_type_icon")]
public string HomeConfigTypeIcon { get; set; }
/// <summary>
/// 首页配置类型名称。
/// </summary>
[SugarColumn(ColumnName = "home_config_type_name")]
public string HomeConfigTypeName { get; set; }
/// <summary>
/// 首页配置类型分类。
/// </summary>
[SugarColumn(ColumnName = "config_type_classfication")]
public string HomeConfigTypeClassfication { get; set; }
/// <summary>
/// 父配置ID。
/// <para>
/// 【树形结构说明】
/// 用于构建层级配置结构:
/// - parent_id 为 null 或 0顶级配置
/// - parent_id 有值:子配置
/// </para>
/// </summary>
[SugarColumn(ColumnName = "parent_id")]
public long? ParentId { get; set; }
/// <summary>
/// 祖级列表。
/// <para>
/// 【树形结构说明】
/// ancestors 存储从根节点到当前节点的完整路径,用逗号分隔。
/// 例如:"0,100,101" 表示:根节点(0) -> 一级节点(100) -> 当前节点(101)
///
/// 【为什么需要 ancestors
/// 1. 快速查询所有子节点WHERE ancestors LIKE '0,100,%'
/// 2. 快速查询所有父节点:按 ancestors 中的 ID 逐级查询
/// 3. 避免递归查询:不需要递归就能获取层级关系
///
/// 对比 Java 若依:
/// 若依的菜单、部门等树形结构也使用 ancestors 字段。
/// 这是若依框架的标准设计模式。
/// </para>
/// </summary>
[SugarColumn(ColumnName = "ancestors")]
public string Ancestors { get; set; }
}