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.

69 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ys.Core.Common;
namespace djy.Paas.Model
{/// <summary>
/// 常用标准的数据字典配置模型
/// </summary>
public class DjyDictDto
{
/// <summary>
/// 数值型ID
/// </summary>
public int IntId { get; set; }
/// <summary>
/// code
/// </summary>
public string Code { get; set; }
/// <summary>
/// 排序索引
/// </summary>
public int Index { get; set; } = 0;
/// <summary>
/// 查询索引
/// </summary>
public string Select { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// config配置 格式为逗号间隔的 key=value,key2=value3
/// </summary>
public string Config { get; set; }
/// <summary>
/// 返回配置参数的配置对象字典
/// </summary>
public Dictionary<string, string> ConfigList { get {
return GetConfig();
} }
/// <summary>
/// 序列化config返回数据字典
/// </summary>
/// <returns></returns>
public Dictionary<string, string> GetConfig()
{
var config = new Dictionary<string, string>();
if (Config.IsNotNull())
{
foreach (var item in this.Config.Split(','))
{
var val = item.Split('=');
if (val.Length == 2)
{
config.Add(val[0], val[1]);
}
}
}
return config;
}
}
}