using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Models
{
    public class ConfigEntity
    {
        /// <summary>
        /// 主要数据库
        /// </summary>
        public   string Connection => this.DBTYPE == 1 ? this.DefaultConnection:this.MYSQL;

        /// <summary>
        /// 日志数据库
        /// </summary>
        public string Connection_log => this.DBTYPE == 1 ? this.LogDB:this.MYSQL_LOG;


        public static ConfigEntity Instance = new();

        /// <summary>
        /// 起始时间  数据库查询的时间起始范围  小于这个范围就不会查询
        /// </summary>
        public DateTime STARTTIME { get; set; } = DateTime.Parse("2022-03-25 00:00:01");


        /// <summary>
        /// ftp 路径
        /// </summary>
        public string FTPPATH { get; set; } = string.Empty;

        /// <summary>
        /// ftp 账号
        /// </summary>
        public string FTPUSERNAME { get; set; } = string.Empty;

        /// <summary>
        /// ftp 密码
        /// </summary>
        public string FTPPASSWORD { get; set; } = string.Empty;


        /// <summary>
        /// ftp IP
        /// </summary>
        public string FTPIP { get; set; } = string.Empty;



        /// <summary>
        /// 阿里数据查询范围
        /// </summary>
        public int ASLS { get; set; } = 30;



        /// <summary>
        ///  查询间隔
        /// </summary>
        public int NOW_S { get; set; } = 1;



        /// <summary>
        /// 巫工数据库连接字符串
        /// </summary>
        public string OtherDB { get; set; } = string.Empty;



        /// <summary>
        ///  debug专属数据库连接字符串
        /// </summary>
        public string DEBUGGER_DB { get; set; } = string.Empty;


        /// <summary>
        ///  Engineering_DB数据库连接字符串
        /// </summary>
        public string Engineering_DB { get; set; } = string.Empty;


        /// <summary>
        /// 数据库类型  1 sql server  2 mysql
        /// </summary>
        public int DBTYPE { get; set; } = 1;

        
        /// <summary>
        /// mysql数据库
        /// </summary>
        public   string MYSQL { get; set; }

        /// <summary>
        /// mysql数据库
        /// </summary>
        public string MYSQL_LOG { get; set; }


        /// <summary>
        /// 主要数据库
        /// </summary>
        public string DefaultConnection { get; set; }
        /// <summary>
        /// 巫工接口
        /// </summary>
        public string url_api { get; set; }
        public string url_key { get; set; }
        /// <summary>
        /// APPID
        /// </summary>
        public int Appid { get; set; }
        /// <summary>
        /// Redis
        /// </summary>
        public string Redis { get; set; }
       /// <summary>
       /// 日志数据库
       /// </summary>
        public string LogDB { get; set; }
        /// <summary>
        /// 登录接口
        /// </summary>
        public string Url { get; set; }
       /// <summary>
       /// 是否准许多个地方同时间登录
       /// </summary>
        public bool IsMore { get; set; }

        /// <summary>
        /// RUCS端口 tcp通讯使用      客户端 端口
        /// </summary>
        public int RUCS_PROT { get; set; } = 8558;

        /// <summary>
        /// RUCSip tcp通讯使用    客户端 ip
        /// </summary>
        public string RUCS_IP { get; set; } = "47.119.147.104";

        /// <summary>
        /// 是否前期开发测试
        /// </summary>
        public bool DEV { get; set; }


        /// <summary>
        /// client tcp通讯使用  连接 其他TCP 端口 未使用
        /// </summary>
        public int CLIENT_PROT { get; set; } = 8028;


        /// <summary>
        /// server tcp通讯使用  作为主机 供的客户端使用  端口  使用
        /// </summary>
        public int SERVER_PROT { get; set; } = 1221;



       
    }
    public class JwtConst
    {
        public static JwtConst Instance = new();
        /// <summary>
        /// 密钥 
        /// </summary>
        public string SecurityKey { get; set; }
        public string Domain { get; set; }
    }


   

}
