using Opsoft.Data; using System; namespace Opsoft.NetCore.O3App.Shared { public static class Constants { /// /// 路由前缀 /// public const string RoutePrefix = "/O3App/api"; public static class DateTimes { /// /// 本应用默认时间:1900-01-01 00:00:00 /// public static readonly DateTime Default = new DateTime(1900, 1, 1); /// /// 格林威治(GMT)基准时间:1970-01-01 00:00:00 /// public static readonly DateTime GMTBenchMark = new DateTime(1970, 1, 1); } public static DateTime GetExpiryDate(int unitType, DateTime? fkDate, int kfperiod) { return unitType switch { 0 => Convert.ToDateTime(fkDate).AddDays(kfperiod), 1 => Convert.ToDateTime(fkDate).AddMonths(kfperiod).AddDays(-1.0), 2 => Convert.ToDateTime(fkDate).AddYears(kfperiod).AddDays(-1.0), _ => Convert.ToDateTime(fkDate).AddDays(kfperiod), }; } public static class DatabaseNames { /// /// oracle /// public const string Default = "PDAServerContext"; } public static class CharText { public const char Star = '*'; public const char Vertical = '|'; public const char Comma = ','; public const char Semicolon = ';'; public const char Horizontal = '-'; public const char Dollar = '$'; public const char Slash = '/'; public const char Backslash = '\\'; public const char Dot = '.'; public const char Plus = '+'; } public static class Whether { public const int No = 0; public const int Yes = 1; } public static class AppNames { public static readonly string Self = "opsoft.netcore.O3App"; } public static class EnvironmentNames { public const string Product = "product"; public const string Stage = "stage"; public const string QA = "qa"; } public static class ContentTypes { public const string FormUrlEncoded = "application/x-www-form-urlencoded"; public const string Json = "application/json"; } public static class Protocols { public const string HTTP = "http:"; public const string HTTPS = "https:"; public const string FTP = "ftp:"; } public static class DateTimeFormats { /// /// yyyy-MM-dd /// public const string Date = "yyyy-MM-dd"; /// /// yyyy-MM-dd HH:mm:ss /// public const string DateTime = "yyyy-MM-dd HH:mm:ss"; } } }