using PublicCode.APIModel;
using System;
using System.Collections.Generic;
using System.Text;
namespace PublicCode.SystemManage
{
public class SysConfig
{
///
/// 系统基础设置
///
public BaseSysConfig baseSysConfg { get; set; }
///
/// 当前系统配置
///
public CurrentSysConfig currentSysConfig { get; set; }
///
///
///
public Logging Logging { get; set; }
///
/// 允许访问的主机
///
public string AllowedHosts { get; set; }
///
/// 数据库连接配置类
///
public DBConnModel DBConnModel { get; set; }
///
/// 文件系统配置类
///
public FileConfig FileConfig { get; set; }
///
/// Redis配置类
///
public RedisConfig RedisConfig { get; set; }
///
/// Cookie主机
///
public string HostName { get; set; }
///
/// 默认日志路径
///
public string LogPath { get; set; }
///
/// 错误日志路径
///
public string ErrorLogPath { get; set; }
///
/// 记录型日志路径
///
public string InfoLogPath { get; set; }
///
/// 临时文件目录
///
public string tempFilePath { get; set; }
//AiToolsAPI
///
/// 轮循间隔时间
///
public int LoopInterval { get; set; }
///
/// 最大轮循次数
///
public int MaxLoopNumber { get; set; }
///
/// 腾讯API接口参数
///
public TCApiModel TCApi { get; set; }
///
/// 百度API接口参数
///
public BDApiModel BDApi { get; set; }
///
/// 模板配置
///
public Template template { get; set; }
}
///
/// 系统基础配置
///
public class BaseSysConfig
{
///
/// mac字符串地址
///
public string macStr { get; set; }
///
/// 发送机的IP
///
public string sendPort { get; set; }
///
/// 接收机的IP,广播方式使用255.255.255.255
///
public string toPort { get; set; }
///
/// 发送机使用的端口
///
public string sendIp { get; set; }
///
/// 接收机的端口
///
public string toIp { get; set; }
///
/// 本机网络ip
///
public string receiveIp { get; set; }
///
/// 本机接收端口
///
public string receivePort { get; set; }
///
/// 运行的功能,1监听,2发送,3监听+发送
///
public string startProject { get; set; }
///
/// 转换后的mac地址
///
public int[] mac
{
get
{
int[] macArr = new int[6];
var strs = macStr.Split('-');
int index = 0;
foreach (var a in strs)
{
macArr[index++] = Convert.ToInt32(a.ToString(), 16);
}
return macArr;
}
}
}
public class LogLevel
{
///
///
///
public string Default { get; set; }
///
///
///
public string Microsoft { get; set; }
}
public class Logging
{
///
///
///
public LogLevel LogLevel { get; set; }
}
///
/// 数据库配置
///
public class DBConnModel
{
///
/// 数据库主机
///
public string DBHost { get; set; }
///
/// 连接的用户
///
public string ConnectionUserid { get; set; }
///
/// 连接密码
///
public string ConnectionPwd { get; set; }
///
/// 系统主数据库(默认数据库)
///
public string MainDBName { get; set; }
}
///
/// 文件配置
///
public class FileConfig
{
///
/// 文件存放的主机
///
public string Host { get; set; }
///
/// 默认访问路径
///
public string DefaultPath { get; set; }
///
/// 文件外部引用下载路径
///
public string ShareFileDownloadPath { get; set; }
///
/// 临时文件外部引用下载路径
///
public string ShareTempFileDownloadPath { get; set; }
///
/// 文件分享后的访问路径
///
public string VisitorFileLocation { get; set; }
///
/// 文件系统的用户文件存储区域
///
public string FileSystem_UserFile { get; set; }
///
/// 文件系统中的临时空间目录
///
public string FileSystem_TempUserFile { get; set; }
}
///
/// Redis配置
///
public class RedisConfig
{
///
/// Redis连接字符串
///
public string ConnStr { get; set; }
///
/// Redis主机
///
public string Host { get; set; }
///
/// Redis端口
///
public string Port { get; set; }
///
/// Redis连接密码
///
public string Pwd { get; set; }
}
///
/// 系统模板配置
///
public class Template {
///
/// Excel模板
///
public Dictionary ExcelTemplate { get; set; }
}
///
/// 系统模板配置
///
public class ExcelTemplateModel {
///
/// 模板名称
///
public string TemplateName { get; set; }
///
/// 文件存放路径(网络路径)
///
public string FilePath { get; set; }
///
/// 文件系统中的共享下载key
///
public string ShareKey { get; set; }
///
/// 模板中的列名
///
public List Columns { get; set; }
}
public class CurrentSysConfig
{
///
/// 用户默认头像所在路径
///
public string DefaultHeadImg { get; set; }
}
}