Files
2026-04-30 11:34:41 +08:00

85 lines
2.1 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models
{
using System.Xml.Serialization;
/// <summary>
/// 系统配置根实体类对应XML根节点SystemConfig
/// </summary>
[XmlRoot("SystemConfig")]
public class SysConfigData
{
/// <summary>
/// 数据库配置对应DbConfig节点
/// </summary>
[XmlElement("DbConfig")]
public DbConfigModel DbConfig { get; set; }
/// <summary>
/// 应用配置对应AppConfig节点
/// </summary>
[XmlElement("AppConfig")]
public AppConfigModel AppConfig { get; set; }
}
/// <summary>
/// 数据库配置实体对应DbConfig节点
/// </summary>
public class DbConfigModel
{
/// <summary>
/// SQL Server配置对应SqlServer节点含属性
/// </summary>
[XmlElement("SqlServer")]
public DbItemModel SqlServer { get; set; }
/// <summary>
/// MySQL配置对应MySql节点含属性
/// </summary>
[XmlElement("MySql")]
public DbItemModel MySql { get; set; }
}
/// <summary>
/// 数据库子项配置对应SqlServer/MySql节点含属性
/// </summary>
public class DbItemModel
{
/// <summary>
/// 连接串对应ConnStr属性
/// </summary>
[XmlAttribute("ConnStr")]
public string ConnStr { get; set; }
/// <summary>
/// 超时时间对应TimeOut属性
/// </summary>
[XmlAttribute("TimeOut")]
public int TimeOut { get; set; }
}
/// <summary>
/// 应用配置实体对应AppConfig节点
/// </summary>
public class AppConfigModel
{
[XmlElement("AppName")]
public string AppName { get; set; }
[XmlElement("Version")]
public string Version { get; set; }
[XmlElement("MaxLoginCount")]
public int MaxLoginCount { get; set; }
[XmlElement("IsDebug")]
public bool IsDebug { get; set; }
}
}